appserv 配置多站点,该如何解决

WBOY
Release: 2016-06-13 12:06:26
Original
1357 people have browsed it

appserv 配置多站点
我的网站移动域名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访问的是移动版


------解决思路----------------------

<VirtualHost *:80><br />ServerName www.xxx.net<br />DocumentRoot "D:\www\AppServ\www"<br /><Directory "D:\www\AppServ\www"><br />    Options Indexes FollowSymLinks<br />    AllowOverride None<br />    Order allow,deny<br />    Allow from all<br /></Directory><br /></VirtualHost><br /><br /><br /><VirtualHost *:80><br />ServerName m.xxx.net<br />DocumentRoot "D:\www\AppServ\www\m"<br /><Directory "D:\www\AppServ\www\m"><br />    Options Indexes FollowSymLinks<br />    AllowOverride None<br />    Order allow,deny<br />    Allow from all<br /></Directory><br /></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