Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-27-2004, 04:11 PM   #1
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.

Old 07-27-2004, 04:31 PM   #2
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, 04:48 PM   #3
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.
Old 07-27-2004, 04:54 PM   #4
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, 07:18 PM   #5
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 873

Rep: Reputation: 207Reputation: 207Reputation: 207
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).

Old 07-28-2004, 11:50 AM   #6
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?


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 12:54 PM
Apache 2 Root Directory Listing BorgKiller Linux - General 1 07-05-2004 11:37 AM
Can't find root directory for Apache 2.0 (Mandrake 9.2) kaega2 Linux - Software 6 02-13-2004 06:08 PM
Adding a root directory for Apache mijohnst Linux - Software 9 02-09-2004 03:24 PM
unable to set a site root directory in apache wendallsan Linux - Software 2 09-25-2003 05:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:25 PM.

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