i7097611 发表于 2019-3-23 19:36:23

nginx不能正常添加虚拟主机

OS: CentOS7
lnmp version: lnmp 1.6
当我执行lnmp vhost add 命令后,根据提示输入域名,网站路径等信息后,发现不能正常添加虚拟主机
提示如下错误:
nginx: 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如附件所示。

i7097611 发表于 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: 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: 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-fpmdone
================================================
Virtualhost infomation:
Your domain: xxx.cn
Home Directory: /home/wwwroot/default/wordpress
Rewrite: none
Enable log: yes
Create database: no
Create ftp account: no

licess 发表于 2019-3-24 20:26:48

/bin/lnmp 中查找reuseport 删掉
/usr/local/nginx/conf/vhost/域名.conf 中 reuseport 删掉
你是今天装的还是以前装的,这个问题很早之前就修复了

i7097611 发表于 2019-3-27 19:47:42

感谢军哥的回复,谢谢军哥(*°∀°)=3
页: [1]
查看完整版本: nginx不能正常添加虚拟主机