shenzhang 发表于 2017-1-6 09:50:18

apache 虚拟目录(文件服务器)

1. /conf/httpd.conf
修改下面内容

#apache 安装目录
ServerRoot "D:/Develop/Apache2.2"
#Listen 12.34.56.78:80 侦听端口和IP
Listen 80
# Virtual hosts去掉注释
Include conf/extra/httpd-vhosts.conf


2. /conf/extra/httpd-vhosts.conf
增加下面内容,注释掉原有的 VirtualHost 试例:

<VirtualHost *:80>
ServerName fd
DocumentRoot "D:/Develop/Apache2.2/conf/extra/"
</VirtualHost>
Alias /fd/ "D:/Develop/Apache2.2/conf/extra/"
<Directory "D:/Develop/Apache2.2/conf/extra/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>


3. IP访问
1)http://localhost:port/
2)http://ip:port/
3)http://127.0.0.1:prot/
注意:地址一定要写全,如果不写http头,则无法访问。
页: [1]
查看完整版本: apache 虚拟目录(文件服务器)