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
    ServerAdmin webmaster@dummy-host.example.com
    DirectoryIndex index.html index.htm index.php index.html.var
    DocumentRoot "Path to project folder"
    #ServerName dummy-host.example.com
    ErrorLog logs/Zara.log
    #ErrorLog logs/dummy-host.example.com-error_log
    #CustomLog logs/dummy-host.example.com-access_log common

Can you please suggest any thing missing in my configuration.

Thanks in advance



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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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