Koozali.org: home of the SME Server

httpd.conf keeps rewriting

Jason Lemm

httpd.conf keeps rewriting
« on: June 24, 2002, 08:42:01 PM »
Hi,

I wonder if anyone can help. I need to change several lines of code in httpd.conf but whenever I do it's ok for a while until I change something for example the IP and reboot the server. It will then rewrite the httpd.conf losing all my changes. Is it possible to stop the SME from rewriting the httpd.conf? I know it needs to do that, but why rewrite the whole thing?

Thanks,
Jason

Paul McEnery

Re: httpd.conf keeps rewriting
« Reply #1 on: June 24, 2002, 10:09:53 PM »
Hi Jason

This can server as a mini-howto for anyone searching for this problem

The config files on E-Smith are dynamic. That is they are built automatically from "templates". These templates reside in /etc/e-smith/templates/

You will notice that there is a directory structure that remotely resembles the root structure:

etc
var
home
root
sbin

Within etc you sill see a directory for the appropriate configuration file:

eg /etc/e-smith/templates/etc/inittab
eg /etc/e-smith/templates/etc/httpd/conf/httpd.conf

Within this directory are a number of "templates". You will need to take a look through them and see which one would be the one that you would like to change. Each one affects the building of the actual configuration file.

You now need to make a "custom template slice"
you will do the following:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

Once you have figured out which file you want to change then you need to copy that file to your new custom template directory.

e.g. cp /etc/e-smith/templated/etc/httpd/conf/httpd.conf/80Aliases00 /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/80Aliases00

Edit it to reflect the change that you would like made.

You now need to "expand the template":

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

This will rebuild the actual httpd.conf file and your changes(if made correctly) will be reflected in your actual configuration file.

You can now restart httpd.

By making custom templates, all custom changes will be backed up and you will not have to redo them if the server is re-installed, and a backup is then restored.


Best Wishes

Paul McEnery
Senior Consultant
CCNA, RHCE, LPIC-1
'LinuxIT - Your Linux Solution Provider'
www.LinuxIT.com
Tel:          +44(0) 117 373 1130

Trevor B

Re: httpd.conf keeps rewriting
« Reply #2 on: June 25, 2002, 04:30:06 PM »
For more information on the template system read
http://www.e-smith.org/docs/papers/templates.html

Trevor B