Solved

Apachi Web Server, where are web pages stored?

Posted on 1998-09-10
7
302 Views
Last Modified: 2013-12-15
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
Comment
Question by:joe_massimino
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:marcelofr
ID: 1630747
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
 
LVL 3

Expert Comment

by:marcelofr
ID: 1630748
Sorry:
4) setgid same dir ("chmog g+s /home/httpd/html") should read: "chmod g+s ..."
0
 
LVL 6

Author Comment

by:joe_massimino
ID: 1630749
Thanks for the quick response. I will review the info you have here and see how far it gets me.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 6

Author Comment

by:joe_massimino
ID: 1630750
Go ahead and repost this as an answer.  Thanks
0
 
LVL 3

Accepted Solution

by:
marcelofr earned 120 total points
ID: 1630751
enjoy Linux...
0
 
LVL 6

Author Comment

by:joe_massimino
ID: 1630752
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
 
LVL 3

Expert Comment

by:marcelofr
ID: 1630753
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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now