I have created a virtual host locally using domain name virtual hosting in which I have used an Alias to a directory pointing to another project on the same server (my local host) as given below:
<VirtualHost *:80>
ServerAdmin admin@mail.com
DocumentRoot /var/www/Proj1/public
ServerName www.proj1.dev
Alias /billing /var/www/Proj2/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/Proj1/public/>
AllowOverride All
</Directory>
</VirtualHost>
Now using 'www.proj1.dev/billing' I can access the 'Proj2' directory on my local. That's fine. In my 'ect/apache2/hosts' file the IP address 127.0.0.1 points to www.proj1.dev. Every thing is fine till here.
But when I did the same thing for my EC2 and try to access the 'l4.proj.etc/billing', which off course don't use '127.0.0.1' and uses actual IP address publicly accessible, gives me the 500 error. I can't get what is the problem. Here is my Virtual Host file on EC2:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/Proj1/public
ServerName l4.proj.etc # this is a subdomain
Alias /billing /var/www/Proj2/public
<Directory /var/www/Proj1/public/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I think the alias working might be different for the local host and the actual domain name.
Can someone please help me in this regard?
Here is the Log file's data:
127.0.0.1 - - [23/Dec/2015:16:34:21 +0500] "GET /billing/plans/img/unknown-plans.png HTTP/1.1" 304 180 "http://www.www.proj1.dev/billing/index.php/plans" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
::1 - - [23/Dec/2015:16:34:28 +0500] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.12 (Ubuntu) (internal dummy connection)"
EDITING AS PER @Froggiz and @bangal ANSWERS
Modified Virtual Host File on EC2
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/Proj1/public
ServerName l4.proj.etc # this is a subdomain
Alias /billing /var/www/Proj2/public
<Directory /var/www/Proj2/public>
Require all granted
</Directory>
<Directory /var/www/Proj1/public/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
.htaccess file in Proj2's Public Directory
<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]
</IfModule>