Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-12-2010, 09:39 AM   #1
LQ Newbie
Registered: Jun 2010
Posts: 19

Rep: Reputation: 0
Question Apache: Change http://localhost to

Hi all

Ive used apache as my webserver,and when i insert http://localhost its displays the apache index webpage which i assume its working.

My problem now is how to change the url http://localhost/mysite to

thank you in advance

Old 08-12-2010, 09:47 AM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
One way is to modify your /etc/hosts file. It has (should have) the line
Code:    localhost
which you can change to
Code:    localhost
After saving, if your server is running, type the address and it should go there (works here).

Just remember that because it's configured locally, your friends won't be able to do that. If you want it to be global, buy a domain name for your server.

Edit: to be clear, after that change ought to point to your www root directory, which is accessed at http://localhost.

Last edited by b0uncer; 08-12-2010 at 09:51 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache: http://localhost (work) http://ipaddress (not working) sarmad Linux - Newbie 7 02-05-2013 08:47 AM
Apache VirtualHost - http://www. problem gooddesi Linux - Server 5 04-29-2007 10:57 PM
apache http://localhost/mysite ---> http://localhost/mysite/index.php how? ilnli Linux - General 8 06-04-2005 04:23 PM
apache and xviddivxoggmp3 Linux - Software 4 04-07-2004 12:14 PM
http://localhost apache matt3333 Linux - Software 16 05-25-2003 02:55 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:13 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration