I've upgraded my server to a new box, and in the process decided to migrate
from IIS to Apache webserver. Coldfusion works fine without Apache virtual
hosts (ie one webste) but when I setup for multiple sites using virtual hosts,
CF starts acting weird. The server will intermittently send content from the
wrong document root from the other site!
Example: calling up www.domain1.com get you domain2.com's homepage
This is not completely random from what I've found. Usually whichever domain
I call first is the documents CF tries to server up. It's like it's caching
the index.cfm files and won't recognize the virtual hosts. After a while,
I'll call the other domain, and that one seems to in effect become cached
within the CF server. The problem is DEFINITELY within Coldfusion since
calling regular index.htm files results in 100% accuracy. Only when I call the
*.cfm pages does it get confused and start sending from the wrong document
roots.
I dumped my CGI vars and the CF_TEMPLATE_PATH variable seems to get "stuck" in
one docroot. If I call Domain1.com (and the first one's sent correctly) but
then immediately thereafter call domain2.com it'll send the wrong page. Also I
can tell which site's page I'm going to get by looking at the dumped
CF_TEMPLATE_PATH variable even though EVERY other CGI variable points to the
correct virtual host.
How can I fix this? Do I have to spawn 2 Jrun servers (one for each
virtualhost)? Please help ASAP!
I attached my Apache httpd.conf file for virtual hosts:
# www.domain1.com host
<VirtualHost *>
ServerAdmin webmas...@domain1.com
ServerAlias *.domain1.com
DocumentRoot D:\inetpub\wwwroot\domain1_com
ServerName domain1.com
ErrorLog logs\domain1.com-error_log
CustomLog logs\domain1.com-access_log common
#aliases
Alias /cfadmin "D:\InetPub\wwwroot\ColdFusionMX\CFIDE\administrator"
#Alias /mailroot
#Alias /rome
</VirtualHost>
# www.domain2.com host
<VirtualHost *>
ServerAdmin webmas...@domain2.com
ServerAlias *.domain2.com
DocumentRoot D:\inetpub\wwwroot\domain2_com
ServerName domain2.com
ErrorLog logs\domain2.com-error_log
CustomLog logs\domain2.com-access_log common
</VirtualHost>