Ubuntu Server’da MYSQL için uzaktan erişim açmak

Bunun için /etc/mysql/my.cnf dosyasındaki bind-address kısmına sunucu IP değerini yazdıktan sonra mysql’e terminalde bağlanıp;

mysql> GRANT ALL PRIVILEGES ON *.* TO 'mehmet'@'%'
    ->     WITH GRANT OPTION;

Eğer kullanıcı yoksa;

mysql> CREATE USER 'kullaniciadi'@'%' IDENTIFIED BY 'parola';

ile oluşturulabilir.

NginX Install On Ubuntu

sudo apt-get update
sudo apt-get install nginx
sudo apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
apt-get install php5-fpm

PHP-FPM için etc/php5/fpm/php.ini içinden short open tags ve display errors açılmalı.

server {
server_name example.com;
root path_to_your_public_root_dir;

index index.html index.php index.htm;

# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}

location / {
# Check if a file exists, or route it to index.php.
try_files $uri $uri/ /index.php;
}

location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

}

kaydından bu kayda geçilir;

server {
server_name example.com;
root path_to_your_public_root_dir;
include /etc/nginx/ci_host;
}

# /etc/nginx/ci_host
index index.html index.php index.htm;

# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}

location / {
# Check if a file exists, or route it to index.php.
try_files $uri $uri/ /index.php;
}

location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

Nginx ayarlarında css, jpg gibi uzantıları hatalarla ilişkilendirmek bu uzantılar URL değişkenler içinde geçtiğinde sorun çıkartıyor.

Apache Benchmark Test for NginX vs. Apache

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Finished 176 requests
Server Software: nginx/1.4.1
Server Hostname: localhost
Server Port: 80
Document Path: /index.php
Document Length: 0 bytes
Concurrency Level: 1
Time taken for tests: 10.032 seconds
Complete requests: 176
Failed requests: 0
Write errors: 0
Non-2xx responses: 176
Total transferred: 182328 bytes
HTML transferred: 0 bytes
Requests per second: 17.54 [#/sec] (mean)
Time per request: 57.000 [ms] (mean)
Time per request: 57.000 [ms] (mean, across all concurrent requests)
Transfer rate: 17.75 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 36 57 31.9 52 361
Waiting: 36 57 31.9 52 361
Total: 36 57 31.9 53 361
Percentage of the requests served within a certain time (ms)
50% 53
66% 56
75% 57
80% 57
90% 61
95% 82
98% 157
99% 250
100% 361 (longest request)
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Finished 171 requests
Server Software: Apache/2.4.6
Server Hostname: localhost
Server Port: 80
Document Path: /index.php
Document Length: 0 bytes
Concurrency Level: 1
Time taken for tests: 10.006 seconds
Complete requests: 171
Failed requests: 0
Write errors: 0
Non-2xx responses: 171
Total transferred: 178512 bytes
HTML transferred: 0 bytes
Requests per second: 17.09 [#/sec] (mean)
Time per request: 58.514 [ms] (mean)
Time per request: 58.514 [ms] (mean, across all concurrent requests)
Transfer rate: 17.42 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 36 58 32.0 55 443
Waiting: 36 58 32.0 55 443
Total: 36 58 32.0 56 444
Percentage of the requests served within a certain time (ms)
50% 55
66% 57
75% 58
80% 59
90% 62
95% 67
98% 83
99% 186
100% 444 (longest request)