Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hi Everyone
So I have xampp running, localhost or 127.0.0.1 will take me to htdocs within my xampp folder. Is there a way I can use a similar name such as localhost2 on the same machine to take me to folder, lets say its called localhost2, within htdocs.

The reason I am asking this is because I think I have some redirect issues. I am trying use bromine and apparently it only works needs to be at the root; however, I have other things in root, and I know there will be issues with rewrite + cake + normal folders. So i guess my work around (other than trying to fix the main rewrite issue) is to try to create a shortcut, or subdomain or something to folder I am trying to get to.

I am sure there is a better word for all of this, but I am no server admin! I hope that makes sense. Thanks!

share|improve this question

1 Answer 1

up vote 3 down vote accepted

XAMPP uses Apache, right?

Yes, it's possible.

There's two things you'd need to do:

  1. Add "localhost2" to the /etc/hosts entry for localhost (if it's not there, simply add "127.0.0.1 localhost localhost2"). I'm assuming Unix of some sort. If it's Windows there's ways to do the same thing.
  2. Add a virtualhost for localhost2 to the apache configuration (pointed at the other directory).
share|improve this answer
2  
Yep. Normal virtual hosting will make the website work, and when you're doing something local (to the machine you're using) or temporary and don't need DNS, you can just add entries to the /etc/hosts file. Note that you can also use something like: echo >> /etc/hosts "127.0.0.2 localhost2", if you need a seperate IP from localhost. You might need it, for instance, if you're testing SSL. –  Lee B Oct 27 '09 at 21:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.