1

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 http://192.168.101.111:429 for one site, http://192.168.101.111:420 for other site and so on.

My machine OS in Windows 7.

I have tried below in my httpd.conf file.

Listen 192.168.101.83:82
#chaffoteaux

<Directory "Path to project folder">
    AllowOverride All
</Directory>
<VirtualHost 192.168.101.83:82>
    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
</VirtualHost>

Can you please suggest any thing missing in my configuration.

Thanks in advance

Avinash

2

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

You also need the

NameVirtualHost

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.

edit

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.

| 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 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.