appserv 配置多站点

WBOY
Release: 2016-06-23 13:49:19
Original
8277 people have browsed it

我的网站移动域名m.xxx.com
我要把这个域名指向我服务器的一个m目录,
我在httpd.conf配置文件里加入


ServerName "m.xxx.com:80"
DocumentRoot "D:\www\AppServ\www\m"

    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all



是在Listen 80后面加入,然后我域名解析m.xxx.com解析A记录到服务器IP地址

现在的情况是我访问www.xxx.con和m.xxxx.con都是访问服务器的M目录,就是主域名也访问M目录了,
请教怎么让主域名访问之前的主页,只让m.xxx.com,访问服务器M目录

另外,我在本机,配置一个正常

ServerName "127.0.0.2:80"
DocumentRoot "D:\www\AppServ\www\m"

    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all



127.0.0.1 访问PC版,127.0.0.2访问的是移动版


回复讨论(解决方案)

再配置一节 www.xxx.con

你本地正常是因为 ip 不同

再配置一节 www.xxx.con

你本地正常是因为 ip 不同


我现在配置了两个

ServerName "www.xxx.net:80"
DocumentRoot "D:\www\AppServ\www"

    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all





ServerName "m.xxx.net:80"
DocumentRoot "D:\www\AppServ\www\m"

    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all



现在的结果是www.xxx.net 和m.xxx.net 访问的都是 "D:\www\AppServ\www" ,这个PC版目录,是不是配置有误

<VirtualHost *:80>ServerName www.xxx.netDocumentRoot "D:\www\AppServ\www"<Directory "D:\www\AppServ\www">    Options Indexes FollowSymLinks    AllowOverride None    Order allow,deny    Allow from all</Directory></VirtualHost><VirtualHost *:80>ServerName m.xxx.netDocumentRoot "D:\www\AppServ\www\m"<Directory "D:\www\AppServ\www\m">    Options Indexes FollowSymLinks    AllowOverride None    Order allow,deny    Allow from all</Directory></VirtualHost>
Copy after login

好了,非常感谢

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template