Apache Configuration Tip

  • Post author:
  • Post category:Uncategorized

I was setting up my dev environment again on my laptop (really, starting over and redoing things…long story). Anyway, I like to use Apache with ColdFusion locally, and then setup named virtual hosts for all of my projects, like this:http://localhost/
http://cfquickdocs/
http://blog/
It’s really handy. Well, Apache made some changes in the config file that tripped me up a bit. Normally I go into the http.conf file, and look for <VirtualHost, and then copy their example. Well, in this version of apache (version 2.2.8), they have moved things around a bit. It looks like they have allowed you to separate things out of the main config file, and put virtual host configurations in the /conf/extras directory. Well, I didn’t really like this because I don’t mess with Apache very much, and the next time I need to edit virtual host configs down the road, I might not find them (if they aren’t in the main http.conf file). So I decided to put the virtual host definitions in the main file anyway to see if it would work. At first it didn’t work, my attempts to go to http://cfquickdocs/ just went to the default root site. After some digging around, I found out that you have to move the “NameVirtualHost” directive to the main http.conf file as well. They had moved this into the /conf/extra/httpd-vhosts.conf as well, so I just copied it to the main conf file, and after an Apache restart, all worked as planned. 🙂