How to change localhost to another name?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
azhan
Forum Commoner
Posts: 68
Joined: Fri Jun 27, 2008 6:05 am

How to change localhost to another name?

Post by azhan »

hey guys,

How to change the localhost to another name? like this...http://virtual/admin.html.....

Im Using Xampp for the database....

I tink there is a folder containing a file like word pad that could add up localhost name....

anybody can help?

Thanks

Azhan
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: How to change localhost to another name?

Post by onion2k »

It's called the host name. If you want to add another then you need to add a new vhost to Apache, and then redirect all calls to it to Apache using your hosts file.

Examples of vhosts: http://httpd.apache.org/docs/2.0/vhosts/examples.html
Location of your hosts file: http://en.wikipedia.org/wiki/Hosts_file

This assumes you're using Apache as your local webserver obviously.

EDIT: Actually, thinking about it, you probably only need to add it to the hosts file if all you're doing is copying localhost. If you wanted it to have a different document root or something you'd new a vhost though.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: How to change localhost to another name?

Post by VladSun »

Edit: As onion2k said, edit your hosts file in \WINDOWS\System32\drivers\etc folder)
There are 10 types of people in this world, those who understand binary and those who don't
azhan
Forum Commoner
Posts: 68
Joined: Fri Jun 27, 2008 6:05 am

Re: How to change localhost to another name?

Post by azhan »

okay.....i found it already....thanks u guys!

appreciate it! :lol:
Post Reply