Fedora Linux Support Community & Resources Center
  #1  
Old 19th May 2009, 02:12 PM
Booma Offline
Registered User
 
Join Date: Oct 2006
Location: London
Age: 42
Posts: 26
Document Root Directory problem when using LocalHost

Hello everyone,

I'm trying to set up my localhost so that I can develop locally. here's a check list of what I know I can do.
  1. Start and stop httpd
  2. Start and stop mysql
  3. Change the DocumentRoot in the httpd conf file

In the httpd.conf file I have my DocumentRoot set like this:
DocumentRoot "/home"

Which presents the following within the browser (http://localhost/):

Index of /
[ICO] Name Last modified Size Description
Apache/2.2.11 (Fedora) Server at localhost Port 80

If I try and navigate to here http://localhost/somewhere I'm told that I don't have permission.

Has anyone got any ideas? This is doing my haed in!!

Many thanks
Reply With Quote
  #2  
Old 19th May 2009, 03:07 PM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,075
The http server doesn't have permission to access users' home directories. Setting DocumentRoot to /home isn't the right way to allow HTML development under your home directory. Change DocumentRoot back to what it was (/var/www/html). Create a directory public_html in your home directory, set the UserDir option in httpd.conf and set the SELinux boolean httpd_enable_homedirs to true.
Reply With Quote
  #3  
Old 20th May 2009, 09:44 AM
Booma Offline
Registered User
 
Join Date: Oct 2006
Location: London
Age: 42
Posts: 26
That makes sense

Thanks markkuk,

that makes complete sense, just one more question if I may. In your opinion what is the best way to administer SELinux?

Thanks again
Reply With Quote
  #4  
Old 22nd May 2009, 10:20 AM
Booma Offline
Registered User
 
Join Date: Oct 2006
Location: London
Age: 42
Posts: 26
Still a problem with permissions

Quote:
Originally Posted by markkuk View Post
The http server doesn't have permission to access users' home directories. Setting DocumentRoot to /home isn't the right way to allow HTML development under your home directory. Change DocumentRoot back to what it was (/var/www/html). Create a directory public_html in your home directory, set the UserDir option in httpd.conf and set the SELinux boolean httpd_enable_homedirs to true.
Okay, I've completed the above and observed all the usual procedures with regard to restarting httpd ect. I'm navigating to this address http://localhost/~booma which I know works because a 403 (forbidden) is being returned rather than a 404 (not found).

So it's still a permissions problem, any ideas?

Many thanks
Reply With Quote
  #5  
Old 22nd May 2009, 11:07 AM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,075
Both your home directory and the public_html directory must have at least 711 rights (+x right to all users).
Reply With Quote
  #6  
Old 22nd May 2009, 12:19 PM
Booma Offline
Registered User
 
Join Date: Oct 2006
Location: London
Age: 42
Posts: 26
Thank you

Thanks very much, that's all sorted! Thanks again for your patience.
Reply With Quote
Reply

Tags
directory, document, localhost, problem, root

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
403 error in chroot document root meisi Servers & Networking 0 9th October 2009 09:05 AM
Document Root Not Working jwceo Installation, Upgrades and Live Media 1 23rd April 2008 07:16 PM
Apache 2 document root melyadon Servers & Networking 4 2nd April 2005 07:58 PM
How to change root document directory in Apache? BandC Using Fedora 4 4th March 2005 06:00 AM


Current GMT-time: 04:45 (Wednesday, 03-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat