Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I want to set my Virtual host on Apache 2.2.

So, I can access my site using my IP address and Port number.

Like for one site, for other site and so on.

My machine OS in Windows 7.

I have tried below in my httpd.conf file.


<Directory "Path to project folder">
    AllowOverride All
    DirectoryIndex index.html index.htm index.php index.html.var
    DocumentRoot "Path to project folder"
    ErrorLog logs/Zara.log
    #ErrorLog logs/
    #CustomLog logs/ common

Can you please suggest any thing missing in my configuration.

Thanks in advance


share|improve this question

You will need to specify the different ports you want apache to listen on.

You also need the


Directive specified for each IP:port combination you want to use.

Then setup your VirtualHost definitions.

Have a look at these examples for more info.


Put your <Directory> block inside your <VirtualHost> block

Add the lines

Order allow,deny
Allow from all

within your directory block

If you want you can change these settings globally within httpd.conf, rather than have to specify them on a per-virtual-host basis.

share|improve this answer
Getting this error: client denied by server configuration – Avinash Jun 7 '10 at 12:03
see my edit above. – LukeR Jun 7 '10 at 20:59

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.