Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running a dokuwiki on an apache webserver. Usually I put media files into the directory /var/lib/dokuwiki/data/media. However, to be more flexible and to save disk space, it would be nice to use symbolic links instead of copying files to that directory.

Now my question is:

How to make apache to follow symlinks in the directory /var/lib/dokuwiki/data/media.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I believe FollowSymLinks is what you are looking for. First you have to locate the Apache configuration files. If you install Apache using your distro's package then they are more than likely to be in /etc/apache2/ and the file you have to change is httpd.conf. If in your document root you have the symlink wiki/media -> /real/wiki/media then you will need to create a Directory section like this:

<Directory /wiki>
    Options FollowSymLinks
</Directory>

Please note that I am writing these from memory without any testing, so don't use these directions as is, consult the comments in the file, configuration guide for your distro and the Apache reference when in doubt.

share|improve this answer
    
Thanks! Could you describe more explicit what do do exactly for my case (put which lines in which files etc.) (I am an apache newbie - the server is only for my personal use) –  student Mar 4 '11 at 8:12
    
@user5289 I updated the answer as requested. –  phunehehe Mar 4 '11 at 14:46
    
I added: <Directory /var/lib/dokuwiki/data/media> Options FollowSymLinks </Directory> to my /etc/apache2/httpd.conf, and restarted apache, however it does not work. –  student Mar 5 '11 at 13:38
    
Entries in Directory are relative to the document root of Apache, not the root of your filesystem. You should create a symlink in your Apache document root: ln -s /var/lib/dokuwiki/data/media /var/www/wiki/media, then go with <Directory /wiki>Options FollowSymLinks</Directory> –  phunehehe Mar 5 '11 at 14:34
    
I tried your suggestion, however it didn't work. Note that there is already a file /etc/apache2/conf.d/dokuwiki.conf with contains: Alias /dokuwiki /usr/share/dokuwiki/ <Directory /usr/share/dokuwiki/> Options +FollowSymLinks AllowOverride All order allow,deny allow from localhost 127.0.0.1 192.168.1.34 </Directory> Futhermore /var/www/dokuwiki is a symbolic link to /usr/share/dokuwiki. Finally there is a link /usr/share/dokuwiki/data which points to /var/lib/dokuwiki/data. –  student Mar 5 '11 at 19:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.