LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache: Change http://localhost to http://www.mywebsite.com (http://www.linuxquestions.org/questions/linux-server-73/apache-change-http-localhost-to-http-www-mywebsite-com-825783/)

mlandvo 08-12-2010 08:39 AM

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

b0uncer 08-12-2010 08:47 AM

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.


All times are GMT -5. The time now is 07:06 AM.