LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache won't display files in DocumentRoot (https://www.linuxquestions.org/questions/linux-newbie-8/apache-wont-display-files-in-documentroot-280546/)

PiGuy 01-21-2005 11:58 AM

Apache won't display files in DocumentRoot
 
Hi,
I've installed Apache 2.0 successfully on Mandrake 10.1, but now I can't get it display any files in the Document Root. All I get is a standard welcomes/test page saying, "Congratulations! The Web Server software on this system is operational. If you're the webmaster of localhost, you may now add content to this directory and replace this page. " and so on. Do I need to finish configuring something first?

damicatz 01-21-2005 12:04 PM

Re: Apache won't display files in DocumentRoot
 
Quote:

Originally posted by PiGuy
Hi,
I've installed Apache 2.0 successfully on Mandrake 10.1, but now I can't get it display any files in the Document Root. All I get is a standard welcomes/test page saying, "Congratulations! The Web Server software on this system is operational. If you're the webmaster of localhost, you may now add content to this directory and replace this page. " and so on. Do I need to finish configuring something first?

If you are using the default document root (should be some thing along the lines of /var/www/localhost/htdocs for Linux) you'll need to remove the standard index pages that come with Apache.

PiGuy 01-21-2005 12:06 PM

I've done that, and replaced it with my own index.html. When that didn't work I've now moved it to a different location and it still shows the same thing. I can't figure out where this thing is stored.

damicatz 01-21-2005 12:15 PM

Quote:

Originally posted by PiGuy
I've done that, and replaced it with my own index.html. When that didn't work I've now moved it to a different location and it still shows the same thing. I can't figure out where this thing is stored.
Have you tried restarting the Apache Webserver? Configuration changes in the main config files require a restart.

I don't know how Mandrakes Init Scripts Work but you should be able to restart Apache with the following command for now :

killall apache2 && sleep 5 && apache2

PiGuy 01-21-2005 12:17 PM

okay, I got it working by deleting the files in the /var/www/html directory... why is this the main dir, and why does Apache tell me its in /usr/local/apache2/httpd? And now how can I change the DocumentRoot from /var/www/html to whatever I want?

damicatz 01-21-2005 12:21 PM

Quote:

Originally posted by PiGuy
okay, I got it working by deleting the files in the /var/www/html directory... why is this the main dir, and why does Apache tell me its in /usr/local/apache2/httpd? And now how can I change the DocumentRoot from /var/www/html to whatever I want?
There should be an Apache configuration file. It looks like Mandrake may have a different default configuration for Apache than other distros as normally with Linux the default DocumentRoot is in /var/www/hostname/htdocs

As for your question, it is common for programs on *nix based systems to store their files in different directories as each directory on the root partition has it's own purpose.

/usr/local/apache2/httpd refers to the daemon itself.

If you wish to change the DocumentRoot you can edit your apache configuration file. The name is apache2.conf and it should be somewhere in your /etc directory. Try looking in the /etc/apache2 or /etc directories and if apache2.conf doesn't exist do this :

find /|grep apache2.conf

comprookie2000 01-21-2005 01:33 PM

Mine is in /etc/apache2/commonapache2.conf.I'm using gentoo,took me forever to change it!I kept changing /etc/apache2/apache2.conf but the same page came up,it was driving me nuts.


All times are GMT -5. The time now is 05:00 AM.