apache多域名的配置

1、修改httpd.conf

# Virtual hosts

Include "conf/extra/httpd-vhosts.conf"

2、修改httpd-vhosts.conf

NameVirtualHost *:80 去掉前面的#

绑定多域名

<VirtualHost *:80>
    DocumentRoot E:/chile/code/haha/
    ServerName haha.mx
    #DirectoryIndex index.php
   # ErrorLog logs/dummy-host2.localhost-error_log
   # CustomLog logs/dummy-host2.localhost-access_log common
</VirtualHost>

3、如果页面中一直出现acces forbidden error 430

(1)首先检查httpd.conf中的# Controls who can get stuff from this server.

(2)httpd.conf中

    #
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "D:/xampp/htdocs"

#

# This should be changed to whatever you set DocumentRoot to.

#

<Directory "D:/xampp/htdocs">

这两个地方设置成vhost文件中多域名的根目录。

如果localhost发生变化了,需要在vhost文件中加入

posted on 2013-08-06 17:13  chilebaby  阅读(297)  评论(0编辑  收藏  举报

导航