Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache2 Alias not working in Ubuntu?

I've just setup apache/php/mysql in Ubuntu 12.04, and I've created an Alias for my virtual directory, here's my /etc/apache2/sites-enabled/000-default file:

Alias /demo/ "/home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio"
<Directory "/home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio">
    DirectoryIndex index.php
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from all
</Directory>

Note that I've already applied chown and chmod to: /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio

chown www-data:www-data /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio -R
chmow 777 /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio -R

But when I access: _http://localhost/demo, I got a 404 Not found error. Looking at /var/log/apache2/error.log I found that it's still pointing at /var/www/demo:

File does not exist: /var/www/demo

Any idea why Alias is ignored?

Note that I already restart and reload apache2. And rewrite is also enabled.

Thanks,
czetsuya

like image 318
czetsuya Avatar asked Dec 05 '22 14:12

czetsuya


1 Answers

All aliases in Apache 2.4 have to be configured in the /etc/apache2/mods-enabled/alias.conf file.

They are ignored in the virtual host files.

like image 97
Timothy Butterworth Avatar answered Dec 17 '22 03:12

Timothy Butterworth