1

I'm configuring Apache myself, and trying to force myself to (re-)learn the configuration process. It's been a long time!

Version is Apache/2.2.21 running on Amazon Linux

I'm planning on running a few sites from this server.

I've created:

  • /home/ec2-user/sites
  • /home/ec2-user/sites/www.domain.ca
  • /home/ec2-user/logs

The first two contain index.html files. In the process of my experimentation, I've set my tree to 777 without any success, and have changed ownership and groups for directories and files to apache (which is what is sent in httpd.conf).

I've chopped out some relevant parts of my httpd.conf file:

    DirectoryIndex index.html index.html.var

    DocumentRoot "/home/ec2-user/sites"

    <Directory "/">
       Options None
       AllowOverride None
    </Directory>

    <Directory "/home/ec2-user/sites">
        Options Indexes
        Order Allow,Deny
        Allow from All
        # Any other directory-specific stuff
    </Directory>

    <Directory "/home/ec2-user/www.domain.ca">
        Order Allow,Deny
        Allow from All
        # Any other directory-specific stuff
    </Directory>

    # Default for when no domain name is given (i.e. access by IP address)

    <VirtualHost *:80>
       ServerAdmin [email protected]
       DocumentRoot /home/ec2-user/sites
       ErrorLog /home/ec2-user/logs/error_log
       TransferLog /home/ec2-user/logs/access_log
    </VirtualHost>

    # Add a VirtualHost definition for your domain which was once the system default.

    <VirtualHost www.domain.ca>
       ServerName www.domain.ca
       ServerAlias domain.ca
       ServerAdmin [email protected]
       DocumentRoot /home/ec2-user/sites/www.domain.ca
       ErrorLog /home/ec2-user/logs/domain.ca.error_log
       TransferLog /home/ec2-user/logs/domain.ca.access_log
    </VirtualHost>

In the error logs, I'm just getting:

Sun Dec 11 02:50:11 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied
[Sun Dec 11 02:50:14 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied
[Sun Dec 11 02:54:27 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied
[Sun Dec 11 02:54:32 2011] [error] [client 174.95.145.253] (13)Permission denied: access to / denied

Admittedly this isn't a very interesting question, but I'm stumped, and am now just flipping settings trying to determine what's causing the problem.

1
  • If you access the index.html does the error message change? Dec 11, 2011 at 3:35

2 Answers 2

1

Is your whole tree of dirs set to 777?

chmod 755 the parent directorys

1
  • thanks -- that did it. so obvious it would've been days before I thought of it. :) Dec 11, 2011 at 3:35
0

Also you might want to look into modifying or disabling selinux

See: https://stackoverflow.com/questions/1225594/apache-13-permission-denied-in-users-home-directory

1
  • 1
    I doubt selinux is the issue in this case because apache has been able to write to the log files. Otherwise that would have been my guess. Dec 11, 2011 at 3:37

You must log in to answer this question.

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