In my test environments I'm using variables for the basic apache configs. In my init.d startup script I just export some variables like:
Then in the apache config files I have values like:
Code:
ServerName www.${ENVT}.abc.com
This is working fine however I'm a bit stumped as to how I can have that variable removed when it comes to production where it should be just
www.abc.com. Is there a way I can modify my startup script to run a sed command on the file to load into memory instead of actually modifying the copy on disk? The sed command below works; I just need to figure out if it's possible to have the apache config files modified before the binary reads them. Feels like something fairly simple I'm missing, but maybe not.
Code:
if [ ${ENVT} == prod ]; then
`/bin/sed -r 's/\.\$\{ENVT\}//g' /apps/httpd/conf.d/*.conf`
fi