我想用ngx_分页模块来设置nginx。由于我已经在我的服务器上设置了nginx,所以在使用以下命令再次编译它之前,我删除了它。
sudo apt-get remove --purge nginx
sudo apt-get autoremove
sudo apt-get autoclean我使用给出的这里指令构建了一个新的带有分页支持的nginx二进制文件。
whereis nginx提供以下输出
nginx: /usr/sbin/nginx /etc/nginx /usr/local/sbin/nginx /usr/local/nginx /usr/share/nginx /usr/share/man/man1/nginx.1.gz下面是nginx -V命令的输出
nginx version: nginx/1.10.1
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
configure arguments: --add-module=/root/ngx_pagespeed-release-1.11.33.4-beta --prefix=/usr/local/share/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin --error-log-path=/var/log/nginx/error.log --with-ipv6/usr/sbin/nginx -V的输出是
nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module我使用分页模块设置更新了我的nginx.conf文件,并尝试使用sudo service restart nginx重新启动nginx服务器,这给了我* Restarting nginx nginx [fail]。
如果我使用nginx -t测试我的新的nginx设置,它会说配置很好。
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful但是我在错误日志中发现了这一点。
[emerg] 24452#0: unknown directive "pagespeed" in /etc/nginx/nginx.conf:65我在某个地方读到运行以下命令来启动正确的nginx - sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf。这给了我以下输出
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()由于某种原因,我的旧的nginx二进制文件仍然在运行,它不会让新的二进制文件启动。如何运行新的二进制文件呢?
发布于 2016-10-16 14:06:36
然后启动本地的killall -9 nginx。
https://serverfault.com/questions/809340
复制相似问题