First of all, for these things don't use "localhosts" but virtualhosts.
In the apache config you can create virtual hosts.
Apache 2.2:
http://httpd.apache.org/docs/2.2/vhosts/
Apache 2.0:
http://httpd.apache.org/docs/2.0/vhosts/
In the apache config you add:
code:
NameVirtualHost *
If you want him to listen at all IP's you have.
Then for the vhosts, add this:
code:
<VirtualHost 123.123.123.123>
ServerAdmin webmaster@host.foo.com
DocumentRoot /www/docs/host.foo.com
ServerName host.foo.com
ErrorLog logs/host.foo.com-error_log
TransferLog logs/host.foo.com-access_log
</VirtualHost>
and for the second one
code:
<VirtualHost 123.123.123.123>
ServerAdmin webmaster@host.foo2.com
DocumentRoot /www/docs/host.foo2.com
ServerName host.foo2.com
ErrorLog logs/host.foo2.com-error_log
TransferLog logs/host.foo2.com-access_log
</VirtualHost>
You should adapt these things to your own settings, like the IP.
If you want to create "localhost2" you can edit your hostsfile.
In Windows XP this is located at
c:\WINDOWS\system32\drivers\etc\hosts
Normally it would look like this:
code:
127.0.0.1 localhost
Change it to
code:
127.0.0.1 localhost
127.0.0.1 localhost2
Should work. Good luck!