LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2004, 05:11 PM   #1
thegooch49
LQ Newbie
 
Registered: Mar 2004
Distribution: Red Hat
Posts: 10

Rep: Reputation: 0
apache root directory


Hi gang, I'm using an older version of Red Had, and am hoping to set it up as a basic webserver. The root directory apache uses for it's docs, is /var/www/html wich is owned by root, group root. I created a new group called 'web', and added a few users to it. I then did a chgrp on the html folder so users can read/write to that folder. That worked fine for the read/write, but now I'm getting a 403 forbidden error when I access the webserver through a browser.

Do these files need to have a certain permission set to be visible? Any suggestions?

Thanks for any help.

-Jeff
 
Old 07-27-2004, 05:31 PM   #2
devinWhalen
Member
 
Registered: Apr 2003
Location: Toronto, Canada
Distribution: Red Hat, openBSD,Mandrake,freeBSD,SunOS
Posts: 168

Rep: Reputation: 30
Apache has to be able to see them as well. You changed the group and Apache does not belong to that root.
 
Old 07-27-2004, 05:48 PM   #3
thegooch49
LQ Newbie
 
Registered: Mar 2004
Distribution: Red Hat
Posts: 10

Original Poster
Rep: Reputation: 0
That makes sense, but I still can't re-configure it. The html folder is still owned by root, with goup web. I understand that there is a user 'apache'. I added this user to the web group. It still won't work. I also notice that there is a group named apache. Should I just change everything back to owner and group root?

Any advice to repair this? If not, does anyone know a tutorial that describes giving users access to these documents, without root access?

Thanks for the help.
-Gooch
 
Old 07-27-2004, 05:54 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
On a lot of configurations, Apache doesn't actually run with the priviliges of the groups the apache user is a member of (this is for security, I imagine). The best thing to do is make sure that your /var/www/html directory is world readable and world executable. Also all files in it should be world readable. Make sure /var/www is world readable and executable too. This should fix your issues.

Alternatively, if you want Apache to run with the priviliges of a particular group, open your httpd.conf file and find the line saying User apache (or whoever your Apache user is). Directly below this add a line saying "Group web", and restart Apache. This will allow Apache to run as group web.
 
Old 07-27-2004, 08:18 PM   #5
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 813

Rep: Reputation: 195Reputation: 195
Same problem with RedHat 7.1 and Apache (off the distro - dont remeber the number right now). Had to make permission of the folder (/var/www/html/myfolder) as +x and fortunately for me, it's a hardened intranet with only dial up internet access thru' a DOS client. (It may not work for everyone and one day I will have to change the permission to 444).

End
 
Old 07-28-2004, 12:50 PM   #6
thegooch49
LQ Newbie
 
Registered: Mar 2004
Distribution: Red Hat
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the suggestions. I was able to get it back exactly how it was before I changed anything. Apache is happy again, and is working fine.

Before I make any more changes, let me get this straight. It is OK to change the HTML folder to group = web, as long as I add "group web" in the appache httpd.conf as BTMILLER suggested. Is this correct?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache root directory problem tbrenner Linux - Networking 1 09-12-2005 01:54 PM
Apache 2 Root Directory Listing BorgKiller Linux - General 1 07-05-2004 12:37 PM
Can't find root directory for Apache 2.0 (Mandrake 9.2) kaega2 Linux - Software 6 02-13-2004 07:08 PM
Adding a root directory for Apache mijohnst Linux - Software 9 02-09-2004 04:24 PM
unable to set a site root directory in apache wendallsan Linux - Software 2 09-25-2003 06:50 PM


All times are GMT -5. The time now is 05:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration