-1

I'm trying to create a virtual host that have path to user directory like this /home/user1/dev

My *.conf file is it /etc/apache2/sites-available/mysite.conf, like this

<VirtualHost *:80>
    ServerName mysite
    DocumentRoot /home/user1/dev
    ServerAlias mysite
    <Directory /home/user1/dev>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
   </Directory>
 </VirtualHost>

I add group www-data to directory /home/user1/dev and user1 belong to group www-data too.

Also I add to /etc/hosts

127.0.0.1 mysite mysite

But I get 403 Forbidden

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

I'm using

Server version: Apache/2.4.10 (Debian)
Debian GNU/Linux 8.2 (jessie)

ls -la /home/user1/dev

drwxrws---  5 user1 www-data 4096 dic  2 01:53 .
drwxr-x--- 99 user1 user1   4096 dic  2 03:49 ..
-rwxrwx---  1 user1 www-data   54 feb 27  2014 index.html
-rwxrwx---  1 user1 www-data   23 dic  2 01:53 index.php

Any help or other suggestion to point path to user directory?

7
  • Is the symlink in /etc/apache2/sites-enabled? What do the error logs say?
    – womble
    Dec 3, 2015 at 2:48
  • Yes symlink is in /etc/apache2/sites-enabled. error log: AH00035: access to / denied (filesystem path '/home/omixam/localhost_omixam') because search permissions are missing on a component of the path
    – gvd
    Dec 3, 2015 at 3:11
  • Start with the proper directives for Apache 2.4, see httpd.apache.org/docs/2.4/upgrading.html Dec 3, 2015 at 3:42
  • I did the change in my .conf file but I still having the same error.
    – gvd
    Dec 3, 2015 at 4:46
  • 1
    From the link posted by Federico Sierra: "You should review the Authentication, Authorization and Access Control Howto, especially the section Beyond just authorization which explains the new mechanisms for controlling the order in which the authorization directives are applied." The config posted above doesn't look like you've made the necessary changes (hint: Allow & Order -> Require*)
    – zagrimsan
    Dec 3, 2015 at 8:29

1 Answer 1

2

search permissions are missing on a component of the path

There's your answer. Some component of /home/omixam/localhost_omixam is missing o+x (or g+x if the group is www-data). Fix that, problem solved.

1
  • Thanks for your help. Was very helpful. I also add some details that work for me.
    – gvd
    Dec 5, 2015 at 2:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .