VPS侦探论坛

 找回密码
 注册
查看: 9113|回复: 5

刚安装好lnmp,有点疑问

[复制链接]
发表于 2011-7-29 01:44:14 | 显示全部楼层 |阅读模式

安装好lnmp 后,ftp什么的可以使用了但是我有个疑问,创建虚拟机,绑定另一个域名
如: 我创建一个虚拟机 ,/home/wwwroot/gzcu.net           然后我用绑定了 gzcu.net 这个域名
然后登录域名管理后台,把A记录指向这个vps的IP,貌似gzcu.net跑到根目录去了
我想让它跑到/home/wwwroot/gzcu.net   
我该怎么操作

这样做的目的是想建多几个站~
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-7-29 09:57:29 | 显示全部楼层


如果没有报错的话是直接访问到/home/wwwroot/gzcu.net  的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-7-29 11:15:27 | 显示全部楼层

回复 2# 的帖子


现在访问的是 /home/wwwroot  
不知道是不是设置错了
我重启过了的

gzcu.net.conf 文件是这样的,应该没有配置错,麻烦军哥看看

server
        {
                listen       80;
                server_name gzcu.net;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/gzcu.net;

                include discuz.conf;
                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/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;
        }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-7-29 13:18:46 | 显示全部楼层



/usr/local/nginx/sbin/nginx -t 测试一下

nginx.conf里绑的那个域名
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-7-29 18:56:12 | 显示全部楼层

回复 4# 的帖子


我大概知道了,
修改gzcu.net.conf
server_name gzcu.net www.gzcu.net;

估计是这样吧,还没试,多谢先

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

发表于 2012-5-12 11:01:41 | 显示全部楼层

原帖由 abao 于 2011-7-29 18:56 发表
我大概知道了,
修改gzcu.net.conf
server_name gzcu.net www.gzcu.net;

估计是这样吧,还没试,多谢先


你在另外一个帖子里面说用这个方法解决了。
很迷糊啊,你这样做,只不过多解析了一个WWW,并没有改变根域名的解析,怎么根域名就发生解析改变了呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-22 23:36 , Processed in 0.026480 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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