Eu tento instalar o nginx. Eu costumava lighttpd, mas agora devemos instalar o nginx.
Você pode me ajudar com a configuração nginx?
Eu uso o debian 6.
Meu nginx.conf:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Minha aparência de ativação / padrão do site como
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /var/www; #!
index index.php index.html index.htm; #1
access_log /var/log/nginx/access.log info;
error_log /var/log/nginx/error.log info;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
autoindex on;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}
eu adiciono ao php.ini
cgi.fix_pathinfo = 0;
php5-cgi está sendo executado como
spawn-fcgi 127.0.0.1 -p 9000 -u www-data -f / usr / bin / php5-cgi
Mas recebo erro 502 (gateway ruim)
Meu / var / log / diga
2012/05/16 15:35:25 [error] 13427#0: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /ndex.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
Por favor, ajuda.
===========================
Obrigado pela ajuda. Eu não corri sqpwn-fcgi = > O php-cgi não está escutando na porta 9000.