Adding Virtual Hosts without Restarting Apache

Posted on in For Geeks Only

We had a requirement of setting up an Apache 2.2 / ColdFusion 8 web server that could have virtual hosts added throughout the day without any disruption to running pages.  Initially it looked like an Apache graceful restart would be a fine solution for this.  However, what we ended up finding is that any running ColdFusion pages actually received a”JRun Connector Protocol Error” message.

We confirmed that this issue existed by creating a ColdFusion page that outputted a message every second (using CFFLUSH to make it outputted to the screen).  While this was running we then ran “kill -SIGUSR1 `cat /var/run/`” and received the following message:


Server Error
The server encountered an internal error and was unable to complete your request.
JRun Connector Protocol Error.


It turned out that the solution was to use VirtualDocumentRoot instead of just the plain old DocumentRoot setting for a single virtual host.  This allowed specifying the $0 variable as part of the value.  So we ended up being able to have “VirtualDocumentRoot /somedir/$1”.  More information about using this solution can be found at the following URL:

Leave a Reply

What our clients are saying

I want to thank you for your help with our website development project. Your programming skills, attention to detail, and ability to interact directly with our client were excellent. You have provided tremendous value to my organization. With a project of this magnitude, including the use of web services to push data out to 19 sub-websites, your ability to overcome our unique challenges and coordinate with my IT team was exceptional. I appreciate your help, and I am certain that your expertise was key to the project's success. Thanks again, I look forward to working with you on our next endeavor!

~ John Forgione – Executive Vice President – SFA Marketing, Inc.

Read More