VPS侦探论坛

 找回密码
 注册
查看: 10903|回复: 7

为什么我的lnmp添加虚拟主机的地址会到/home/wwwroot上

[复制链接]
发表于 2011-9-2 22:16:51 | 显示全部楼层 |阅读模式

我按照lnmp 上面的操作,(添加虚拟主机,执行如下命令:/root/vhost.sh 根据提示输入要绑定的域名,回车,如果需要添加更多的域名,输入y,再输入要另外绑定的域名,多个域名可以用空格隔开。再输入域名绑定的目录(绝对目录,如/home/wwwroot/lnmp,如果不填默认是/home/wwwroot/绑定的域名))添加了域名后把域名目录该为/home/wwwroot/XXX上,可是弄好并且域名解析到ip上,域名的目录变成了/home/wwwroot上,这是怎么回事呢?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-9-3 09:07:55 | 显示全部楼层


你目录/home/wwwroot/XXX里不放index文件或添加的后配置有问题没生效。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-9-3 09:14:03 | 显示全部楼层

回复 2# 的帖子


额,我放了个wp的程序上去,放在/home/wwwroot/xxx下不能用,直接放到/home/wwwroot下就可以用了,囧,如果是配置问题那真心不知道如何弄了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-9-3 09:20:25 | 显示全部楼层



/usr/local/nginx/sbin/nginx -t  看一下

并发一下/usr/local/nginx/conf/vhost/域名.conf  的配置
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-9-3 09:37:41 | 显示全部楼层

这个是/usr/local/nginx/conf/vhost/域名.conf  的配置,麻烦军哥看看
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name www.XXX.com;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/hp;

  7.                 include wordpress.conf;
  8.                 location ~ .*\.(php|php5)?$
  9.                         {
  10.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  11.                                 fastcgi_index index.php;
  12.                                 include fcgi.conf;
  13.                         }

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

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

  22.                 access_log off;
  23.         }
复制代码
运行/usr/local/nginx/sbin/nginx -t后出现的
  1. [root@xxx ~]# /usr/local/nginx/sbin/nginx -t
  2. [warn]: conflicting server name "www.xxx.com" on 0.0.0.0:80, ignored
  3. the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
  4. configuration file /usr/local/nginx/conf/nginx.conf test is successful
复制代码

军哥运维代购:http://shop63846532.taobao.com/

发表于 2011-9-3 11:03:43 | 显示全部楼层

www.XXX.com 应该是之前已经添加过这个域名了
 楼主| 发表于 2011-9-4 15:32:31 | 显示全部楼层

原帖由 licess 于 2011-9-3 11:03 发表
www.XXX.com 应该是之前已经添加过这个域名了
恩,那个是之前添加过的,我试着帮顶了两个域名过去,都不能正常的帮顶到设置的目录上,而是全部帮顶到/home/wwwroot/很纠结……
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-9-4 17:10:14 | 显示全部楼层

回复 7# 的帖子


安装时添加的肯定是帮在/home/wwwroot/上,要修改编辑/usr/local/nginx/conf/nginx.conf
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-21 05:31 , Processed in 0.027761 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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