How to change localhost to http://www.yoursite.home
Are you like me and are tired of the boring http://localhost/yoursite then here is a cool way to make it anything you want. Note: You may not want to use .com or .net or one of the popular names because it will interfere with the actual webaddress. Now with that said choose your site name and let's begin.
Steps :
The following setup information is used:
(Obviously change the required information if your setup differs slightly.)
Windows NT/2000/XP - c:\windows (XP) or c:\winnt (NT/2000)
Apache 1.3 or 2.0 - c:\apache group\apache (Apache 1.3) or c:\apache group\apache2 (Apache 2.0)
PHP 4 - c:\php
Website directory - c:\websites
You will need to modify the following files:
(These files can be modified with notepad or wordpad)
c:\windows\system32\drivers\etc\hosts (XP) c:\winnt\system32\drivers\etc\hosts (NT/2000)
c:\apache group\apache\conf\httpd.conf (Apache 1.3) or c:\apache group\apache2\conf\httpd.conf (Apache 2.0)
Add the following to your 'host' file:
CODE
127.0.0.1 localhost
127.0.0.2 www.yoursite.home
NOTE: It's advisable to name your local site with the extension '.home' so it doesn't conflict with an existing domain name on the internet. If you name your local site with '.com' and try to load the real 'yoursite.com' you will get your local site since your computer searchs the 'hosts' file before searching for an internet DNS.
If you have multiple sites, your need to add the next site to a new line.
Example. '127.0.0.3 www.yourothersite.home' (Increment each new websites IP address by 1.)
Add the following to your 'httpd.conf' file:
(You will see information on 'Virtual Hosts' at the end of your 'httpd.conf' file.)
CODE
<VirtualHost 127.0.0.2>
ServerAdmin webmaster@locahost
DocumentRoot c:/websites/yoursite
DirectoryIndex index.php default.php index.fire index.html index.htm default.html default.htm
ServerName www.yoursite.home
ErrorLog logs/www.yoursite.home-error_log
CustomLog logs/ranru.turningbase.home-access_log common
ScriptAlias /cgi-bin/ c:/websites/yoursite/cgi-bin
</VirtualHost>
Restart your Apache service.
(Can be done via to 'Apache monitor' or via the command line.
Command line: 'c:\apache group\apache\apache -k restart' (apache 1.3 or 'c:\apache group\apache\apache -k restart' (Apache 2.0)
That's all! Visit the forum for more help. |