Help - Search - Members - Calendar
Full Version: Apache Help!
Linuxhelp > Support > Technical Support
Wickedinterface
Hi i just did a search here and fouund nothing on apache in the forums. I get the test page on the local host but i am stuck on how to change it. I have RTM and i am still stuck so any help is appreciated
hughesjr
You have a default html root directory as part of the install...you should always tell us your distro and program version (ie RedHat 9, httpd-2.0.40) so we can be more specific with the help answers...

Depending on the Linux distribution you installed and the way you installed apache (default package from the distro or built from source) that directory can be located many places...

You can tell where the default html root directory is by searching for this in your httpd.conf file ... which can also be in many places.

inside your httpd.conf file look for this variable:

DocumentRoot

My httpd.conf (located in /etc/httpd/conf on my installation) says this:

DocumentRoot "/var/www/html"

So for me, my html files are in the /var/www/html directory ... the test page you see is the page named index.htm or index.html in the /var/www/html directory.
cagey cretin
Same problem here:

RedHat 9.0
Apache 2.0.48

I took the defaults:

serverroot = "/usr/local/apache"

documentroot = "/usr/local/apache/htdocs"

Any help you could give...

I did have it working yesterday, though I had to put it in a different directory: "/var/www", because the testpage says that Apache prepends/appends the file name. But then Mozilla wouldn't start, so I chucked the whole thing and reinstalled RedHat, recmpiled Apache, etc.

Today, I can't get squat. Please put me out of my misery...

Thank you,

Joe Wilk
cagey cretin
Updated Sunday 8:00 am est...

Yeah, well. I put the docs in "/var/www", and you can see them. The documentroot is still "/usr/local/apache/htdocs". That makes zero sense to me. Can anyone explain that? I don't see how the documnentroot has anything to do with where the documents actully reside. huh.gif

Also, what is going to happen when I set up virtual servers? What are their literal paths going to be?

Thanks for taking the time to read...

Joe Wilk
hughesjr
DocumentRoot is where the documents go for the main server ... it is the root directory of your webserver.

It is possible that you can change that by turning on vitrual directories and using things like http headers.

As to why you see things from /var/www/ instead of /usr/local/apache/htdocs ... there are several explainations (other than you may have setup a virtual directory)...

1. You have apache installed both as an rpm and compiled by you. If you did this, there will be an auto start script that starts the rpm version of apache. The default location of the html directory for rpm installed version is /var/www/html.

2. You may have a logical link from /var/www/ to /usr/local/apache/.

3. You may have installed a package (like oracle database server, for one) that has it's own version of apache included as part of the install ... and that may be starting and using the /var/www/ directory.

Reguardless .... if you have a DocumentRoot variable in a valid httpd.conf from an Apache web server that is started, that is where the main files for that server go.
--------------------------------------
Do this command to see if you have httpd installed as an rpm as well as the compiled version:

rpm -qa | grep httpd

also do this command to see if you have more than one httpd.conf file...

find / -name 'httpd.conf'

look at the file /etc/init.d/httpd and see if it is pointing to a different httpd.conf than the version you compiled,
cagey cretin
[quote]Hughesjr:
  • Do this command to see if you have httpd installed as an rpm as well as the compiled version:

    rpm -qa | grep httpd
[/quote]

Yep. I have a 1.x from RedHat in there too. cool.gif

[quote]Hughesjr:
  • also do this command to see if you have more than one httpd.conf file...

    find / -name 'httpd.conf'
[/quote]

Yup. There are two. cool.gif

[quote]Hughesjr:
  • look at the file /etc/init.d/httpd and see if it is pointing to a different httpd.conf than the version you compiled,
[/quote]

Cha-ching!! biggrin.gif Indeed it is.

Thank you so much for showing me where to look, and what to look for, HughesJr. I really appreciate the help, both here and on an earlier issue a few months ago. biggrin.gif
Joe Wilk
hughesjr
Glad to help! ... this one is from personal experience! I had a production server that went haywire after the installation of Oracle ... I had 2 different versions of apache on the server where I thought there was only one...

good luck with the rest of the setup...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.