无影飞絮剑

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

新安装的wampserver 有的项目启动不起来了。报错如下:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@dummy-host.example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.


Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 8026
 

什么原因呢?

因为我的项目.htaccess使用了Rewrite,还使用了Header(设置文件缓存时间配置

打开wamp\bin\apache\apache2.4.9\conf\httpd.conf

Rewrite设置:去掉#LoadModule rewrite_module modules/mod_rewrite.so 前面的#

Header设置:去掉#LoadModule headers_module modules/mod_headers.so 前面的# 

在查找问题时,先百度的,解决问题比较慢,还问题定位不准确。所以最后还是老老实实的看日志。 

首先看的是wamp\logs下面的日志,当然,没找到Header的问题。 然后去Apache下找wamp\bin\apache\apache2.4.9\logs\dummy-host.example.com-error.log日志文件,看到

[Thu Apr 13 15:56:15.848027 2017] [core:alert] [pid 47156:tid 1020] [client 127.0.0.1:33472] E:/wamp/www/weixin2.0/chesudiwx/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

就是这一句提示了我,mod_headers.so没打开。

为什么日志会写到这里面呢,害的我找半天。原因还是我们虚拟机设置的问题wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf 下面是我的虚拟机:

 

Listen 8026
      <VirtualHost *:8026>
          ServerAdmin webmaster@dummy-host.example.com
          DocumentRoot "E:/wamp/www/weixin2.0/chesudiwx/"
          ServerName dummy-host.example.com
          ServerAlias www.dummy-host.example.com
          ErrorLog "logs/dummy-host.example.com-error.log"
          CustomLog "logs/dummy-host.example.com-access.log" common

              <Directory "E:/wamp/www/weixin2.0/chesudiwx/">
                              Options Indexes FollowSymLinks ExecCGI
                              Order allow,deny
                              Allow from all
                              AllowOverride All
                      </Directory>
      </VirtualHost>

看到了吗?自己写的路径问题。

 

posted on 2017-04-13 16:28  无影飞絮剑  阅读(952)  评论(0)    收藏  举报