vignesh
vignesh

Reputation: 1599

Need to change the apache default home page

I am new to apache.I installed apache in my windows, I am having my own html page with css.I want to set this page as my default apache home page and instead of typing http://localhost:8080, i have to type http://vignesh to view my home page. How to do this..Guide me

Upvotes: 0

Views: 12778

Answers (2)

Edurne Pascual
Edurne Pascual

Reputation: 5667

When you type an address in a browser, the browser relies on the operating system to resolve it. Only once it has been resolved, a request is sent to the actual server (in this case, your apache installation).

Because of this, you can't alter how the "server" part is resolved through apache itself: it is your Windows system which handles that and, if appropriate (this is, if it resolves to localhost at the port where your apache is listening), forwards it to apache.

So, you need to alter how Windows, rather than apache, resolves that address. Fortunately, for your situation, it's relatively easy to tweak, if you know what to look for (and I am telling you here, so you know ;) ):

Open the file %SystemRoot%\system32\drivers\etc\hosts on a plain text editor, such as notepad (%SystemRoot% is window's base installation path, such as C:\Windows or C:\WinNT), and add a line like this at the end:

127.0.0.1       vignesh

Upvotes: 0

Ali
Ali

Reputation: 3676

I think your question is split into 2 things: The ability to use http://vignesh as opposed to http://localhost:8080, and the option to change the default home page.

In order to get the url that you want working, you need to modify a file in windows (assuming you're on windows 7) do the following:

  1. Launch notepad (or any other text editor) with administrative privileges
  2. Open the hosts file located at: C:\Windows\System32\drivers\etc
  3. Add the following entry to it: 127.0.0.1 vignesh

In order to change the default page you need to change the apache configuration.

  1. Open httpd.conf in your favorite text editor
  2. Locate the property called DirectoryIndex. Change it to the page that you want.

I hope that was helpful.

Upvotes: 2

Related Questions