hi,
I am trying to set up an nginx server. I intend to use it with, php and python, and probably with frameworks like django and codeigniter. However, I can’t get it working. This is what I did:
Installed these from Install/remove software:
nginx,FastCGI,php5-fastcgi,python-fcgi,spawn-fcgi
My current nginx.conf file is this (Stripped comments):
user nginx;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
index index.html index.htm;
server {
listen 80;
server_name <my server name was here>;
root <my root directory was here>;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /srv/www/htdocs/;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
I couldn’t manage to spawn php5 cgi with using spawn-fcgi, instead I typed this into terminal:
php-cgi5 -b 127.0.0.1:9000
What happens is: when I type a php url to address bar, I only get a text saying “No input file specified.”
This is what I get when I make netcat sit on 9000, and go for /phpinfo.php:
SCRIPT_FILENAME/scripts/phpinfo.php
QUERY_STRINGREQUEST_METHODGET
CONTENT_TYPECONTENT_LENGTH
SCRIPT_NAME/phpinfo.php
REQUEST_URI/phpinfo.php
DOCUMENT_URI/phpinfo.php
DOCUMENT_ROOT/usr//htmSERVER_PROTOCOLHTTP/1.1GATEWAY_INTERFACECGI/1.1
SERVER_SOFTWAREnginx/0.8.53
REMOTE_ADDR<my ip was here>
REMOTE_PORT57546
SERVER_ADDR<my ip was here>
SERVER_PORT80
SERVER_NAME<hostname was here>REDIRECT_STATUS200 HTTP_HOST<hostname was here>LHTTP_USER_AGENTMozilla/5.0 (X11; Linux i686; rv:2.0b13pre) Gecko/20110317 Firefox/4.0b13pre
?HTTP_ACCEPTtext/html,applicatioHTTP_ACCEPT_ENCODINGgzip, deflateHTTP_ACCEPT_CHARSETISO-8859-1,utf-8;q=0.7,*;q=0.7HTTP_KEEP_ALIVE115
HTTP_CONNECTIONkeep-alive
There are clearly some config problems here, but can’t find out what are they, since this is first time I try to setup nginx and fastcgi. I was using apache before.