На момент написания
PHP Version 5.3.27
nginx 1.5.6
MySQL 5.6.14
Apache httpd 2.2.25
PHP — http://windows.php.net/download/. Вам необходимо скачать версию с инсталлятором (*.msi) в варианте Thread Safe;
MySQL — http://dev.mysql.com/downloads/mysql/. Также скачайте версию с msi-инсталлятором;
nginx — http://nginx.org/ru/download.html. Скачайте последнюю версию;
apache - http://httpd.apache.org/
http://apache-mirror.rbc.ru/pub/apache/httpd/binaries/win32/
RunHiddenConsole —http://redmine.lighttpd.net/attachments/660/RunHiddenConsole.zip.
репозиторий расширений PHP
http://downloads.php.net/pierre/
Коротко настройки
nginx
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
directio 10m;
expires max;
charset utf-8;
proxy_buffers 8 64k;
proxy_intercept_errors on;
proxy_connect_timeout 1s;
proxy_read_timeout 5s;
proxy_send_timeout 5s;
client_max_body_size 200m;
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
directio 10m;
expires max;
charset utf-8;
proxy_buffers 8 64k;
proxy_intercept_errors on;
proxy_connect_timeout 1s;
proxy_read_timeout 5s;
proxy_send_timeout 5s;
client_max_body_size 200m;
gzip on;
gzip_disable "msie6"
gzip_min_length 1024;
gzip_vary on;
gzip_buffers 64 8k;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
upstream backend {
server 127.0.0.1:9000;
server 127.0.0.1:9001;
server 127.0.0.1:9002;
server 127.0.0.1:9003;
}
.....
server {
listen 80;
server_name *.*;
gzip_disable "msie6"
gzip_min_length 1024;
gzip_vary on;
gzip_buffers 64 8k;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
upstream backend {
server 127.0.0.1:9000;
server 127.0.0.1:9001;
server 127.0.0.1:9002;
server 127.0.0.1:9003;
}
.....
server {
listen 80;
server_name *.*;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location ~ /\.ht {
deny all;
}
location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov|avi|mpg|map|xml|flv|swf|rtf)$ {
root e:/sites;
expires 30d;
}
location ~ /(.+\.php) {
root e:/;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME d:/sites/$host$fastcgi_script_name;
fastcgi_param QUERY_STRING $args;
fastcgi_param SERVER_NAME $host;
include fastcgi_params;
}
location / {
root e:/$host;
proxy_pass http://127.0.0.1:8080;
}
LoadModule fcgid_module modules/mod_fcgid.so (скачать)
LoadModule rpaf_module modules/mod_rpaf.so (скачать)
Options Indexes FollowSymLinks ExecCGI
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 192.168.1.100- ваш айпи сервера
RPAFheader X-Forwarded-For
<IfModule mod_fcgid.c>
MaxRequestLen 100485760
FcgidConnectTimeout 65
MaxRequestsPerProcess 500
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 192.168.1.100- ваш айпи сервера
RPAFheader X-Forwarded-For
<IfModule mod_fcgid.c>
MaxRequestLen 100485760
FcgidConnectTimeout 65
MaxRequestsPerProcess 500
FcgidInitialEnv PHPRC "d:/php"
AddHandler fcgid-script .php
FcgidWrapper "d:/php/php-cgi.exe" .php
</IfModule>Для запуска php-cgi.exe в фоновом режиме, использую RunHiddenConsole:
echo Starting servers...
start d:\nginx\nginx.exe -p d:\nginx
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9000 -c d:/php/php.ini
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9001 -c d:/php/php.ini
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9002 -c d:/php/php.ini
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9003 -c d:/php/php.ini
net start MySQL56
net start Apache2.2
echo Starting servers...
start d:\nginx\nginx.exe -p d:\nginx
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9000 -c d:/php/php.ini
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9001 -c d:/php/php.ini
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9002 -c d:/php/php.ini
start d:\RunHiddenConsole.exe d:\php\php-cgi.exe -b 127.0.0.1:9003 -c d:/php/php.ini
net start MySQL56
net start Apache2.2
Комментариев нет :
Отправить комментарий