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

Apache + Linux RedHat 6.0

I'am trying Apache in Linux RedHat.
I have a strange problem.

Apache works fine, except for one thing:

I'am starting the server like this:
/usr/local/apache/httpd/src/httpd -f /usr/local/apache/conf/httpd.conf

In the httpd.conf I have:
ServerRoot "/usr/local/apache/htdocs"
IndexRoot  Index.html

But when the server starts
The WebServer starts from to /home/httpd/html/index.html

I try to start manually (so I'am sure I use the correct httpd.conf file, but the problem persist)

How can I check where Apache is taking this path as the default directory?

Any other ideas?

1 Solution
Server root tell apache, where to write log files etc.. (like /usr/local/apache).
You must use DocumentRoot to tell apache where html docs are.
You must also use DirectoryIndex instead of IndexRoot.

ServerRoot /usr/local/apache
DocumentRoot /usr/local/apache/htdocs
DirectoryIndex index.html

PampaAuthor Commented:
I already have this variables pointing to the correct directory.
ServerRoot /usr/local/apache....

But the program keep on going to "/home/httpd/html/index.html"

How can I check why is doing this?
I'am sure I'am using the correct httpd.conf....
Did you reinstall your Apache? If so, make sure your /etc/rc.d is not calling the previous Apache, that is configured to the other path. It happened to me once. :)
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Also, make sure there are not multiple DirectoryRoot entries in the httpd.conf file.  And what does linuxconf show?  When you run linuxconf, what does it say under Apache Web Server...Defaults for DocumentRoot?
It is the srm.conf that you need to edit, and replace the directory in the DocumentRoot section with your preferred directory and the DirectoryIndex section with your preferred start page. Then start the apache server.

In your srm.conf file:

DocumentRoot /usr/local/apache/htdocs
DirectoryIndex index.html index.shtml home.html

Good luck!

The srm.conf file is deprecated. If it actually contain something that could be annoying you, you should consider cleaning this file and configuring everything on httpd.conf.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

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