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

Discussion in 'Site & Server Administration' started by johnmerlino, Jun 28, 2010.

  1. #1
    I try to connect to http://localhost/ and I get the message described in the title: 403 forbidden You don't have permission to access / on this server.

    I try to connect to: http://localhost/~merlino04/ and I just get a blank page.

    I restart apache server:
    sudo apachectl graceful
    Password:
    sudo apachectl stop
    sudo apachectl start
    This does nothing.
    I look in error_log: apache2/logs/error_log
    And it hasn't been updated for months so it provides no help.
    Also I know for a fact that the Sites directory is in the right location and it contains index.html and I also added a test.php, which leaves a blank page with nothing as well.
    I have no clue what's wrong. I'm using mac osx10.6.2
    Thanks for any response.
     
    johnmerlino, Jun 28, 2010 IP
  2. Shagoon

    Shagoon Notable Member

    Messages:
    596
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    220
    #2
    Make sure you're not having a .htaccess file in your website directory which is misconfigured and that could cause this error.

    Also make sure you're having the apache configs in order, to allow access to that specific folder.
     
    Shagoon, Jun 28, 2010 IP
  3. johnmerlino

    johnmerlino Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can you expand on what you mean by that?
    All I did was, in order to install latest version of php, I commented the following line in httpd.conf:

    #LoadModule php5_module libexec/apache2/libphp5.so
     
    johnmerlino, Jun 28, 2010 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    The default Apache install usually does not allow access to user directories in the manner you are trying to access them. You need to search the configuration file and enable user_dir, then restart the web server. You may also have to adjust permissions on the folder you are trying to server pages from as well.

    Chris
     
    RHS-Chris, Jun 28, 2010 IP
  5. Shagoon

    Shagoon Notable Member

    Messages:
    596
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    220
    #5
    Hello,

    In the apache config file you'll find somewhere the path leading to your website's folder, example:
    DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
    <Directory "C:/Program Files/Apache Group/Apache2/htdocs">

    Below this you'll find the permission for this folder, like this:
    Order allow,deny
    Allow from all

    Make sure it's configured as I posted it above.
    Then restart apache and try accessing your website again.
     
    Shagoon, Jun 28, 2010 IP
  6. johnmerlino

    johnmerlino Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This makes the 403 forbidden go away. But it still doesn't load the apache welcome screen. It just returns a blank page again in firefox and when I tried it in safari, it says "
    Safari can’t open the page “http://localhost/~merlino04/” because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again."
     
    johnmerlino, Jun 28, 2010 IP
  7. johnmerlino

    johnmerlino Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well, after 3 tablets of ativan and 2 of xanax, a half hour of yoga and a warm shower, I uncommented the line that I mentioned I commented above and restarted the server. And it worked.
     
    johnmerlino, Jun 28, 2010 IP
  8. Shagoon

    Shagoon Notable Member

    Messages:
    596
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    220
    #8
    Glad you figured things out.
     
    Shagoon, Jun 28, 2010 IP