Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To Change the Default Page in Apache

Status
Not open for further replies.

pisth

Programmer
Mar 18, 2003
43
US
Hell0,
I want to remove the defualt webpage which says "Test Page ...If You see this page Apache is installed" when I type in on a Linux machine.

I want to find the location of this file. I tried looking up in the htdocs directory under httpd and all other possibilities. I also gave a find cmd. How do I find the physical location of this index file so that I can change it to my own.

I guess we can also say the page we wanna display when we say " by modifying the httpd.conf file.
WHere and what should be changed. I mean where should we give the directory link.

Thanks!

Karthik.
 
You will need to edit the httpd.conf file and choose a new location for your document root.
 
Hell0,
Thanks for your reply. I do understand and know that I need to change the document root. How do I do it is my question. i.e Should i specify the directory structure?.

Can you give me few lines which need to be changed. Am new to apache and hence not sure. By doing that can i set it to my desired page when i say :
Thanks!

Karthik.
 
You need to have an index.html or htm page loaded anywhere in your directory structure. For example, I have mine set as DocumentRoot "/home/me/html" It will then look into that directory for your index page.
 
Hi,
So, I must just change the Document Root and say :
/usr/local/etc/httpd/htdocs/trial/

and if in the trial directory if i have index.html, you mean to say that by typying that particular index file would be displayed instead of the default one?

However, if thatz the case the default index.html page must be loaded in the htdocs directory right?. However I dont find it there. (My Documentroot looks like this now:/usr/local/etc/httpd/htdocs)

Are you online now?.

My Yahoo ID: pisthbuddy

Thanks!

Karthik.
 
Hell0,
Thanks for your reply. I do understand and know that I need to change the document root. How do I do it is my question. i.e Should i specify the directory structure?.

Can you give me few lines which need to be changed. Am new to apache and hence not sure. By doing that can i set it to my desired page when i say :
Thanks!

Karthik.
 
You will need to load the index.html in the trial directory if you point your DocumentRoot there. The case of your current DocumentRoot, yes the index.html should be in the htdocs directory.
 
Hello,
Thanks again for your reply.

I changed the DocumentRoot in my httpd.conf file. It now looks like this:

DocumentRoot "/usr/local/etc/httpd/htdocs/trial"

There was one more line which was changed

<Directory &quot;/usr/local/etc/httpd/htdocs/trial&quot;

The trial directory has a file by name index.html. However when I stop and restart apache again. I get the same default test page.

What should I do now?

Karthik.
 
You've already stopped and restarted Apache, but have you also refreshed your browser? Also, try changing the index.html in your trial directory to index.htm - I've seen some versions that don't have *.html as one of the default index files for some reason.

Also, what platform are you running Apache on? If windows, your path should include the drive letter. If *nix, you don't need the quotes in your document root path.
 
Hell0,
Thanks!. I figured out what was going on. I already had apache installed on my system(apache 2.0) which comes with Linux. I tried to reinstall apache... 1.27 and i was modifying the httpd.conf file on apache 1.27 insttead of the original httpd file.

Now..everything seems to work...anyways...cgi scripts are not being executed but just displayed. do i need to change anything in httpd.conf directory to execute cgi scripts?

Thanks!

Karthik.
 
another way is to locate your directory that has the page that you want to come up via a file search on your computer.

then copy that directoryt and paste it in the document root, then restart your apache server and you will get the response your looking for..

Max &quot;cyber&quot;

I am new but going through the same proccess that you are so if you are a step ahead please let me know so that we can get up onmy end as well..

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top