VPS侦探论坛

 找回密码
 注册
查看: 4251|回复: 1

重装了LNMP1.0三次nginx还是出问题

[复制链接]
发表于 2013-8-30 15:29:49 | 显示全部楼层 |阅读模式

不知道是不是LNMP1.0安装包有问题,还是阿里云的CentOS release 5.4 (Final) 系统问题。我重装了3次LNMP环境,添加了一个网站(只绑定带WWW和不带WWW的域名)。然后重启nginx都提示以下错误:
Restarting nginx daemon: nginxnginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

查看了80端口结果如下
lsof -i :80
COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME
nginx   1551 root    7u  IPv4   3998       TCP *:http (LISTEN)
nginx   1552  www    7u  IPv4   3998       TCP *:http (LISTEN)
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-8-30 15:55:49 | 显示全部楼层


军哥,我的这个情况群里的一位朋友给帮忙解决了,下面这段代码是添加网站后的默认配置文件,军哥看一下
  1. log_format  域名.com  '$remote_addr - $remote_user [$time_local] "$request" '
  2.              '$status $body_bytes_sent "$http_referer" '
  3.              '"$http_user_agent" $http_x_forwarded_for';
  4. server
  5.         {
  6.                 listen       80;
  7.                 server_name 域名.com www.域名.com;
  8.                 index index.html index.htm index.php default.html default.htm default.php;
  9.                 root  /home/wwwroot/xunwuwang.com;

  10.                 include xunwuwang.com.conf;
  11.                 location ~ .*\.(php|php5)?$
  12.                         {
  13.                                 try_files $uri =404;
  14.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  15.                                 fastcgi_index index.php;
  16.                                 include fcgi.conf;
  17.                         }

  18.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  19.                         {
  20.                                 expires      30d;
  21.                         }

  22.                 location ~ .*\.(js|css)?$
  23.                         {
  24.                                 expires      12h;
  25.                         }

  26.                 access_log  /home/wwwlogs/xunwuwang.com.log 域名.com;
  27.         }
复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-24 23:23 , Processed in 0.026151 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表