LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

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

Rep: Reputation: 0
Question Apache: Change http://localhost to http://www.mywebsite.com


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 http://www.mysite.com.

thank you in advance

sami
 
Old 08-12-2010, 09:47 AM   #2
b0uncer
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:
127.0.0.1    localhost
which you can change to
Code:
127.0.0.1    localhost    www.mysite.com
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 www.mysite.com 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.
 
  


Reply


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 http://www.domainname.com xviddivxoggmp3 Linux - Software 4 04-07-2004 12:14 PM
http://localhost apache matt3333 Linux - Software 16 05-25-2003 02:55 PM


All times are GMT -5. The time now is 07:32 PM.

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