We were recently discussing setting up development environments in the #coldfusion channel on DalNet IRC. This is a discussion that pops up form time to time, so I figured I would share how I set up my development environment.
I use Apache for my development web server, and for each project, I set up a new 'virtual host' so that each project can run form its own web root. I really have no good explanation for doing this other than its the way I like running my projects. I give each project a 'serverName' like blog.dev. This just helps me be aware of whether I am on dev or production, and makes it so I have to type less.
Then I set up a new entry in my HOSTS file for blog.dev and point it to 127.0.0.1.
To make editing httpd.conf and HOSTS easier to edit, I set up a project in Eclipse that points to my {apache root}/conf folder. Inside of that project, I create a linked file to my HOSTS file. Now from within Eclipse, I can edit my httpd.conf file and my HOSTS file.
I typically will structure my project so that I have a structure that looks similar to:
{projectRoot}
flex-src (if its a Flex project)
support (this is where I put project documents, associated files, artwork, etc)
wwwroot this is the web root for my project, and where I point Apache to)
Obviously, as the project dictates, I will add other sub-directories. Also, when using SVN, {projectRoot} will typically be the 'trunk' of the repo.
So, how do you set up your development environment?
UPDATE: Someone asked in the comments for a way to restart Apache from inside Eclipse, well, thanx to Ant, that is very easy. I attached an Ant file to this entry, you can get it from the 'Download' link below. Drop this in your {apache root}/conf folder and when you want to restart Apache in Eclipse, right-click the file and choose 'Run As.. --> Ant Build' . You may need to change the name of the service. DISCLAIMER: This is offered as is and I make no warranties. Offer void where prohibited.