httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@fanti.co.uk
Subject [users@httpd] Commom Apache configurations shared between live and development servers?
Date Fri, 02 Mar 2007 11:59:36 GMT
Hi guys,

I'm wondering if anybody has done something like this before (it  
doesn't seem that out of the ordinary to me)?

Our current set-up is a mess and we're trying to fix it, so I'm  
looking for some best practice or recommended methods to the following:

Essentially we have a "master" publishing server and then a set of  
development servers and a set of edge browsing servers, all of these  
boxes will be upgraded from Apache 1.3 on FreeBSD 4.9 to Apache 2.0 on  
Red Hat RHEL 4.0.

All of our servers use a standard set of shared configurations for  
site configurations. We then use mod_define and host specific  
configuration files  and pass -D `hostname`to httpd on all boxes to  
decide what the machines virtual host domain names and document roots  
should be.

Okay, so say for example on the edge servers we have  
www.abcd.com/.de/.fr/.it... etc, our developer boxes host  
<devname>-<locale>.abcd.com (e.g. our perl developer Bob has:  
bob-main.abcd.com/bob-german.abcd.com/bob-italian.abcd.com).

I've been re-implementing the configurations using mod_macro rather  
than mod_define like so:

--- www.abcd.com ---

<Macro www.abcd.com $server_name $sites_root>
<VirtualHost *>
ServerName $server_name
DocumentRoot $sites_root/www.abcd.com/htdocs

Blah Blah Blah....
</VirtualHost>
</Macro>

Use www.abcd.com bob-main.abcd.com /var/www/vhosts

--- www.abcd.com ---

But as you see, I've been specifying the values to be inserted into  
the Macro from the bottom of the virutal site file (I'm just testing  
out mod_macro on a single test box at the moment).

So far I've considered setting environment variables, however it  
occurs to me that these are quite hard to version control and aren't  
"obvious" at a first look. I'm also worried that somebody might change  
the environment variables by mistake (our Apache user is actually used  
by real users for various tasks, I also realise that should change  
eventually).

So has anybody done something like this in the past? What are the  
recommended options? One other issue I've noticed is that both  
mod_define and mod_macro do not seem to pass variables onto included  
files, e.g. if I take the above virtual host and add:

"Include conf.d/share/shared-handlers.conf"

If the shared-handlers.conf has any reference to the previously set  
macro variables these are not able to be used by that file (they are  
either seen as literally the macro name - i.e. $sites_root or as  
null), is this an Apache limitation?

I appreciate any tips or suggestions!

Jon.





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message