Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having an issue getting vhosts to work on Apache 2.2, Debian 6. I have two VirtualHosts, one on port 80 and one on port 8888. The port 80 one has been created automatically by DirectAdmin, the 8888 is a custom one. It's configuration is as follows.

<VirtualHost *:8888 >
    DocumentRoot /home/user/public_html/development
    ServerName www.myserver.nl
    ServerAlias myserver.nl

    <Directory "/home/user/public_html/development">
            Options +Indexes +FollowSymLinks +MultiViews

            AllowOverride All

            Order Allow,deny
            Allow from all
    </Directory>
</VirtualHost>

Of course I also have a

NameVirtualHost *:8888

The port 80 DocumentRoot is /home/user/public_html/production, which is perfectly accessible and works like a charm. The port 8888 docroot of /home/user/public_html/development is 403 forbidden though.

I have compared the permissions for both folders. They seem fine to me.

drwxr-xr-x  2 root root  4096 Aug 17 16:14 development
drwxr-xr-x  4 root root  4096 Aug 18 04:29 production

Also, the index.php file which is supposed to display when accessing through port 8888, located in /development/:

-rwxr-xr-x 1 root root 41 Aug 17 16:14 index.html

I have looked at my error_log and found many of the following entries, only being added to the log file when accessing through port 8888.

[Sat Aug 18 04:35:09 2012] [error] [client 27.32.156.232] Symbolic link not allowed or link target not accessible: /home/user/public_html

/home/user/public_html is a symbolic link that refers to /home/user/domains/mydomain/public_html. The symbolic link has the following permissions:

lrwxrwxrwx 1 admin admin    29 Aug 17 15:56 public_html -> ./domains/mydomain/public_html

I'm at a loss. It seems that everything is readable or executable. I've set the Directory to FollowSymLinks in the httpd.conf file, but that doesn't seem to make a difference. If I change that directory tag to <Directory "/home/admin/public_html"> (so it has FollowSymLinks on that as well) it still does not work.

Any help is greatly appreciated. If I need to post more information, let me know. I'm pretty much a beginner at this stuff.

.. ..

UPDATE: I ended up changing the configuration to directly go to the actual path of the files, avoiding the public_html symlink altogether. That worked. Thanks for the suggestions folks.

DocumentRoot /home/user/domains/mydomain/public_html/development

instead of

DocumentRoot /home/user/public_html/development
share|improve this question
    
what are the permissions on ./domains/mydomain/public_html? –  Christopher Perrin Aug 18 '12 at 1:22
    
Thanks for the response. Permissions are: drwxr-xr-x 6 root root 4096 Aug 18 05:18 public_html –  Wesley Aug 18 '12 at 1:24
    
And ./domains/mydomain/ and ./domains/ ? –  DerfK Aug 18 '12 at 2:57
    
Appended an update to my original post. –  Wesley Aug 18 '12 at 3:17
1  
You can answer your own question to make it clear what happened here. –  Dave Forgac Aug 18 '12 at 3:42

1 Answer 1

up vote 1 down vote accepted

I ended up changing the configuration to directly go to the actual path of the files, avoiding the public_html symlink altogether. That worked. Thanks for the suggestions folks.

DocumentRoot /home/user/domains/mydomain/public_html/development

instead of

DocumentRoot /home/user/public_html/development
share|improve this answer

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.