Here's an extract from my Apache2 config:
# # Use name-based virtual hosting. # NameVirtualHost *
# # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. #
# Two slabs dev server <VirtualHost *> DocumentRoot c:/Apache2/Apache2/htfarcry/twoslabsdev/www ServerName 2s-dev.mine.nu ServerAlias 2s-dev.mine.nu *.2s-dev.mine.nu Alias /farcry c:/Apache2/Apache2/htfarcry/farcry_core/admin </VirtualHost>
# localhost for CFadmin etc <VirtualHost 127.0.0.1> DocumentRoot c:/Apache2/Apache2/htdocs ServerName localhost Alias /cfdocs c:/Apache2/Apache2/htdocs/cfdocs Alias /CFIDE c:/Apache2/Apache2/htdocs/CFIDE </VirtualHost>
If the requested host doesn't match any of your VirtualHost entries Apache will use the one at the top of the list.
It's a good idea to ensure that the CFIDE and cfdocs mapping is only on the localhost virtual server mapped to 127.0.0.1 if you are running coldfusion or anything else you only want available locally.
With this setup you can still access the cfadministrator using http://localhost/CFIDE/administrator and cfdocs, but because you've lost your CFIDE publicly you've also lost dynamic charting. You can easily add an Alias just for charting if you need to.
To test out your virtual hosts, just add some entries to your windows/*nix HOSTS file mapping a domain to 127.0.0.x
For example with the above config, I also have the following in %windir%\system32\drivers\etc\hosts :
127.0.0.1 localhost 127.0.0.2 2s-dev.mine.nu
If you set both to 127.0.0.1 then apache would always serve the last entry, as apache matches IP then Hostname from its config file.
If you add more sites you can keep with the .2 ...
The trick is to keep the protected directories on the localhost server and out of the public server. You need the IP restriction because somebody could easily forge the "Host:" header as "localhost" and get access to cfadmin, etc....
HTH
And yep, sure does shit all over IIS :)
- tim
Jeremy spoke the following wise words on 27/10/2003 12:42 PM EST:
Hey Man,
Thanks for the GUI. I have been doing it old school I'll have a look at it. I think it will be hell easier. So long as I can still setup virtual hosts.
Thanks again.
So far it shits all over IIS.
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
