About six months ago, I started playing around with Ubuntu Server (14.04 Trusty Tahr), apache (2.4.7), and CF Server 11 on a home network; just for playing around with. I broke it a few times (thankfully in a VM, so trashing it and starting over or using backups helped), but I finally got it working.
However, when I originally set it up, I had it set so that there were no virtual hosts, and everything was being served from /var/www/html directory.
Now, I'm trying to change that. I've followed instructions on how to set up virtual hosting on apache, and am now setting up two accounts (so pages will be served from /home/usera/public_html and /home/userb/public_html), which brings me to my question.
Do I need to do anything in CFAdmin for these virtual hosts? Or will CF Server use the apache configurations to provide server-side scripting automatically to the virtual hosts? I did test one virtual host with an index.html file, and it works. I should try with PHP just to make sure. I have not yet tried with a CFM file (it was late, I was tired, sleep won the argument.)
Well, there would be nothing in the CF Admin, no. And Apache should be able to send requests for both vhosts to CF, at least conceptually.
You may have challenges based on how you have the apache config. Just pay close attention to how you have things working, as-is (maybe even save off a copy of the conf files), and then when you create the new hosts, compare how things were configured before to how they are configured now, with respect to how the CF handlers and such are setup (you may find them configured for one vhost by default, and need to either duplicate that to the other, or reconfigure the apache conf so that the CF config lines are applying to all vhosts instead of any one.)
I will admit I don’t get into setting up Apache nearly as much as IIS, so there are some nuances I’ll admit I don’t understand, but I have seen enough to be at least reasonably proficient “in the language”, so if you try things and they fail, and no one else has a thought, I may still be able to help.
You will also find that many have written in the web about their exploits over the years with getting various forms of Apache configuration to work with CF. Just to be cognizant that CF10 and 11 are on Tomcat, of course, and use a tomcat web connector (mod_jk.so), versus CF9 and earlier which were on JRun and used a mod_jrun.so. So when reviewing old resources, do pay attention to which CF version they were written for, and do be sure to pay attention not only to that file name difference, but any other possible difference in the config lines.
Thanks, @firstname.lastname@example.org. I _think_ I have apache configured correctly. At least the test index.html works. I am going to go by the assumption that the Linux CF install will be correct upon boot because the installation of CF on Ubuntu asks for where the config, control, and bin files are for apache. Since I'm a total n00b to Linux, I can't say for sure. But theoretically it makes sense. I just wanted to see if anyone in the Adobe forums has done anything like this.
I assumed, also, that since the first step after installing CF Server is to run the configurator that there might be a need to re-run the configurator. I'm keeping my fingers crossed that it's not going to be too complicated. I know just enough CFAdmin to be dangerous.
I did do a very brief Google search for this, and maybe I'm not using the right keywords ("apache" "ColdFusion" "change home directory"). Not much appeared that I found useful. No step-by-step instructions, anyway.
Thank you, sir, much appreciated. I'll report back if I run into any issues.
Well, again, yes, I’m agreeing that the out-of-the-box install of CF and its configuration of Apache may be fine for the single vhost setup, but not for multiple. I’d suggest you add search terms like vhost, virtual host, or even multi-homing to your searches to perhaps find more from others.
BTW, if this is CF 10 or 11 it is likely you will in fact need to reconfigure the web server connector after installation, in that you will need to apply the latest CF update beyond what the installer includes, and in most such cases the technote for the update indicates a need to reconfigure the connector (which means doing a remove and add back of the connector with the wsconfig tool).
And that’s in fact another area for potential hassle: if the default install of CF configures the Apache setup one way (for one vhost) and you tweak the Apache conf files to work as you want, and then you remove/add back the connector, it will likely reconfigure the Apache conf files as per CF’s expected default setup, which may mess up your customization.
Again, this is why I recommend you do strive to find someone with more specific experience in case they may be able to lend some wisdom here. Sorry I can only kind of Monday-morning-quarterback the situation.
Well, I did test both of my virtual hosts with .html, .php, and .cfm documents. All three on both virtual hosts worked, with no further configuring beforehand. So, unless I'm missing something, it appears as though the CF pointing to the apache config, control, and bin directories will use whatever config changes were made to "dev.domaina.com.conf" and "dev.domainb.org.conf" files. I have _NOT_ tried to get this to work with SSL (I have to create a CA and add it to the browser trusted root - and I don't know how to make a CA.)
So, for now, it seems to be working. If I run into any more issues, I'll re-open this.
Good to hear.