• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

Apachi Web Server, where are web pages stored?

I'd like to know the path to where web pages are stored on the Red Hat 5.1 Apachi installation. I would also like to know something about the permissions, storage, and handling of web content. Should the files be seperated into directories, such as jpg's and gif's into seperate directories from html. What permissions do the files need, who needs to own them, or does it matter?  I'm just interested in getting enough info to start to use it as an Intranet web server and don't want any surprises. Please don't post your comments as an answer. I will award the question to what I view as the best answer and then ask for it to be reposted.
0
joe_massimino
Asked:
joe_massimino
  • 4
  • 3
1 Solution
 
marcelofrCommented:
The default directory for .html docs is "/home/httpd/html" but you can override it in your /etc/httpd/conf/srm.conf in the DocumentRoot entry. (read /etc/httpd/conf/*.conf, they have VERY detailed documentation). You can also point your favourite browser to http://your_host/manual/ (in bash: "lynx http://localhost/manual/")

About permissions, the files need to be readable by everybody ("chmod -R +r /home/httpd/html") for the server to work. I'd suggest you to:
1) create a special group ("groupadd web")
2) add every login who should put files in your web site to that group ("usermod -G web,listOfPreviousAditionalGroups user")
3) change group of html dir ("chgrp web /home/httpd/html")
4) setgid same dir ("chmog g+s /home/httpd/html")

With redhat default permissions you won't have problems sharing web site administration among several users.

About directories: this is a matter of how you feel more confortable with files/dirs. For the web server there's not much difference between html source and images (unless you user an embedded languaje in your pages). Subdirectories may help you to have webmasters with very specific responsibilities...

Good luck
0
 
marcelofrCommented:
Sorry:
4) setgid same dir ("chmog g+s /home/httpd/html") should read: "chmod g+s ..."
0
 
joe_massiminoAuthor Commented:
Thanks for the quick response. I will review the info you have here and see how far it gets me.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
joe_massiminoAuthor Commented:
Go ahead and repost this as an answer.  Thanks
0
 
marcelofrCommented:
enjoy Linux...
0
 
joe_massiminoAuthor Commented:
Can you shed any lite on making my public_html directories work with the proper permissions.  I tried    chmod 644 public_html
but that didn't help me any.  When I browse the linux box, running apachi, I just get the default apachi file, not the users public_html, no matter how I type the URL.  If you like, I can post this as another question.
0
 
marcelofrCommented:
In the default configuration, your web server is running as "nobody" so it needs read permissions in the filesin public_html, also you need "eXecution" permission for "other" in ALL of the subdirectories involved: for joeuser you'll need:

chmod +x /home
chmod +x /home/joeuser
chmod +x /home/joeuser/public_html
chmod +r /home/joeuser/public_html/*

and last but not least, in your /etc/httpd/conf/srm.conf you need the "magic entry: "UserDir public_html".

Given all this conditions and having HUP'ed (killall -v -1 `cat /var/run/httpd.pid`), you can access this as:

http://web.server.com/~joeuser/page.html

Good luck
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now