Apache 添加虛擬目錄注意事項(xiàng)
更新時(shí)間:2011年08月27日 15:53:52 作者:
Apache 添加虛擬目錄注意事項(xiàng),使用apache的朋友可以參考下。
問(wèn)題:配置Apache,httpd.conf
添加虛擬目錄
<IfModule alias_module>
Alias /sww/ "C:/xampp/htdocs/test/"
</IfModule>
出現(xiàn)限制權(quán)限訪問(wèn),
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 403
localhost
2011/8/26 17:36:49
Apache/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
需添加目錄設(shè)置
<Directory "C:/xampp/htdocs/test/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
嘗試:
1. 將C:/xampp/htdocs/test/的/去掉,結(jié)果:無(wú)法啟動(dòng)apache
2. 將C:/xampp/htdocs/test/的/改成\,結(jié)果:無(wú)法啟動(dòng)apache
3. 將C:/xampp/htdocs/test/改為"D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk/",結(jié)果:無(wú)法啟動(dòng)apache
4. C:/xampp/htdocs/test/文件夾有Everyone完全控制權(quán)限,給D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk加上Everyone的完全控制權(quán)限,結(jié)果:仍無(wú)法啟動(dòng)apache
5. 將"D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk/"的/去掉,/sww/的/去掉,結(jié)果:成功啟動(dòng)apache
結(jié)論:
最好
Alias /sww "D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk"
<Directory "D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk">
后面都不要加/,都不要使用\,這樣比較保險(xiǎn)
# 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.
添加虛擬目錄
<IfModule alias_module>
Alias /sww/ "C:/xampp/htdocs/test/"
</IfModule>
出現(xiàn)限制權(quán)限訪問(wèn),
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 403
localhost
2011/8/26 17:36:49
Apache/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
需添加目錄設(shè)置
復(fù)制代碼 代碼如下:
<Directory "C:/xampp/htdocs/test/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
嘗試:
1. 將C:/xampp/htdocs/test/的/去掉,結(jié)果:無(wú)法啟動(dòng)apache
2. 將C:/xampp/htdocs/test/的/改成\,結(jié)果:無(wú)法啟動(dòng)apache
3. 將C:/xampp/htdocs/test/改為"D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk/",結(jié)果:無(wú)法啟動(dòng)apache
4. C:/xampp/htdocs/test/文件夾有Everyone完全控制權(quán)限,給D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk加上Everyone的完全控制權(quán)限,結(jié)果:仍無(wú)法啟動(dòng)apache
5. 將"D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk/"的/去掉,/sww/的/去掉,結(jié)果:成功啟動(dòng)apache
結(jié)論:
最好
Alias /sww "D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk"
<Directory "D:/Work/Booksir/BP/Code/User_Booksir_com_cn/trunk">
后面都不要加/,都不要使用\,這樣比較保險(xiǎn)
# 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.
相關(guān)文章
Linux中特殊權(quán)限SUID、SGID與SBIT的深入講解
linux對(duì)文件的權(quán)限管理簡(jiǎn)直是讓人嘆為觀止,所以這篇文章主要給大家介紹了關(guān)于Linux中特殊權(quán)限SUID、SGID與SBIT的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),需要的朋友可以參考借鑒,下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2018-09-09
詳細(xì)介紹linux動(dòng)態(tài)網(wǎng)絡(luò)和靜態(tài)網(wǎng)絡(luò)和克隆后的網(wǎng)絡(luò)配置
這篇文章主要介紹了詳細(xì)介紹linux動(dòng)態(tài)網(wǎng)絡(luò)和靜態(tài)網(wǎng)絡(luò)和克隆后的網(wǎng)絡(luò)配置,具有一定的學(xué)習(xí)價(jià)值,有需要的可以了解一下。2016-11-11
單臺(tái)服務(wù)器中利用Apache的VirtualHost如何搭建多個(gè)Web站點(diǎn)詳解
這篇文章主要給大家介紹了關(guān)于在單臺(tái)服務(wù)器中利用Apache的VirtualHost如何搭建多個(gè)Web站點(diǎn)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧。2017-09-09
VmWare安裝centos7無(wú)法上網(wǎng)的解決方法
這篇文章主要為大家詳細(xì)介紹了VmWare安裝centos7無(wú)法上網(wǎng)的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-10-10

