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 ?
Answer: A symbolic link, aka soft link or symlink, is a special kind of file that points to another file. A shell alias allows a string to be substituted for a word when it is used as the first word of a simple command.
The Alias directive allows documents to be stored in the local filesystem other than under the DocumentRoot . URLs with a (%-decoded) path beginning with URL-path will be mapped to local files beginning with directory-path . The URL-path is case-sensitive, even on case-insensitive file systems.
A symlink is a symbolic Linux/ UNIX link that points to another file or folder on your computer, or a connected file system. This is similar to a Windows shortcut. Symlinks can take two forms: Soft links are similar to shortcuts, and can point to another file or directory in any file system.
A soft link (also known as Symbolic link) acts as a pointer or a reference to the file name. It does not access the data available in the original file. If the earlier file is deleted, the soft link will be pointing to a file that does not exist anymore.
Using an Alias in your Apache httpd has several advantages over using a symbolic link:
Alias
works on all platforms supported by Apache httpd. Symbolic links are not supported by all platforms and filesystems.With shared hosting you are not authorized to alter the Apache config, so a symlink is an alternative.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With