I use VertrigoServ as my Apache - MySql - PHP stack.
Up till now, I used to put all sites in the /www folder and access them by the url http://localhost/sitename
.
Now I'm developing a multilanguage site. The site's idiom will be set according to the domain. So I need to set up a virtual host for this site, but I need to still have access to the other sites using the localhost url.
I added the following code to conf/extra/httpd-vhosts.conf:
NameVirtualHost *:80
<VirtualHost dev.mysite.com.br dev.mysite.uy>
ServerAdmin admin@mysite.com.br
DocumentRoot "C:\sites\mysite"
ServerName dev.mysite.com.br
ServerAlias dev.mysite.uy
</VirtualHost>
My default localhost root folder is C:\sites
An example of the httpd.conf used by VertrigoServ can be seen here, and this and example of the vertrigo.conf file.
With this config, I need to put a copy of vertrigo.conf inside C:\sites\mysite\conf
.
Yet, after this is done, a request to http://localhost
serves the site specified by this VirtualHost.
So, how can I use virtual hosts and still access older projects the old way? If I could avoid copying vertrigo.conf, it would be good!
Thanks!
Well, I don't know exactly how I solved this but it worked.
I added the following to the end of the file conf/extra/httpd-vhosts.conf
:
<VirtualHost dev.mysite.com.br dev.mysite.uy>
ServerAdmin admin@mysite.com.br
DocumentRoot "C:/sites/mysite"
ServerName dev.mysite.com.br
</VirtualHost>
Then I 'Shutdown and exit' VertrigoServ and executed it again as Windows administrator.
It seems VertrigoServ has a default configuration (localhost) for anything that is not in a VirtualHost.