sábado, 19 de noviembre de 2011

Virtual hosts in XAMPP

Im by no means any sort of expert on this, but the following setup works for me.
in httpd-vhosts.conf, make sure the following line is uncommented.

NameVirtualHost *:80

The set up the virtual hosts:

<VirtualHost *:80>
DocumentRoot "d:/xaamp/htdocs/dev.somesite.com.­ au"
ServerName dev.somesite.com.au
</VirtualHost>

That works for me. I think you also need to define localhost as a vhost as well.

<VirtualHost *:80>
ServerName localhost
DocumentRoot "D:/xampp/htdocs"
</VirtualHost>

You can include per directory stuff as well by using <Directory> For example.

<VirtualHost *:80>
DocumentRoot "d:/xaamp/htdocs/dev.somesite.com.­ au"
ServerName dev.somesite.com.au

<Directory "D:/xampp/htdocs/dev.somesite.com.­ au">
Options Indexes Includes execCGI
AllowOverride None
Order Allow,Deny
Allow From All
</Directory>

</VirtualHost>

Then in the hosts file (from memory, in xp its found at c:\windows\system32\drivers\etc\),­ define hosts like so:

127.0.0.1 localhost
127.0.0.1 dev.somesite.com.au

hth

No hay comentarios:

Publicar un comentario

How To Convert Virtual Machines Between VirtualBox and VMware

Migrating to another virtual machine program can be intimidating. if you already have your virtual machines set up they way you like th...