如何安装nginx?
我正试图在我的系统中安装如何安装nginx?,nginx,Nginx,我正试图在我的系统中安装dotplant2,为此我需要安装nginx,我遵循了dotplant2文档提供的一个步骤,当我尝试重新启动nginx时,正如文档解释的那样,它无法重新启动,并且当我输入此命令时 sudo nginx -t 以下是错误消息: nginx:[emerg] open() "/etc/nginx/fastcgi.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/dotplant
dotplant2
,为此我需要安装nginx
,我遵循了dotplant2
文档提供的一个步骤,当我尝试重新启动nginx
时,正如文档解释的那样,它无法重新启动,并且当我输入此命令时
sudo nginx -t
以下是错误消息:
nginx:[emerg] open() "/etc/nginx/fastcgi.conf" failed (2: No such file or directory)
in /etc/nginx/sites-enabled/dotplant2-host:20
如何解决这个问题?我在Dotplant2文档中找到了错误,它说要更改
/etc/nginx/sites enabled/dotplant2 host
如下
server {
listen 80;
# NOTE: Replace with your path here
root /home/user/dotplant2/application/web;
index index.php;
# NOTE: Replace with your hostname
server_name dotplant2.dev;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ /\.ht {
deny all;
}
}
在那里
包括fastcgi.conf代码>
但是在我们的nginx文件夹中没有fastcgi.conf
,因此我们必须根据需要进行更改
包括fastcgi_参数代码>
然后,所有这些都可以很好地用于ubuntu 14.04。最简单的修复方法是在/etc/nginx/目录中创建缺少的文件
nano/etc/nginx/fastcgi.conf
…并在其中写下这行:
include/etc/nginx/fastcgi_参数代码>