Paul asks:
What's a better development environment?When it comes to a development environment, I think most people feel that the best rule is that it should match, as much as possible, the production environment. I don't think it is expected that it would be an exact match. Production would probably be Windows Server 2003 and development would be Windows XP, but you get the idea.For those of us that use a local development environment, is there any advantage to using CF Dev Edition's built-in JRun server, vs. installing IIS on Windows XP and using that?
I just looked at my task manager, and JRun is using a whopping 220 MB of memory, without having been accessed since I booted, completely idle. That's far more than anything else currently running on my system.
With that being said - you should not be using the built-in JRun web server for production. Therefore I'd recommend against it in development as well.
However - IIS is a bit of a pain. Unless you are willing to google and look up a hack, you can't run multiple virtual web servers with IIS under XP. Now if all you work on is one site, that's no big deal. If you are a contractor and work on multiple sites, you really want that multiple server setup. That's why I use Apache (well, I'm on a Mac now so I kind of have to, but even before I switched I used Apache). The only time the difference between Apache and IIS has bit me in the butt is with CGI variables.
Archived Comments
Even if you do decide to use the built in Web server, if JRun is idle it'll just get swapped out into virtual memory and not really cause much of a problem.
I'm also dubious that running the ColdFusion service (which is just an embedded JRun instance) is significantly less than the ColdFusion service + Built-in Web server. It'd be worth a test, but I wouldn't put money on it.
There is a workaround to creating/running multiple websites on Windows XP Pro:
With a GUI:
http://jetstat.com/iisadmin/
Scripting:
http://andreineculau.wordpr...
Windows Vista use IIS and allows multiple web sites.
yeah, IISadmin is a cool tool, but can be a pain if you're working on numerous web sites and have to switch back and forth frequently.
at work, we're on XP on the desktop, so i have to deal with doing that. at any given point on any given day i could be asked to make a tweak to one of several sites, so i'm switching back and forth frequently.
at home i do the apache thing (even though my personal site(s) are on IIS). sure, i'd love to keep the environments as identical as possible, but the sites are fairly basic and i've yet to run into any issues at the web server level.
There's always the Virtual Machine route, too. Where I'm at I have to switch constantly between a current environment and the new version being developed. One runs on Jrun with a thrice-daily updated WAR file and the other is just straight ColdFusion (not even multiserver install). To switch back and forth in the same machine is super-painful, so a VM works great for me.
Unfortunately, unless I want to map out directories (network sharing and such), I have to have Eclipse installed on both VM's...and I never have everything exactly the same, like snippets, etc. Nor is my Firefox install even the same, with plugins, bookmarks.
But it works good enough!
- Will B.
So I was setting up my notebook for development and then realized IIS would only do on e site on XP. Then bingo, find the answer on Ray's blog. You have to love the CF community.
IIS 7 (ships with Vista) allows multiple sites with no hacks.
The caveat for Vista Basic users is that IIS is not installed(able?). Though I probably should install Apache I stuck with the development server.
People really buy Vista basic?
I give a huge vote for the VM route too. We use them on my team and we've found having multiple VM images with different server configurations is a great way to develop for multiple environments. And one huge plus that I like is that unless I actually need the servers up, my computer isn't bogged down by running all the services in the background all day, every day. Makes my PC more reliable and run smoother. It also allows me to simulate a closer client-server setup like the production environment. I user VMWare to save the "state" of each server when I'm done rather than turning it off. What way I can shut down one server and bring another one up in less than 20 seconds.
@Todd: People really buy Vista?
;)
@Ray - What were the differences in the CGI variables? I haven't run into that yet, so it would be good to know in advance...
@Ray
I guess I stepped right into that one...
@Steve- I don't have an exact list. But since CGI stuff comes from the web server, each one does things a bit differently. In fact, that's one reason you can output CGI.RAY in ColdFusion. ColdFusion allows you to use ANY CGI variable since it is so... well variable.
@Ray - Thanks Ray, I figured as much. I haven't had any problems with the basics (server_name, script_name, path, etc), but I figured I'd ask.
BTW, we've gone back and forth enough, you can call me Cutter;)
I've been on Vista with infinitely many IIS sites (our production
environment will shortly be Server 2008) for forever and a day now and
it's worked REALLY well. By far the most stable OS I've ever been on.
Like, I've been in love with it and am contemplating marriage to it.
Granted, I've completely overhauled the look and feel of Vista and
turned off all of the 'aero' stuff, but still. I'm so much happier than
when I was on OS X. That sounds like a joke, but I'm totally serious.
Another quick, random development tip while we're at it is to write a
simple batch file to start or stop all of your disparate 'server'
software automatically.
What that lets you do is boot into your OS without all of the services
starting automatically so that if you work off of a laptop, for example,
you can have those resources freed up for better performance when you're
not developing without having to manually shut them all down after
startup. It's pretty effective for heavy apps, playing Crysis for instance.
Here's an example of one that will launch IIS, CF8, and MySQL (in that
order).
Start.bat contents:
Net Start "IIS Admin Service"
Net Start "ColdFusion 8 Application Server"
Net Start "MySQL"
That's it. Pretty simple but way h-core sweet and a bag of chips you
feel me dawg?
What makes you feel even cooler is creating a shortcut to it in your
taskbar (to make Vista look way mo betta, use TrueLaunchBar) and
swapping out the ColdFusion logo for its icon.
Here's a screenshot:
http://www.fleet19.com/Shar...
+1 for using a VM. And (@Will B) you can easily map drives so that you can use an editor on your host OS to work with the files on the VM: exactly the same as if you were mapping to a physically separate dev server, but with the speed of a local drive.
Only downside is the additional Windows licensing.
One other thing about the VM arrangement that Julian reminded me of. When I first started using VMs, I actually disliked the idea of having my code inside the VM. It meant if I had multiple server arrangements I needed to keep more copies of the code than I wanted. I typically have the code in one spot but need to test against different server setups (that can mirror different customers). Plus, sometimes I just need to check a file w/o firing up the VM and getting all the servers running.
So what I do is keep all the code and my IDE (CFEclipse) on the local PC. Then all my VM webservers have virtual directories that point to the code on my physical PC via UNC paths. I can keep the code in one place (with minimal copies) but load any server I want to run it. I've been using this arrangement for almost a year and have found it to be the most flexible development setup I've ever used. But I know other's mileage will vary.
When developing on an XP box you can just spawn multiple virtual directories under the main site. It's not entirely the same as multiple websites, but I've never had a problem moving my applications.