LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 08: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, 08:47 AM   #2
b0uncer
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:
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 08:51 AM.
 
  


Reply



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 07:47 AM
Apache VirtualHost - http://www. problem gooddesi Linux - Server 5 04-29-2007 09:57 PM
apache http://localhost/mysite ---> http://localhost/mysite/index.php how? ilnli Linux - General 8 06-04-2005 03:23 PM
apache and http://www.domainname.com xviddivxoggmp3 Linux - Software 4 04-07-2004 11:14 AM
http://localhost apache matt3333 Linux - Software 16 05-25-2003 01:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:08 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration