Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    2,004

    Error 403 for Apache After Changing Root Directory


    Hi All,

    Trying to change the root directory away from /var/www to a subfolder in my home folder (sick of using root to get around). What I did was this:

    sudo gedit /etc/apache2/sites-available/default

    Changed Document Root and Directory to /home/user/Documents/PHP


    I then changed my PHP folder to 777.

    Before the change my test php worked fine, now it's spitting out a 403 error. Any help would be appreciate


    These are the instructions I followed for changing the directory:

    Configuring the PHP Development Environment in Linux Ubuntu
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,907
    Every directory from / to your site will need read and execute permissions. Take a look at this tutorial for ideas on setting up development web servers
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!


    The Fifth Continent

  3. #3
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    2,004
    I do have both permissions as it is my home folder, I have made it executable and put permissions at 777 and it still fails
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  4. $spacer_open
    $spacer_close
  5. #4
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,907
    Ah but does the user or group www-data have read and execute permission? That's who runs Apache. Or user httpd on the Red Hat based systems.
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!


    The Fifth Continent

  6. #5
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    2,004
    How do I go about doing that? I added my user to the www-data group, I also checked the folder properties but I don't see www-data in the drop down menu for permissions. Thanks again
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  7. #6
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,907
    Did you look at the tutorial I linked to?

    The way that does it is to change the group on the folders to www-data. It also creates the sites outside of your home directory so that no additional users need access to that. It definitely works on LMDE.
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!


    The Fifth Continent

  8. #7
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    2,004
    solved! thanks Elija
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

Posting Permissions

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