NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need virtual host Apache help ...

max goldberg max at idsociety.com
Thu May 22 09:58:41 EDT 2003


To specify a port to listen to multiple ports, you have to do two things
 if I am remembering correctly. The first is find the line that says
'Listen 80' and change it to 'Listen 80 81 82' etc. Then on each
<VirtualHost *> tag you can do <VirtualHost *:80> etc. Another solution
would be to follow John Lacey's suggestion but use host based vhosts.
You could add a line in your hosts file for each site, and then just use
http://site1/ and http://site2/

The hosts file should be in /etc/hosts or in your windows directory.
If you wanted to do it this way you would add lines like this:

127.0.0.1  site1
127.0.0.1  site2

You can name them whatever you like (as long as they are legitimate host
names)

-Max



Jon Baer wrote:
> Im trying to setup my laptop to host 5 different PHP-based sites for dev
> purposes and getting lost on how to setup Virtual hosting so that it's port
> based w/Apache (I can't remember if it could do it or not or if it was
> another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc.
> 
> <VirtualHost *>
> ?
> </VirtualHost>
> 
> Any ideas?  I just would like to not edit httpd.conf every time.
> 
> - Jon
> 
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 




More information about the talk mailing list