【发布时间】:2015-11-25 11:25:12
【问题描述】:
我遇到了 Linux 服务器的问题。
配置: Linux 服务器 3.2.0-4-686-pae #1 SMP Debian 3.2.65-1+deb7u2 i686
Apache/2.2.22 (Debian)
PHP/5.4.39-0+deb7u2
ModRewrite 已开启 (a2enmod)
我的 htaccess 看起来像:
<IfModule mod_rewrite.c>
Options -MultiViews +SymLinksIfOwnerMatch
#RewriteEngine On
RewriteBase /var/www/git
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L,NC]
</IfModule>
<Files config.ini>
order allow,deny
deny from all
</Files>
当我取消注释 #RewriteEngine On 我得到内部服务器错误
我在 Apache 中可用的站点如下所示:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/git
ServerName git.server.com
Alias /git /var/www/git
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 5
<Directory /var/www/git>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
您有解决问题的想法吗? 谢谢
【问题讨论】:
-
你检查你的服务器错误日志了吗?
-
当然我有,例如:[Mon Aug 31 13:28:00 2015] [error] [client 192.168.0.23] 文件不存在:/var/www/git/refresh,referer :git.server.com 还有很多这样的。没有更多有用的信息。
-
该文件不存在,这是真的,但在这种情况下有htaccess。我认为...
标签: php linux apache .htaccess mod-rewrite