Results 1 to 6 of 6

Thread: Website Only Works When I SSH

  1. #1
    Join Date
    Sep 2010
    Beans
    26

    Website Only Works When I SSH

    My ISP provided me with a static IP and I went and bought a domain name with godaddy.com. The issue I'm having now is that I am getting a 403 forbidden error (You don't have permission to access / on this server). The strange part is that when I ssh into my server, and try to go to my website, everything works fine. Anyone have any ideas what I should do?

  2. #2
    Join Date
    Sep 2010
    Beans
    26

    Re: Website Only Works When I SSH

    I just wanted to add something to my previous post. Even when I'm connected to the local network and type in the server's LAN address I get the same error. Similarly, if I ssh into the server and type in the server's LAN address into the browser, I get directed to the index.html page. I have a feeling that I did not set the permissions correctly for the public_html folder in the first place.

    This is what I did:
    chmod 755 ~/public_html/
    chmod 644 ~/public_html/index.html/

  3. #3
    Join Date
    Jun 2007
    Beans
    1,941

    Re: Website Only Works When I SSH

    So is the website in ~? Why isn't in in /var/www? You need to chown www-data to any file/folder the web server needs to hit from the outside... Which is why putting it in ~ seems like a bad idea to me (but it should work if you get the permissions correct...)

  4. #4
    Join Date
    Sep 2010
    Beans
    26

    Re: Website Only Works When I SSH

    If I use the /var/www directory then everything works fine. However, I don't understand why I cannot use the /home/root_user_name/public_html directory.

    1)I've modified the /etc/apache2/sites-available/default file and wherever there I found the /var/www/ directory, I replaced it by the /home/root_user_name/public_html directory.

    2)I've set the permissions on the /home/root_user_name/public_html directory to 755.

    I don't see why it doesn't work when I store the files in the /home/root_user_name/public_html if I have the right permissions.

  5. #5
    Join Date
    Feb 2005
    Location
    Oregon
    Beans
    496
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Website Only Works When I SSH

    Are you sure the 403 error is coming from your server? Do you use an http proxy on your desktop machine?

  6. #6
    Join Date
    Jun 2007
    Beans
    1,941

    Re: Website Only Works When I SSH

    Quote Originally Posted by flyingsuperhigh View Post
    If I use the /var/www directory then everything works fine. However, I don't understand why I cannot use the /home/root_user_name/public_html directory.

    1)I've modified the /etc/apache2/sites-available/default file and wherever there I found the /var/www/ directory, I replaced it by the /home/root_user_name/public_html directory.

    2)I've set the permissions on the /home/root_user_name/public_html directory to 755.

    I don't see why it doesn't work when I store the files in the /home/root_user_name/public_html if I have the right permissions.
    Did you miss the part where I mention www-data must own it? That's in addition to perms.

    Code:
    chown -R www-data:www-data /home/root_user_name/public_html

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •