Ubuntu中的Apache2 - 配置域 - 找不到页面

时间:2013-06-22 23:34:24

标签: linux ubuntu apache2

我在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

问题出在哪里?

1 个答案:

答案 0 :(得分:0)

在httpd.conf中启用mod_rewrite

最有可能的行

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

被注释掉

#LoadModule rewrite_module libexec/apache2/mod_rewrite.so