0

我在 Zend 中有一个项目,在目录中:/var/www/Project/public

文件 httpd.conf 的内容是:

<VirtualHost 127.0.0.1:80>
   DocumentRoot "/var/www/Project/public"
   ServerName project.localhost

   # This should be omitted in the production environment
   SetEnv APPLICATION_ENV development

   <Directory "/var/www/Project/public">
       Options Indexes MultiViews FollowSymLinks
       AllowOverride All
       Order allow,deny
       Allow from all
   </Directory>

</VirtualHost>

和 /etc/hosts:

127.0.0.1   localhost
127.0.1.1   michal-centrala

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.0.1   project.localhost

当我转到页面http://project.localhost我收到以下错误:内部服务器错误

服务器遇到内部错误或配置错误,无法完成您的请求。

请联系服务器管理员,[未提供地址] 并告知他们错误发生的时间,以及您可能所做的任何可能导致错误的事情。

服务器错误日志中可能提供有关此错误的更多信息。

服务器日志如下:

[Sun Jun 23 01:31:56 2013] [alert] [client 127.0.0.1] /var/www/Project/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

问题出在哪里?

4

1 回答 1

0

在 httpd.conf 中启用 mod_rewrite

最有可能的线路

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

被注释掉了

#LoadModule rewrite_module libexec/apache2/mod_rewrite.so
于 2013-06-22T23:42:10.173 回答