我正在尝试在运行Ubuntu 12.0.4.3 x32的VPS上安装LEMP堆栈。tutorial之后。我尝试重新启动nginx时收到以下错误消息:
Restarting nginx: nginx: [emerg] unknown directive "http://wiki.nginx.org/QuickStart" in
/etc/nginx/sites-enabled/default:21
nginx: configuration file /etc/nginx/nginx.conf test failed
这让我逻辑地假设我的nginx.conf出了问题,如下所示:
GNU nano 2.2.6 File: /etc/nginx/sites-available/default Modified
root /usr/share/nginx/www;
index index.php index.html index.htm;
server_name 192.XXX.XXX.X;
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
我也无法在我创建的浏览器中打开info.php。
你可以告诉我出了什么问题吗?答案 0 :(得分:0)
以下是installing LEMP Stack on Ubuntu的正确指南,如果这样做无法帮助您键入sudo nginx -t,这将告诉您配置文件中的错误位置。