Hi,
I just got a fresh installation of Debian Squeeze as my Linode partition. I installed nginx + php. I configured both as indicated in the Linode wiki for LEMP installation (
http://library.linode.com/lemp-guides/debian-6-squeeze). I add small test script in index.html and index.php file on my root website directory. When I try to access my website, I get the following response:
http://myipaddress ==> connection failed
http://myipaddress/index.html ==> connection failed
http://myipaddress/index.php ==> connection failed
I checked the log: there is no log (both nginx and website logs)
Is nginx working?
I checked the processes. Here is what I got:
Code:
root@li60-86:~# ps -aux | grep nginx
nginx 1540 0.0 1.0 18632 5144 ? Ss 20:41 0:00 /usr/bin/php5-cgi
nginx 1547 0.0 0.3 18632 1868 ? S 20:41 0:00 /usr/bin/php5-cgi
nginx 1548 0.0 0.3 18632 1868 ? S 20:41 0:00 /usr/bin/php5-cgi
nginx 1549 0.0 0.3 18632 1868 ? S 20:41 0:00 /usr/bin/php5-cgi
nginx 1550 0.0 0.3 18632 1868 ? S 20:41 0:00 /usr/bin/php5-cgi
nginx 1551 0.0 0.3 18632 1868 ? S 20:41 0:00 /usr/bin/php5-cgi
nginx 1552 0.0 0.3 18632 1868 ? S 20:41 0:00 /usr/bin/php5-cgi
root 1631 0.0 0.1 3352 724 pts/0 S+ 20:59 0:00 grep nginx
I'm newbie with Debian + nginx + PHP-cli but not with Ubuntu + Apache + mod_php5. It's like if nginx was not running. I have created some day ago an Ubunu oneiric + nginx + PHP-cli and it was worked fine. Now, with Debian, it seem like ngix doesn't work or like if port 80 was locked.
Here is my nginx website config:
Code:
server {
listen 80; ## listen for ipv4
#listen [::]:80 default ipv6only=on; ## listen for ipv6
server_name myipaddress;
access_log /var/www/myipaddress/logs/access.log;
error_log /var/www/myipaddress/logs/error.log;
location / {
root /var/www/myipaddress/public_html;
index index.html index.htm index.php;
}
location /doc {
root /usr/share;
autoindex on;
allow 127.0.0.1;
deny all;
}
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
root /var/www/myipaddress/public_html;
}
location /images {
root /usr/share;
autoindex on;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /var/www/nginx-default;
#}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/[i]myipaddress[/i]/public_html$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
upstream backend {
server 127.0.0.1:9000;
}
and fastcgi_params is:
Code:
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
Somebody has any idea?
Thanks