Apache2 Alias not working on Ubuntu?
I just installed apache / php / mysql on Ubuntu 12.04 and I created an alias for my virtual directory, here's my / etc / apache 2 / 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 have already used chown and chmod for: / 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 / apache 2 / error.log I found that it still points to / var / www / demo:
File does not exist: /var/www/demo
Any idea why the alias is being ignored?
Please note that I have already rebooted and reloaded apache2. And overwrite is included too.
Thanks,
czetsuya
source to share
Your problem will most likely be solved with the mod_alias manual ;
Note that if you include trailing / on the url path then the server will require trailing / to expand the alias. That is, if you use
Alias / icons // usr / local / apache / icons / then url / icons will not be aliased as it lacks this trailing /.
Try changing /demo/
to /demo
to your alias and it should work better.
source to share
the guy cares about the exact syntax of these SLASHES it cannot be at the end of the directory name and also not at the end of the alias, it cost me incredible time to find this error, very nice work people from apache !!! as appropriate: Alias "/ docs" "/ var / web" Wrong path: Alias "/ docs /" "/ var / web /"
source to share