VPS侦探论坛

 找回密码
 注册
查看: 7542|回复: 3

lnmp0.6无法添加新虚拟机

[复制链接]
发表于 2011-2-20 02:25:38 | 显示全部楼层 |阅读模式

刚在机器上装了lnmp0.6
   默认绑定的域名不准备用 运行./vhost后天添加新的虚拟机绑定好域名后 目录没指定 之后完成操作
   在WWWROOT里面生成了绑定域名的文件夹
     但是域名访问的还是默认wwwroot根目录  看了nginx.conf 文件  里面也没有其虚拟机 然后我在配置文件里面手动添加:
                gzip on;
                gzip_min_length  1k;
                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_zone  crawler  $binary_remote_addr  10m;

server
        {
                listen       80;
                server_name 域名我删除了;
                index index.html index.htm index.php;
                root  /home/wwwroot;

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/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_format  access  '$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.log  access;
        }
--------------------------------------以上为默认就有的 下面是我在这之后自己添加的-----------------------------------------------------
server
        {
                listen       80;
                server_name 域名我删除了;
                index index.html index.htm index.php;
                root  /home/wwwroot/yangbailao.net/;

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/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_format  access  '$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.log  access;
        }

include vhost/*.conf;
}

添加完后 我重启
kill -HUP `cat /usr/local/nginx/logs/nginx.pid
  但是还是不行啊。  请教一下 怎么回事?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-2-20 09:47:00 | 显示全部楼层

回复 1# 的帖子



如果不会手动配置,请使用/root/vhost.sh添加。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-2-20 16:14:50 | 显示全部楼层

回复 2# 的帖子


自动添加不了啊。就是自动添加不了 所以才手动的啊
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-2-20 22:13:24 | 显示全部楼层



我也遇到这个。应该是你要添加的域名就是默认域名的原因,在nginx.conf里把默认的域名该一下就行了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-19 08:55 , Processed in 0.026366 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表