LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   apache root directory (https://www.linuxquestions.org/questions/linux-newbie-8/apache-root-directory-210343/)

thegooch49 07-27-2004 04:11 PM

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

devinWhalen 07-27-2004 04:31 PM

Apache has to be able to see them as well. You changed the group and Apache does not belong to that root.

thegooch49 07-27-2004 04:48 PM

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

btmiller 07-27-2004 04:54 PM

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.

AnanthaP 07-27-2004 07:18 PM

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

thegooch49 07-28-2004 11:50 AM

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?


All times are GMT -5. The time now is 03:43 PM.