#1
  1. Almighty God of Nothing
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2005
    Location
    Rotherham, UK
    Posts
    712
    Rep Power
    92

    Question DocumentRoot does not exist, when it does


    I have recently yum installed apache 2 for a development server. I have copied the config from our live server (which works) and set up an example site.

    When I got to start apache (service httpd start) I get the following error:

    Starting httpd: Warning: DocumentRoot [/home/mysite] does not exist
    [ OK ]

    The directory does exist and has files in it to server as a website.

    Here is the virtualhost conf for this website:
    <VirtualHost *:80>
    ServerAdmin webmaster@mysite.com
    ServerName www.mysite.com
    ServerAlias mysite.com
    DocumentRoot "/home/mysite"
    Options -Indexes +FollowSymLinks
    <Directory /home/mysite>
    AllowOverride All
    RewriteEngine On
    </Directory>
    </VirtualHost>

    Is it a permission thing? The folders are 755 (root).

    Thanks for any help in advance.
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1099
    Does the Apache user (usually nobody or www) have read rights on /home/mysite?
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  4. #3
  5. No Profile Picture
    Hang your freedom higher.
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2005
    Posts
    659
    Rep Power
    158
    This is often the result of saving a file in the wrong format for a given platform - for example saving a file in Windows text format and then using this file on a linux box.

    A good example is a PERL script saved as Windows text, but run on linux machine - the initial line of the script (the shebang) will contain a line something like...
    Code:
    #!/usr/bin/perl
    ...
    ...but because the file has been saved as windows text attempts to run the script will result "file not found" error messages because the linux environment is looking for "#!/usr/bin/perl<nl><cr>" (which of course doesn't exist) instead of just "#!/usr/bin/perl".

    Hope this helps.
    Last edited by atlantisstorm; May 3rd, 2008 at 08:12 AM.
    "Badges? We ain't got no badges. We don't need no badges! I don't have to show you any stinkin' badges!!"
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    DocumentRoot does not exist, but it does


    I had the same problem. Turned out to be SELINUX.
    Edit /etc/sysconfig/selinux and change it to disabled then reboot.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0
    Originally Posted by comaxb
    I had the same problem. Turned out to be SELINUX.
    Edit /etc/sysconfig/selinux and change it to disabled then reboot.
    Thank you! After fighting this for hours, I just turned off SELINUX and it works fine. You'd think the nice folks at Apache might put that in their help file.

    Reg Natarajan
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    1
    Rep Power
    0
    Originally Posted by comaxb
    I had the same problem. Turned out to be SELINUX.
    Edit /etc/sysconfig/selinux and change it to disabled then reboot.
    That was exactly my problem also, thx for help.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Location
    Chennai, India
    Posts
    1
    Rep Power
    0

    If you do NOT want to disable SELinux, here is an alternative


    Open SELinux Management > boolean > enable Home directory Access for Apache

    This worked for me and did not require restart of the computer.

    or use a folder which is not on your home directory, that too will not trigger the SELinux security rules.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    1
    Rep Power
    0
    from the command line:


    setenforce 0

    Done. No reboot required.

IMN logo majestic logo threadwatch logo seochat tools logo