test96 发表于 2011-3-22 22:26:25

军哥,新来的请你帮忙!!!

我刚安装的虚拟目录,用的/root/vhost.sh命令,第一次建立的www.fa1111.com ,并绑定了发fa1111.com域名,但忘了开启日志,我就把rm /usr/local/nginx/conf/vhost/www.fa1111.com.conf删掉,重新运行/root/vhost.sh命令重新建立了目录。并绑定了fa1111.com    www.fa2222.com   fa2222.com。

现在的情况是:我装好网站文件以后先用www.fa2222.com访问了一下可以访问,但用www.fa1111.com不能访问,ip解析是对的。


请军哥和各位高手帮忙!

test96 发表于 2011-3-22 22:28:56

对了,我两次建立的虚拟目录的位置不一样,第一次是在默认的wwwroot下,第二次是在wwwroot / www下

test96 发表于 2011-3-22 22:35:28

/usr/local/nginx/conf/nginx.conf 和 usr/local/nginx/conf/vhost/域名.conf有什么区别,各有什么作用

test96 发表于 2011-3-22 22:37:04

我感觉是/usr/local/nginx/conf/nginx.conf的问题,不知道应该怎么改,文件里边的

server
      {
                listen       80;
                server_name www.fa1111.com;
                index index.html index.htm index.php;
                root/home/wwwroot;

licess 发表于 2011-3-23 09:25:08

回复 4# 的帖子

/usr/local/nginx/sbin/nginx -t看看有错误没

test96 发表于 2011-3-23 09:42:09

$ /usr/local/nginx/sbin/nginx -t
: could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)
2011/03/23 09:15:55 29152#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/nginx/conf/nginx.conf:1
2011/03/23 09:15:55 29152#0: conflicting server name "www.fa1111.com" on 0.0.0.0:80, ignored
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
2011/03/23 09:15:55 29152#0: open() "/usr/local/nginx/logs/nginx.pid" failed (13: Permission denied)
configuration file /usr/local/nginx/conf/nginx.conf test failed

test96 发表于 2011-3-23 09:46:32

server
      {
                listen       80;
                server_name www.fa1111.com;
                index index.html index.htm index.php;
                root/home/wwwroot;
                  。
                  。
         。
         。
include vhost/*.conf;
}
这个是nginx.conf的server配置,实际的root应该是root/home/wwwroot/www/fa1111.com

licess 发表于 2011-3-23 12:31:48

回复 6# 的帖子

/usr/local/nginx/logs/error.log这个文件不存在,touch 一个

你在nginx.conf 中绑定了 www.fa1111.com 就不能再用/root/vhost.sh 再添加

test96 发表于 2011-3-23 14:04:56

应该怎样修改呢,默认的nginx.conf是什么内容呢

licess 发表于 2011-3-23 16:28:42

回复 9# 的帖子

随便改个没有绑定过的二级域名就可以
页: [1]
查看完整版本: 军哥,新来的请你帮忙!!!