Click to See Complete Forum and Search --> : Apache and Symlinks


yutt
11-21-2003, 03:31 PM
A friend of mine and I have set up an Apache webserver on a Gentoo system. There is a directory he wants to make available on the server, but doesn't wish to move to /var/www/localhost/htdocs.

Is it possible to do this somehow via a symbolic link to the directory he wants to share? The directory is /mnt/shared1.

If the symbolic link is possible, do the permissions of the parent directory need to be modified? If the symlink is not possible, is there another way to do this without moving the directory? A config file perchance?

Thanks, :)
-yutt

yutt
11-21-2003, 05:15 PM
Here is the error we are getting from the Apache log.

[Fri Nov 21 12:11:08 2003] [error] [client ---.---.1.216] Symbolic link not allowed: /var/www/localhost/htdocs/shared1

It seems this would be a problem with the Apache configuration, not the file system permissions, however I have no idea how to remedy it.

I have tried adding;

<Directory "/var/www/localhost/htdocs/">
Options All
</Directory>
to the bottom of commonapache.conf, but I don't know if that is the proper syntax or location.

With this new information, can anyone other suggestions?

bheerssen
11-21-2003, 05:45 PM
Edit your httpd config file and add an alias to the directory you want to have available (since it is outside the web root). Then add permissions for that directory in the config file.

At any rate, add the following to your aliases section:

Alias /shared1 /mnt/shared1
<Directory /mnt/shared1>
Options +Indexes MultiViews FollowSymLinks
Order Allow,Deny
Allow from all
</Directory>

Finally, make sure that directory is owned by the apache user and group. You can find this information at the top of your configuration file.

After restarting apache, you should be able to access the directory from http://yourserver.com/shared1/

Of course, alias names are completely arbitrary. For instance, you could use:

Alias /wicked /mnt/shared1

which would be accessed from http://yourserver.com/wicked/


HTH,

--Bruce

yutt
11-25-2003, 11:47 PM
Well Bruce, what you've told me so far was helpful enough to point me in the right direction, but I haven't managed to get it working yet.

First, there is no httpd.conf. I am assuming commonapache.conf is the replacement for httpd.conf, but I have no reason to be certain of this other than, from the examples of httpd.conf I have seen, they look very similar.

I need to know specifically what the chmod permissions need to be for the /shared1 directory and the /shared1/.htaccess

What do I need to put in the .htaccess file? Sorry, I have never set up a webserver before, and any of the 20+ tutorials I have looked at don't refer specifically enough to what I am trying to do.

What exact portion of httpd.conf (or commonapache.conf) needs to have the example you gave? Is it all one block of code? Is it embedded within another section of code, or is it just under the heading for the Aliases section?

I have tried a plethora of different combinations, but none have worked so far. I am doing this through a 56 kbps connection and Webmin, so any little bit of help can save me hours.

Thanks again,
-yutt

Forbidden

You don't have permission to access /shared1/ on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

miteycasey
11-28-2003, 07:52 AM
you will need read access to the file.
do a ls -al /mnt/shared1
it will need to read something like -rw-r--r-- file name.