VPS侦探论坛

标题: 带“www”网址 打不开哦 [打印本页]

作者: dc10221203    时间: 2011-4-27 14:04
标题: 带“www”网址 打不开哦
server
        {
                listen       80;
                server_name b2bcc.com www.b2bcc.com *.b2bcc.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/b2bcc.com;

                location / {
                        try_files $uri @apache;
                        }

                location @apache {
                        internal;
                        proxy_pass http://127.0.0.1:88;
                        include proxy.conf;
                        }

                location ~ .*\.(php|php5)?$
                        {
                                proxy_pass http://127.0.0.1:88;
                                include proxy.conf;
                        }

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

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

                log_format  b2bcc.com  '$remote_addr - $remote_user [$time_local] $request '
             '$status $body_bytes_sent $http_referer '
             '$http_user_agent $http_x_forwarded_for';
                access_log  /home/wwwlogs/b2bcc.com.log  b2bcc.com;
        }
怎么带“www” 不能访问呀!!!!


http://www.b2bcc.com   打不开     http://b2bcc.com   是可以打开的  不知道那里的问题哦
作者: dc10221203    时间: 2011-4-27 14:07
老大来 哈
看看哈
作者: dc10221203    时间: 2011-4-27 14:14
顶哦 军哥  在那里呢
作者: dc10221203    时间: 2011-4-27 14:15
中国行业网 顶呀
http://www.b2bcc.com/
作者: dc10221203    时间: 2011-4-27 14:20
呵呵  抓狂呀
作者: dc10221203    时间: 2011-4-27 14:33
军哥 来看看撒


呵呵 辛苦哈
作者: licess    时间: 2011-4-27 14:35
apache上帮了没
作者: dc10221203    时间: 2011-4-27 14:37
原帖由 dc10221203 于 2011-4-27 14:04 发表
server
        {
                listen       80;
                server_name b2bcc.com www.b2bcc.com *.b2bcc.com;
                index index.html index.htm index.php default.html default.htm default ...



这个就是之前nginx 里面conf  域名文件  只有b2bcc.com   带“www ”  就打不开哦
作者: dc10221203    时间: 2011-4-27 14:43
<VirtualHost *:88>
ServerAdmin webmaster@example.com
php_admin_value open_basedir "/home/wwwroot/b2bcc.com:/tmp/:/var/tmp/:/proc/"
DocumentRoot "/home/wwwroot/b2bcc.com"
ServerName b2bcc.com
ErrorLog "logs/b2bcc.com-error_log"
CustomLog "logs/b2bcc.com-access_log" common
</VirtualHost>


这个是/usr/local/apache/conf/vhost/ 里面文件内容
作者: licess    时间: 2011-4-27 14:44
/usr/local/nginx/sbin/nginx -t看一下
如果没错误,重启一下nginx
作者: dc10221203    时间: 2011-4-27 14:52
原帖由 licess 于 2011-4-27 14:44 发表
/usr/local/nginx/sbin/nginx -t看一下
如果没错误,重启一下nginx



[root@cnbrandnet ~]#/usr/local/nginx/sbin/nginx -t
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
作者: dc10221203    时间: 2011-4-27 15:02
老大 给看看呗

谢谢 哦
作者: licess    时间: 2011-4-27 15:16
<VirtualHost *:88>
ServerAdmin webmaster@example.com
php_admin_value open_basedir "/home/wwwroot/b2bcc.com:/tmp/:/var/tmp/:/proc/"
DocumentRoot "/home/wwwroot/b2bcc.com"
ServerName b2bcc.com
ErrorLog "logs/b2bcc.com-error_log"
CustomLog "logs/b2bcc.com-access_log" common
</VirtualHost>

你apache里没帮www的域名
作者: dc10221203    时间: 2011-4-27 15:19
原帖由 licess 于 2011-4-27 15:16 发表

ServerAdmin webmaster@example.com
php_admin_value open_basedir "/home/wwwroot/b2bcc.com:/tmp/:/var/tmp/:/proc/"
DocumentRoot "/home/wwwroot/b2bcc.com"
ServerName b2bcc.com
ErrorLog "logs/b2bcc.com-er ...


绑定多个域名 怎么不行呀

ServerName b2bcc.com  www.b2bcc.com    重启lnmpa 就出错502
作者: dc10221203    时间: 2011-4-27 15:33
老大帮忙给看看哟

谢谢
作者: licess    时间: 2011-4-27 15:37
标题: 回复 14# 的帖子
加多域名需要在ServerName下面添加一行,如下
ServerAlias www.aaa.com ccc.aaa.com *.aaa.com
再重启apache




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4