VPS侦探论坛

 找回密码
 注册
查看: 3639|回复: 3

nginx不能正常添加虚拟主机

[复制链接]
发表于 2019-3-23 19:36:23 | 显示全部楼层 |阅读模式

OS: CentOS7
lnmp version: lnmp 1.6
当我执行lnmp vhost add 命令后,根据提示输入域名,网站路径等信息后,发现不能正常添加虚拟主机
提示如下错误:
nginx: [emerg] duplicate listen options for 0.0.0.0:80 in /usr/local/nginx/conf/vhost/xxx.com.conf:3
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
我的虚拟主机的配置文件(xxx.cn.conf)和nginx.conf如附件所示。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2019-3-23 19:41:19 | 显示全部楼层

更具体的报错信息



chmod: changing permissions of ‘/home/wwwroot/default/wordpress/.user.ini’: Operation not permitted
chown: changing ownership of ‘/home/wwwroot/default/wordpress/.user.ini’: Operation not permitted
You select the exist rewrite rule:/usr/local/nginx/conf/rewrite/none.conf
Test Nginx configure file......
nginx: [emerg] duplicate listen options for 0.0.0.0:80 in /usr/local/nginx/conf/vhost/xxx.cn.conf:3
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
Reload Nginx......
nginx: [emerg] duplicate listen options for 0.0.0.0:80 in /usr/local/nginx/conf/vhost/xxx.cn.conf:3
/usr/bin/lnmp: line 494: /home/wwwroot/default/wordpress/.user.ini: Permission denied
chmod: changing permissions of ‘/home/wwwroot/default/wordpress/.user.ini’: Operation not permitted
Gracefully shutting down php-fpm . done
Starting php-fpm  done
================================================
Virtualhost infomation:
Your domain: xxx.cn
Home Directory: /home/wwwroot/default/wordpress
Rewrite: none
Enable log: yes
Create database: no
Create ftp account: no
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2019-3-24 20:26:48 | 显示全部楼层

/bin/lnmp 中查找reuseport 删掉
/usr/local/nginx/conf/vhost/域名.conf 中 reuseport 删掉
你是今天装的还是以前装的,这个问题很早之前就修复了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2019-3-27 19:47:42 | 显示全部楼层



感谢军哥的回复,谢谢军哥(*°∀°)=3
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-22 23:22 , Processed in 0.026340 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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