Sigh.
Well, I get to look like an idiot, but after an hour or so of Googling with no luck what-so-ever to get this resolved, I come to you. First time really messing with the dot-deb version of Nginx, so maybe it's a bit more updated.
Anyhow, my install procedure is documented below. I'll also list my configuration files and error as well.
MY INSTALL PROCEDURE:
Added the below to the /etc/apt/sources.list file.
deb http://packages.dotdeb.org stable all
Derr. Then did the GnuPG key stuff.
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | sudo apt-key add -
rm dotdeb.gpg
php5-fpm is indeed running:
# /etc/init.d/php5-fpm status
[ ok ] php5-fpm is running.
I then go ahead and setup a vhost and create the symbolic link for the site/project like usual.
nano /etc/nginx/sites-available/website.com
I then modify 'website.com' configuration file to reflect the following:
server {
listen 80;
server_name website.com www.website.com;
access_log /var/log/nginx/website.access_log;
error_log /var/log/nginx/website.error_log;
root /var/www/website.com;
index index.php index.htm index.html;
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/website.com$fastcgi_script_name;
include fastcgi_params;
}
}
I symlink this sonovabitch:
ln -s /etc/nginx/sites-available/website.com /etc/nginx/sites-enabled/website.com
Create the director for the website.
mkdir /var/www/website.com
Go to website.com, I see big bold TEST on the screen. Great. Create a phpinfo.php file, get 502 error.
ERROR LOG ENTRY:
Hmm... let me double check my configuration file...
Nginx.conf
user www-data;
worker_processes 4;
pid /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;
server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
As you can see, nginx.conf is pretty standard. I think the only thing I did to alter it was to remove server tokens for now.
My /etc/nginx/sites-availabe // sites-enabled website configuration:
server {
listen 80;
server_name website.com www.website.com;
access_log /var/log/nginx/website.access_log;
error_log /var/log/nginx/website.error_log;
root /var/www/website.com;
index index.php index.htm index.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/website.com$fastcgi_script_name;
include fastcgi_params;
}
}
Pretty standard.
Am I going crazy or have I just missed something obvious? I've had similar errors like this in the past, usually was a stupid mistake on my end and 4 minutes of Googling showed me the error of my way. This time, nothing.
Well, I get to look like an idiot, but after an hour or so of Googling with no luck what-so-ever to get this resolved, I come to you. First time really messing with the dot-deb version of Nginx, so maybe it's a bit more updated.
Anyhow, my install procedure is documented below. I'll also list my configuration files and error as well.
MY INSTALL PROCEDURE:
Added the below to the /etc/apt/sources.list file.
deb http://packages.dotdeb.org stable all
Derr. Then did the GnuPG key stuff.
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | sudo apt-key add -
rm dotdeb.gpg
Code:
apt-get update
Code:
apt-get install nginx php5 php5-fpm php5-common php5-memcached php5-mysql php5-cli php5-gd
# /etc/init.d/php5-fpm status
[ ok ] php5-fpm is running.
I then go ahead and setup a vhost and create the symbolic link for the site/project like usual.
nano /etc/nginx/sites-available/website.com
I then modify 'website.com' configuration file to reflect the following:
server {
listen 80;
server_name website.com www.website.com;
access_log /var/log/nginx/website.access_log;
error_log /var/log/nginx/website.error_log;
root /var/www/website.com;
index index.php index.htm index.html;
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/website.com$fastcgi_script_name;
include fastcgi_params;
}
}
I symlink this sonovabitch:
ln -s /etc/nginx/sites-available/website.com /etc/nginx/sites-enabled/website.com
Create the director for the website.
mkdir /var/www/website.com
Code:
nano /var/www/website.com/index.html
<h1>TEST</h1>
ERROR LOG ENTRY:
Hmm... let me double check my configuration file...
Nginx.conf
user www-data;
worker_processes 4;
pid /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;
server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
As you can see, nginx.conf is pretty standard. I think the only thing I did to alter it was to remove server tokens for now.
My /etc/nginx/sites-availabe // sites-enabled website configuration:
server {
listen 80;
server_name website.com www.website.com;
access_log /var/log/nginx/website.access_log;
error_log /var/log/nginx/website.error_log;
root /var/www/website.com;
index index.php index.htm index.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/website.com$fastcgi_script_name;
include fastcgi_params;
}
}
Pretty standard.
Am I going crazy or have I just missed something obvious? I've had similar errors like this in the past, usually was a stupid mistake on my end and 4 minutes of Googling showed me the error of my way. This time, nothing.
Last edited by a moderator: