启用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/php/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
这样经过http://localhost:8080/php/访问时,/php/和其下面的子目录将支持url rewrite。php
后记:php100.com
网上的不少文章并无提到要使用 Options FollowSymLinks,由于在httpd.conf中有
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
这样若是你的网站配置成经过http://localhost:8080/来访问,就不会注意到Options FollowSymLinks的影响,只须要将AllowOverride None改成AllowOverride All便可。而我习惯于在本机配置成http://localhost:8080/php/,忘了加Options Indexes FollowSymLinks就成功不了,会显示
Forbidden
You don't have permission to access /php/f2blog/ on this server.
这样的错误。后来仍是在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.
实际上mod_rewrite是针对目录的,所以并不须要将httpd.conf中的全部AllowOverride None改成AllowOverride All,Options也同样。
BTW:看来首先是要看程序提供的文档,可是tomcat5.0.28的文档我几乎都看了,也没有看到说到底能不能经过service.bat在windows上安装成功服务。却是看到N多人和我同样的疑问却没有答案,嗯,我固然知道经过tomcatxx.exe能安装成功tomcat服务,看来只有这一条路了。web