Apache如何添加虚拟目录

Apache如何添加虚拟目录,第1张

添加虚拟目录 IfModule alias_module Alias /sww/ C:/xampp/htdocs/test/ /IfModule 出现限制权限访问, Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you添加虚拟目录<IfModule alias_module>Alias /sww/ "C:/xampp/htdocs/test/"</IfModule>出现限制权限访问,Access forbidden!You don't have permission to access the requested object. It is either read-protected or not readable by the server.If you think this is a server error, please contact the webmaster.Error 403localhost2011/8/26 17:36:49Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 需添加目录设置<Directory "C:/xampp/htdocs/test/">AllowOverride None Options None Order allow,deny Allow from all</Directory>尝试:1. 将C:/xampp/htdocs/test/的/去掉,结果:无法启动apache2. 将C:/xampp/htdocs/test/的/改成\,结果:无法启动apache3. 将C:/xampp/htdocs/test/改为"D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk/",结果:无法启动apache4. C:/xampp/htdocs/test/文件夹有Everyone完全控制权限,给D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk加上Everyone的完全控制权限,结果:仍无法启动apache5. 将"D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk/"的/去掉,/sww/的/去掉,结果:成功启动apache结论:最好Alias /sww "D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk"<Directory "D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk">后面都不要加/,都不要使用\,这样比较保险 # If you include a trailing / on /webpath then the server will # require it to be present in the URL. You will also likely # need to provide a <Directory>section to allow access to # the filesystem path.

进入Apache的conf目录

打开httpd.conf文件输入:

2.1:查找<IfModule alias_module>

2.2:

ScriptAlias /cgi-bin/ "D:/Program Files/wamp/server/Apache2.2/cgi-bin/"

的后面输入:

Alias /php "F:/www_php"

2.3:

注意:虚拟目录为php

另一种方法:

3.1:查找# Virtual hosts

3.2:

将# Include conf/extra/httpd-vhosts.conf前面的“#”去掉

3.3:

打开Apache目录下Apache2.2\conf\extra\httpd-vhosts.conf文件

3.4:在文件末尾添加

<IfModule alias_module>

Alias /php "F:/www_php"

</IfModule alias_module>

4

重启Apache


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11946345.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存