Configuring apache mod_alias giving Internal server error

1.3k views Asked by At

I have following configuration for my virtual host

<VirtualHost 127.0.0.1:80>
    ServerAdmin                     [email protected]
    DocumentRoot                    /home/mydir

    ServerName                      mydir.domain.com

    ErrorLog                        /home/mydir/logs/apache-local-error_log
    CustomLog                       /home/mydir/logs/apache-local-access_log common
    RewriteEngine                   on
    RewriteLog                      /home/mydir/logs/rewrite.log
    RewriteLogLevel                 3

    Alias /proj /home/mydir/proj/public_html

    <Directory /home/mydir>
        Options +Indexes
        AllowOverride       ALL
    </Directory>
</VirtualHost>

i have laravel installation in /home/mydir/proj and when I try to access http://mydir.domain.com/proj I get "Internal Server Error" and in logs I get following:

rewrite.log:

IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (2) init rewrite engine with requested uri /proj/public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (1) pass through /proj/public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (3) [perdir /home/mydri/proj/public_html/] add path info postfix: /home/mydri/proj/public_html/public_html -> /home/mydri/proj/public_html/public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (3) [perdir /home/mydri/proj/public_html/] strip per-dir prefix: /home/mydri/proj/public_html/public_html/index.php -> public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (3) [perdir /home/mydri/proj/public_html/] applying pattern '^(.*)/$' to uri 'public_html/index.php'
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (3) [perdir /home/mydri/proj/public_html/] add path info postfix: /home/mydri/proj/public_html/public_html -> /home/mydri/proj/public_html/public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (3) [perdir /home/mydri/proj/public_html/] strip per-dir prefix: /home/mydri/proj/public_html/public_html/index.php -> public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (3) [perdir /home/mydri/proj/public_html/] applying pattern '^.*$' to uri 'public_html/index.php'
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (2) [perdir /home/mydri/proj/public_html/] rewrite 'public_html/index.php' -> 'index.php'
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (3) [perdir /home/mydri/proj/public_html/] add per-dir prefix: index.php -> /home/mydri/proj/public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (2) [perdir /home/mydri/proj/public_html/] strip document_root prefix: /home/mydri/proj/public_html/index.php -> /proj/public_html/index.php
IP Address - - [28/Nov/2014:13:16:58 +0400] [mydri.domain.com/sid#7f4fc4e07098][rid#7f4fc574f508/initial/redir#10] (1) [perdir /home/mydri/proj/public_html/] internal redirect with /proj/public_html/index.php [INTERNAL REDIRECT]

apache-local-error_log:

[Fri Nov 28 13:16:58 2014] [error] [client IP Address] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

In /home/mydir/proj/public_html I have standard .htaccess for laravel:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^.*$ index.php [L]

    RewriteCond %{HTTP:Authorization} ^(.+)$
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

Any suggestions what I am doing wrong would be appreciated.

1

There are 1 answers

1
Fatih ELM On

Update the configuration file.

<VirtualHost 127.0.0.1:80>
    ServerAdmin                     [email protected]
    DocumentRoot                    /home/mydir

    ServerName                      mydir.domain.com

    ErrorLog                        /home/mydir/logs/apache-local-error_log
    CustomLog                       /home/mydir/logs/apache-local-access_log common
    RewriteEngine                   on
    RewriteLog                      /home/mydir/logs/rewrite.log
    RewriteLogLevel                 3

    Alias /proj /home/mydir/proj/public_html

    <Directory /home/mydir>
        Options +Indexes
        AllowOverride all
        Require all granted
    </Directory>
</VirtualHost>