啟用mod_rewrite模塊 在conf目錄的httpd.conf文件中找到 LoadModule rewrite_module modules/mod_rewrite.so 將這一行前面的#去掉。 2.在要支持url rewirte的目錄啟用 Options FollowSymLinks和AllowOverride All Alias /php c:/web/php/ Directory c:/web/p
啟用mod_rewrite模塊在conf目錄的httpd.conf文件中找到LoadModule rewrite_module modules/mod_rewrite.so將這一行前面的#去掉。2.在要支持url rewirte的目錄啟用 Options FollowSymLinks和AllowOverride AllAlias /php "c:/web/php/"<Directory "c:/web/php/">Options Indexes FollowSymLinksAllowOverride AllOrder allow,denyAllow from all</Directory>這樣通過(guò)http://localhost:8080/php/訪問(wèn)時(shí),/php/和其下面的子目錄將支持url rewrite。
后記:php100.com網(wǎng)上的很多文章并沒(méi)有提到要使用 Options FollowSymLinks,因?yàn)樵趆ttpd.conf中有<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all Satisfy all</Directory>這樣如果你的網(wǎng)站配置成通過(guò)http://localhost:8080/來(lái)訪問(wèn),就不會(huì)注意到Options FollowSymLinks的影響,只需要將AllowOverride None改為AllowOverride All即可。而我習(xí)慣于在本機(jī)配置成http://localhost:8080/php/,忘了加Options Indexes FollowSymLinks就成功不了,會(huì)顯示ForbiddenYou don't have permission to access /php/f2blog/ on this server.這樣的錯(cuò)誤。后來(lái)還是在apache文檔中找到了原因Note: To enable the rewriting engine for per-directory configuration files you need to set ``RewriteEngine On'' in these files and ``Options FollowSymLinks'' must be enabled. If your administrator has disabled override of FollowSymLinks for a user's directory, then you cannot use the rewriting engine. This restriction is needed for security reasons.實(shí)際上mod_rewrite是針對(duì)目錄的,因此并不需要將httpd.conf中的所有AllowOverride None改為AllowOverride All,Options也一樣。BTW:看來(lái)首先是要看程序提供的文檔,但是tomcat5.0.28的文檔我?guī)缀醵伎戳耍矝](méi)有看到說(shuō)到底能不能通過(guò)service.bat在windows上安裝成功服務(wù)。倒是看到N多人和我一樣的疑問(wèn)卻沒(méi)有答案,嗯,我當(dāng)然知道通過(guò)tomcatxx.exe能安裝成功tomcat服務(wù),看來(lái)只有這一條路了。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注