Home > Backend Development > PHP Tutorial > apache子域名设立

apache子域名设立

WBOY
Release: 2016-06-13 12:51:18
Original
1083 people have browsed it

apache子域名设置
本地的环境,apache的配置文件中设置的根目录是d:/AppServ/www/,子域名的配置如下,放在配置文件开始了

<br />
NameVirtualHost *:80<br />
<br />
<VirtualHost *:80><br />
    ServerName localhost<br />
    ServerAlias localhost<br />
    DocumentRoot D:/AppServ/www/<br />
 <br />
    <Directory D:/AppServ/www/><br />
#	AllowOverride FileInfo Options<br />
	Options None<br />
	Order allow,deny<br />
	Allow from all<br />
    </Directory><br />
</VirtualHost><br />
<br />
<VirtualHost *:80><br />
    ServerName dede<br />
    ServerAlias dede<br />
    DocumentRoot D:/AppServ/www/Dede/<br />
 <br />
    <Directory D:/AppServ/www/Dede/><br />
#	AllowOverride FileInfo Options<br />
	Options None<br />
	Order allow,deny<br />
	Allow from all<br />
    </Directory><br />
</VirtualHost><br />
<br />
<VirtualHost *:80><br />
    ServerName ikaihui<br />
    ServerAlias ikaihui<br />
    DocumentRoot D:/AppServ/www/ikaihui/<br />
 <br />
    <Directory D:/AppServ/www/ikaihui/><br />
#	AllowOverride FileInfo Options<br />
	Options None<br />
	Order allow,deny<br />
	Allow from all<br />
    </Directory><br />
</VirtualHost><br />
Copy after login

现在的情况是:输dede和ikaihui都能正常显示,输localhost的话chrome会报这个错:
错误 103 (net::ERR_CONNECTION_ABORTED):未知错误。
Copy after login

IE也打不开。
删掉localhost那一段的话,输localhost会显示dede的页面,我现在想输localhost正常显示www文件夹下面的index.php,该怎么配


------解决方案--------------------
看看是不是你的反病毒或者防火墙之类导致的.
------解决方案--------------------
你的写法是正确的
清除一下浏览器缓冲区看看
我就是这样写的
NameVirtualHost *:80<br />
<br />
<VirtualHost *:80><br />
ServerName localhost<br />
DocumentRoot /AMP/web<br />
</VirtualHost><br />
<br />
<VirtualHost *:80><br />
ServerName www.a.net<br />
DocumentRoot /AMP/web/www.a.net<br />
</VirtualHost><br />
<br />
<VirtualHost *:80><br />
ServerName www.b.net<br />
DocumentRoot /AMP/web/www.b.net<br />
</VirtualHost><br />
Copy after login

------解决方案--------------------
那你把里面的 Directory 一节去掉看看

------解决方案--------------------
加这个看下
Alias /绑定目录 "绝对物理路径" 

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