我刚刚开始使用MacOS Sierra v10.12.1中的nginx。
在安装了之后,浏览器拒绝连接,并显示以下消息:This site can’t be reached. localhost refused to connect.
我刚刚试着用nginx -t调试我的nginx,它显示缺少nginx.pid:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/usr/local/var/run/nginx.pid" failed
我正在通过brew使用nginx,它似乎被配置并正确工作--在某种程度上。我有多个主机文件(大约20个网站),几乎所有它们都工作良好,但是,任何新添加的网站将无法工作。
所有旧主机文件似乎都加载得很好,例如,端口80上有服务器名site.test,但是在我的web浏览器中添加的任何新主机文件都会返回“服务器未找到”。
经过大量的故障排除和谷歌搜索,我终于发现了一些在我的设置中似乎很奇怪的东西,正是这个帖子触发了它:。虽然它似乎解决不了我的确切问题。
当我运行nginx -t时,我得到:
nginx: [warn] the "user" directive makes sense
嗨,我有一些关于nginx的问题。当我重新启动nginx时,我在日志中记录了这个错误,nginx没有启动。就在最近,我遇到了下面的错误。
关于日志文件"/var/log/nginx/error.log
[info]: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:71
我不认为我需要一个简单的wordpress站点的nchan模块。我用的是ubuntu操作系统。我的问题是如何删除nchan模块?
我是系统管理的新手。在Ubuntu上安装nginx 后,我得到以下输出:
[alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
[warn] 1898#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
我在一个共享主机上,有权继承nginx根安装并重写它的配置文件(注意:我不想在我的主目录中编译我自己的nginx )。
我编写了一个开始/重新加载/停止脚本,这个脚本工作得很好,但是我一直在下面看到错误
启动脚本
#!/bin/bash
# Set this to your nginx configuration file and PID
CONFIG=~/nginx/nginx.conf
PIDFILE=~/nginx/nginx.pid
# Do not change anything below unless you know what you do
DAEMON=/usr/l