jkcrosby3
jkcrosby3

Reputation: 39

ColdFusion 11 Standalone Internal Webserver multiple websites

(I'm not getting any feedback from Adobe ColdFusion Install Tech help or Adobe ColdFusion Forum. I'm hoping I'm just not asking correctly and that it is not that no one knows the answer).

We are upgrading from CF9 to CF11, so I've installed CF11 as a standalone with an internal web server. Since we are not using an external webserver like IIS, and we have 4 different websites to configure, in order to not change all (or at least some) the webpage code to point to a different level and so that it can be found, do I have to do this with Virtual Directories [i.e. I have copied all CF9 code (4 different websites) and just added _CF11 to the end of the main website folder names, i.e. website1_CF11 and an aliases have been created for these websites, i.e. aliases=”/alias1=E:\website1_CF11, etc…”]?

Can multiple VD be created? How are they defined? One VD is defined as

<Context
            path="/" 
            docBase="C:\ColdFusion10\cfusion\wwwroot" 
            WorkDir="C:\ColdFusion10\cfusion\runtime\conf\Catalina\localhost\tmp"
            aliases="/VD=C:\newwebroot\VD">
</Context>

How would I create more than one? Is this what I need to do to accomplish my goal of getting my webpages to see the directory structure at the correct level?

I currently have something like the following for my server.xml:

<Context
                Path=”/”
                docBase=”D:\ColdFusion11/cfusion/wwwroot”
                WorkDir=”D:\ColdFusion11/cfusion/runtime/conf/Catalina/localhost/tmp”
                Aliases=”/CFIDE=D:\ColdFusion11\cfusion\wwroot\CFIDE,
                                /WEB-INF=D:\ColdFusion11\cfusion\wwwroot\WEB-INF,
                                /website1=E:\website1,
                                /website2=E:\website2,
                                /website3=E:\website3,
                                /website4=E:\website4”>
</Context>

I can put

/VD=E:\website1,

into the above code and CF admin works, but I guess I'm a little fuzzy as to what exactly virtual directories are supposed to do. I thought it was essentially an alias for the ip address of a web address, or hostname.

But am I understanding correctly that it just allows a website to point to a different folder location that isn't in the wwwroot path? What I want is for each website I have to be able to point to that root folder for that website. I want the following for each website so the code works properly:

For website1:       http://localhost:8500/index.html
For website2:       http://localhost:8501/index.html
For website3:       http://localhost:8502/index.html
For website4:       http://localhost:8503/index.html

Right now aliases are not going to work, because that would be pointless and time consuming changing all the code just so it can find all the web pages so we can test functionality and fix the breaks. For example, I currently need to change the code to the following:

<cf_location url=”#URLSessionFormat(‘/webpage/’)#” addtoken=”false”>

To

<cf_location url=”#URLSessionFormat(‘/alias1/webpage/’)#” addtoken=”false”>

We are eventually going to run the wsconfig executable to connect to IIS so we can fully migrate from CF9 to CF11. What am I missing? I can’t imagine that Adobe would not have the same functionality with their internal web server as one would have with an external web server. We don't have enough resources to put CF9, CF11, and IIS on a separate machine to test out direct migration without the side-by-side installation of CF11.

Upvotes: 1

Views: 1214

Answers (2)

user1237187
user1237187

Reputation: 16

I'm not sure if this will help you, but I kind of have this same issue. I got tired of having different requirements on my dev environment and the live server, and I didn't know what kind of options existed with regard to what you're asking above. Instead of digging in and finding a solution within the options of server.xml, I made a different server.xml for each of my dev sites, with the root folder pointing to the appropriate site. So website1 had a website1.xml, website2 used website2.xml, and each different .xml file pointed to it's corresponding webroot.

Once I had all the xml files, I created a batch file that would accept the server name, delete server.xml, copy websiteN.xml to server.xml, and restart the CF application server. Then I made a shortcuts for each site with it's name, so when I need to work on website1, I click on website1, and it launches my CF server for that website. I updated my host file to point to 127.0.0.1 for www.website1.com, and changed the dev port to 80 (which I'm not sure works with CF11). This creates a nearly exact dev environment for me, which is what I was after.

Here is the batch file code:

ECHO OFF

cd c:\ColdFusion10\cfusion\runtime\conf\
DEL server.xml
COPY %1%.xml server.xml

net stop "ColdFusion 10 Application Server"
net start "ColdFusion 10 Application Server"

And the shortcuts all point to the same batch file, and just pass in the appropriate website name, which corresponds to the [website].xml file that is copied over. So the target of the shortcut is: C:\path\to\batch\cfserver.bat website1

As long as you aren't constantly switching back and forth all day in your regular development duties, this should do the trick. If I had to change the server 10x a day, this would be really annoying, but since it's usually 2 or 3 at the most for me, this solved the problem that you are describing for me.

Upvotes: 0

Adam Cameron
Adam Cameron

Reputation: 29870

The internal web server is just intended for dev, and is not fully-featured. If you want a fully-featured web server... use one! If you don't want to mess with IIS, just install Apache.

That said, you could work around your issue by simply running multiple CF instances, each of which has its own internal web server.

Upvotes: 2

Related Questions