We help IT Professionals succeed at work.

How do I run multiple websites with a single ColdFusion install?

Hello,

I am a fairly new web developer and I am running Coldfusion 9 Standard on my Linux CentOS with Apache.  I have 2 websites (domains) I want to host and both will be using Coldfusion Server.  What is the best way to install and configure ColdFusion for each site to work correctly (i.e. use all the features of Coldfusion without overlapping each other or breaking something).  

The install notes say to set the CF web root to a web root of an existing domain ( /var/www/vhosts/mydomain.com/httpdocs), but I fail to see how this would allow ANOTHER domain ( /var/www/vhosts/mydomain2.com/httpdocs) to function correctly.  I thought the CF docs had to be in a folder IN or ABOVE your web root for your site to work.  ?

Perhaps this is better answered in Apache?

Please advise me on how to proceed.  I KNOW this can happen, but I haven't wrapped my head around it yet. :)

Thanks.
Comment
Watch Question

Distinguished Expert 2019

Commented:
You define namehost *

You would then use
<virtualHost *>
ServerName www.somesite.com

</VirtualHost.

<virtualHost *>
ServerName www.somothersite.com

</virtualhost>

This is a name based hosting such that the request  when received by apache will be checked against the ServerName entry and when matched that VirtualHOst will be used to present to the request.  If no matches occur, the default configured virtualhost or the first VirutalHost will be served up as a response to the request.

The information explained below.  If you have 2.0, 1.3 replace the 2.1 in the link with the version of apache you have.
http://httpd.apache.org/docs/2.1/vhosts/name-based.html

as for CF specific info, the only "cf docs" that are required are those within the cfide directory. These docs provide wrappers for some of the scripting tools (ie: cfwindow is a wrapper for ext window scripts) Generally you would just create a virtual directory in each one of your sites to point to cfide. The cfide scripts are "read only" so there's no issue with sharing, unless you want to customize things like css of the cfwindow. In that case you would make a copy of cfide for each site. The docs in the cfusion dir are shared by the application and are meant to handle multiple sites.


The only other thing you need to do is make sure that cfm files are handled by apache's script handler (which the install should do for you)  

Author

Commented:
Yeah, I'm now dealing with an Apache/ColdFusion nightmare.  Apparently this is common, but the CF installer isn't working right, and I can't access '/CFIDE/administrator/index.cfm' no matter where I put it.  It seems that both CF and Apache are working, just not together. :(   Any advice on this?

As far as virtual directories are concerned, what is the best way to create one?  I've been using 'Alias' in the httpd.include for the virtual host (but it warns me not to jack with that file) ?

Author

Commented:
Ok.  Nightmare is over.  Apparently, it was a directory permission issue.  had to chmod -R 777 . the 'httpdocs' directory where the administrator was.  :/

Still could use a little guidance on the virtual directory thing tho. :)
Distinguished Expert 2019

Commented:
Double check whether you need to have the permission to be 777 versus 755.