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

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 me@gmail.com
       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 me@gmail.com
       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.

share|improve this question
    
If you access the index.html does the error message change? –  becomingwisest Dec 11 '11 at 3:35

2 Answers 2

up vote 0 down vote accepted

Is your whole tree of dirs set to 777?

chmod 755 the parent directorys

share|improve this answer
    
thanks -- that did it. so obvious it would've been days before I thought of it. :) –  John Carter Dec 11 '11 at 3:35

Also you might want to look into modifying or disabling selinux

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

share|improve this answer
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. –  becomingwisest Dec 11 '11 at 3:37

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.