打开Apache下的conf文件夹,修改"httpd.conf"这个配置文件. 默认路径如:C:\Program Files\Apache Software Foundation\Apache2.2conf.

1、修改主目录 将"<Directory " ">"和"DocumentRoot"这里修改一致,如:

<Directory "D:websitemakednew_popx.us">
DocumentRoot "D:websitemakednew_popx.us"

2、修改首页文件

DirectoryIndex index.html index.htm index.shtml

3、增加虚拟目录 在 httpd.conf 的 alias_module 下增加一别名定义项, 如:Alias "/gg" "D:websitegg",即可定义虚拟目录. /gg 是网页的目录名称,"D:\websitegg" 是网页文件的物理路径.

Alias "/gg" "D:websitegg"
<Directory "D:websitegg">
    Options FollowSymLinks
    AllowOverride None
    order allow,deny
    Allow from all

4、禁止目录访问

<Directory "D:websitemakedggedison">
    Options Indexes FollowSymLinks
    AllowOverride None
    order allow,deny
    Allow from all

将其中的"Options Indexes FollowSymLinks"取消,或者将其修改为"Options -Indexes FollowSymLinks".

5、虚拟主机配置

    Options FollowSymLinks
    AllowOverride None
    order deny,allow
    Deny from all

6、先将其中的"Deny from all"修改成"Allow from all".

7、然后写入下面的代码.

NameVirtualHost *:80
    ServerName www.429006.com
    DocumentRoot "D:websitegg"
    ServerName 1.429006.com
    DocumentRoot "D:websitefirefox"

注意:其中的"NameVirtualHost *:80"不能丢,还有就是这里面的"*:80"是不能修改的,不要以为"*"是需要修改的,这里不能修改.

8、虚拟主机权限设置

<Directory "虚拟主机网站目录">
    Options Indexes FollowSymLinks
    AllowOverride None
    order allow,deny
    Allow from all