Home >Backend Development >PHP Tutorial >一个IP对应多个域名解决思路

一个IP对应多个域名解决思路

WBOY
WBOYOriginal
2016-06-13 12:07:031227browse

一个IP对应多个域名

<VirtualHost www.域名1:80><br />    ServerAdmin [email&#160;protected]<br />    DocumentRoot /opt/lampp/htdocs/域名1目录<br />    ServerName www.域名1<br />    ErrorLog logs/dummy-host.example.com-error_log<br />    CustomLog logs/dummy-host.example.com-access_log common<br />    <Directory /opt/lampp/htdocs/域名1目录><br />      Options Indexes FollowSymLinks MultiViews<br />      AllowOverride None<br />      Order deny,allow<br />#      Alow From all<br />    </Directory><br /></VirtualHost><br /><br /><VirtualHost www.域名2:80><br />    ServerAdmin [email&#160;protected]<br />    DocumentRoot /opt/lampp/htdocs/域名2目录<br />    ServerName www.域名2<br />    ErrorLog logs/dummy-host.example.com-error_log<br />    CustomLog logs/dummy-host.example.com-access_log common<br />    <Directory /opt/lampp/htdocs/域名2目录><br />      Options Indexes FollowSymLinks MultiViews<br />      AllowOverride None<br />      Order deny,allow<br />#      Alow From all<br />    </Directory><br /></VirtualHost><br /><br /><VirtualHost www.域名3:80><br />    ServerAdmin [email&#160;protected]<br />    DocumentRoot /opt/lampp/htdocs/域名3目录<br />    ServerName www.域名3<br />    ErrorLog logs/dummy-host.example.com-error_log<br />    CustomLog logs/dummy-host.example.com-access_log common<br />    <Directory /opt/lampp/htdocs/域名3目录><br />      Options Indexes FollowSymLinks MultiViews<br />      AllowOverride None<br />      Order deny,allow<br />#      Alow From all<br />    </Directory><br /></VirtualHost><br />现在遇到的问题是前两个好使,第3个域名访问的时候跳转的是第一个域名里的内容。。。求解。。<br /><br />

------解决思路----------------------
如果是外网配置,检查下域名解析
如果是内部网络配置,检查win下etc hosts文件

Statement:
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