Sharing an Apache configuration between testing vs. production

Posted by Kevin Reid on Server Fault See other posts from Server Fault or by Kevin Reid
Published on 2010-05-23T12:16:27Z Indexed on 2010/05/23 12:21 UTC
Read the original article Hit count: 502

I have a personal web site with a slightly nontrivial Apache configuration. I test changes on my personal machine before uploading them to the server. The path to the files on disk and the root URL of the site are of course different between the test and production conditions, and they occur many places in the configuration (especially <Directory> blocks for special locations which have scripts or no directory listing or ...).

What is the best way to share the common elements of the configuration, to make sure that my production environment matches my test environment as closely as possible?

What I've thought of is to use SetEnv to store the paths for the current machine in environment variables, then Include a common configuration file with ${} everywhere there's something machine specific. Any hazards of this method?

© Server Fault or respective owner

Related posts about apache

Related posts about configuration