aiqbc 发表于 2011-2-20 02:25:38

lnmp0.6无法添加新虚拟机

刚在机器上装了lnmp0.6
   默认绑定的域名不准备用 运行./vhost后天添加新的虚拟机绑定好域名后 目录没指定 之后完成操作
   在WWWROOT里面生成了绑定域名的文件夹
   但是域名访问的还是默认wwwroot根目录看了nginx.conf 文件里面也没有其虚拟机 然后我在配置文件里面手动添加:
                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 域名我删除了;
                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;
      }
--------------------------------------以上为默认就有的 下面是我在这之后自己添加的-----------------------------------------------------
server
      {
                listen       80;
                server_name 域名我删除了;
                index index.html index.htm index.php;
                root/home/wwwroot/yangbailao.net/;

                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;
}

添加完后 我重启
kill -HUP `cat /usr/local/nginx/logs/nginx.pid
但是还是不行啊。请教一下 怎么回事?

licess 发表于 2011-2-20 09:47:00

回复 1# 的帖子

如果不会手动配置,请使用/root/vhost.sh添加。

aiqbc 发表于 2011-2-20 16:14:50

回复 2# 的帖子

自动添加不了啊。就是自动添加不了 所以才手动的啊

myix 发表于 2011-2-20 22:13:24

我也遇到这个。应该是你要添加的域名就是默认域名的原因,在nginx.conf里把默认的域名该一下就行了
页: [1]
查看完整版本: lnmp0.6无法添加新虚拟机