There are times that within a website, you may want a folder that is a symbolic link to another location on the storage drive, or perhaps an external drive. However, apache2 will not allow serving from another location until the permission owner is the same from what is it currently running as, and the permissions of the target location that a symbolic link is referring to.

What to do is to configure apache2 to run under the linux username.

Configure:

/etc/apache2/apache2.conf

change to your linux username and group for example to tux.

User tux
Group tux

then use a symbolic link within a website.

ln -s /folders/location_on_storage_drive/path/to/file /path/to/symlink

And the target location of the symbolic link. Be sure to set its ownership permissions,

sudo chown tux:tux -R /folders/location_on_storage_drive/path/to/file

This will permit Apache2 to use a symbolic link within a website.

Happy Coding.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *