Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Apache Server IP address is and the Domain Name is test.local.

How can I accomplish this?

share|improve this question
up vote 5 down vote accepted

What you want to do is name-based virtual hosting, so something along these lines might get you started, I believe:

NameVirtualHost *:80
<VirtualHost *:80>
  <Location />
  Order deny,allow
  Deny from all
  # other configuration for default host...

<VirtualHost *:80>
  # This is the one you would like visible
  ServerName test.local
  <Location />
  Order deny,allow
  Allow from all

(I'm in a bit of a hurry, so there might even by typos in there, sorry.)

share|improve this answer
I suggest adding an explicit _default_ VirtualHost entry. – gertvdijk Dec 20 '12 at 14:17

Your Answer


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.