客户端拒绝服务器Apache

时间:2013-08-03 17:47:47

标签: php .htaccess mod-rewrite apache2 internal-server-error

当我尝试从localhost运行应用程序时,error.log文件中记录了以下消息

[Sat Aug 03 23:05:05 2013] [error] [client 127.0.0.1] client denied by server configuration: /var/www/xyz/system/
[Sat Aug 03 23:05:05 2013] [error] [client 127.0.0.1] client denied by server configuration: /var/www/xyz/application/

.htaccess文件包含

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ xyz/index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ xyz/index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ xyz/index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule> 

有人可以解释这里发生了什么并导致这种情况吗?

更新

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride All
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        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>

P.S应用程序是使用CodeIgniter Framework构建的 更新2:权限设置

drwxr-xr-x 15 abc abc 4096 Jul 31 22:06 application
-rwxr-xr-x  1 abc abc 2496 Jul 31 22:02 license.txt
drwxr-xr-x  8 abc abc 4096 Jul 31 22:09 system

1 个答案:

答案 0 :(得分:0)

我终于能够解决它了。该问题是由于缺少index.php引起的。该文件应存在于应用程序文件夹和系统文件夹所在的文件夹中。