apache alias vs symbolic link
Asked Answered
R

3

7

When working with apache on a unix system,

If your file system has icons in /home/me/web/icons

and you want the browser be able to display them when calling the url http://www.me.com/icons/myicon.jpg for example,

then you have at least 2 solutions :

alias ( Alias /icons/ /home/web/icons/ )

symbolic links ( ln -s /home/web/icons /home/me/web/www/icons )

It seems to me that using apache aliases is the best choice since we know exactly that aliases would normally be in the /etc/apache2 directory ( so that is just one place to look at in case the application grows ), but I would be pleased to know about what solution you use and why ?

Ruck answered 3/7, 2011 at 6:26 Comment(0)
E
11

Using an Alias in your Apache httpd has several advantages over using a symbolic link:

  • Symbolic links require an additional disk access to resolve the symbolic link.
  • Alias works on all platforms supported by Apache httpd. Symbolic links are not supported by all platforms and filesystems.
  • Your Apache httpd configuration will work the exactly same way on a new system without the need to create symbolic links in your file system.
Estren answered 3/7, 2011 at 9:2 Comment(0)
L
4

With shared hosting you are not authorized to alter the Apache config, so a symlink is an alternative.

Lidalidah answered 31/1, 2012 at 5:47 Comment(0)
A
1

Using an alias in the config file effectively documents your configuration. Using a link might well work but would not be an approach i would take.

On a productions machine I would use neither. Giving access to a user's directory would not be ideal from a security perspective. From the point of version control the icon directory should be filled like any other resource be it html or other form the QA'd release.

J

Apure answered 3/7, 2011 at 7:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.