4

I need an example of changing apache configuration values from bash script, so that i can have the same configuration by running the script across my servers instead of copying and pasting the whole config file. Just a starting point to let me figure how could be done.

I've spend the last 2 hours on google but i can't find any clue. Thanks!

user3519262
  • 83
  • 2
  • 6
  • 1
    Check this http://stackoverflow.com/questions/2914220/bash-templating-how-to-build-configuration-files-from-templates-with-bash – Vishnuraj V May 03 '14 at 09:45

1 Answers1

8

You can use sed command for changing config file of apache for example

sed -i "s|\("^ServerRoot" * *\).*|\1/www/www1|" httpd.conf

sed -i "s|\("^Timeout" * *\).*|\1600|" httpd.conf
Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38