hu5487 发表于 2011-12-28 11:36:26

域名访问404错误 已解决

http://184.82.244.104/www.wangljz.cn/ 这样可以访问
但是 www.wangljz.cn却不能访问
绑定新域名的时候出现
Test Nginx configure file......
nginx: invalid number of arguments in "root" directive in /usr/local/ngiwangljz.cn.conf:6
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
Restart Nginx......
nginx: invalid number of arguments in "root" directive in /usr/local/ngiwangljz.cn.conf:6
=========================================================================
Add Virtual Host for LNMP V0.8,Written by Licess
=========================================================================
For more information please visit http://www.lnmp.org/
Your domain:wangljz.cn
Directory of wangljz.cn:/home/wwwroot/wangljz.cn

这个怎么回事?

[ 本帖最后由 hu5487 于 2011-12-28 23:31 编辑 ]

licess 发表于 2011-12-28 12:41:23

/usr/local/ngiwangljz.cn.conf 配置文件出错了

hu5487 发表于 2011-12-28 13:13:49

server
        {
                listen       80;
                server_name wangljz.cn www.wangljz.cn;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/wangljz.cn;

                include other.conf;
                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_passunix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

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

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

                access_log off;
        }
能帮我看下是哪里错了吗:Q

licess 发表于 2011-12-28 17:43:02

你的虚拟主机配置文件在/usr/local/ 下面,而 在/usr/local/nginx/conf 下面
将/usr/local/ngiwangljz.cn.conf 放到/usr/local/nginx/conf/vhost/ 下试试

hu5487 发表于 2011-12-28 22:46:58

回复 4# 的帖子

我的配置文件就是在/usr/local/nginx/conf/vhost/ 下的
下面是我的nginx.conf

userwww www;

worker_processes 1;

error_log/home/wwwlogs/nginx_error.logcrit;

pid      /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
        }

http
        {
                include       mime.types;
                default_typeapplication/octet-stream;

                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 50m;

                sendfile on;
                tcp_nopush   on;

                keepalive_timeout 60;

                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;

                gzip on;
                gzip_min_length1k;
                gzip_buffers   4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;

                #limit_zonecrawler$binary_remote_addr10m;

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

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_passunix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

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

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

                log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log/home/wwwlogs/access.logaccess;
        }
include vhost/*.conf;
}

hu5487 发表于 2011-12-28 23:30:43

自己找人弄好了 麻烦你了:lol
页: [1]
查看完整版本: 域名访问404错误 已解决