apache2在AllowOverride All,localhost之后抛出内部服务器错误500

时间:2016-01-29 06:55:25

标签: apache apache2 lamp ubuntu-15.10

我是配置服务器的新手。现在,我必须使用LAMP和opencart框架配置localhost。但仍然是内部服务器错误500。

即使我尝试过以下内容

sudo a2enmode rewrite
apache2ctl configtest // for syantax
apache2ctl -t // for syntax

/etc/apache2/sites-available/000-default.conf文件

    ServerName localhost

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/
    <Directory "/var/www/">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

/etc/apache2/apache2.conf中

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

/var/www/opencart/.htaccess

Options +FollowSymLinks
Header add Access-Control-Allow-Origin "*"
RewriteEngine On
RewriteBase /ot
RewriteCond $1 !^(robots\.txt)

1 个答案:

答案 0 :(得分:4)

检查完日志后,我发现了无效的参数标题。因此,我们必须这样做:

sudo a2enmode headers