PDA

View Full Version : suggestion: script to repair/rebuild httpd.conf


johnallen
10-08-2003, 02:57 PM
It would be nice to have a script that repairs the httpd.conf file so all domains are listed and formatted correctly in the file. For example if the domain were to still appear in the control panel and it's missing a virtual host from httpd.conf

ProWebUK
10-08-2003, 05:01 PM
i think there may be a backup stored by DA

# locate httpd.conf

if its there, backup your current httpd.conf somewhere then copy the DA one over ;)

Chris

johnallen
10-08-2003, 11:08 PM
From looking at the way directadmin works..

Users have their own httpd.conf file
/usr/local/directadmin/data/users/username/httpd.conf

the main httpd.conf is in:
/etc/httpd/conf/httpd.conf

Which has a reference for each user's httpd.conf file.

DirectAdmin Support
10-09-2003, 10:35 AM
Hello,

Correct. Also, to restore a *Users* httpd.conf file (not the /etc/httpd/conf/httpd.conf) you can type:echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
And this will rewrite all User httpd.conf files (within 1 minute).

Note that the backup for the *main* /etc/httpd/conf/httpd.conf file is located at:

/usr/local/directadmin/data/templates/httpd.conf

*BUT* cannot be copied over directly. This is because it runs through our tokenizer (there are a few variables that have to be repalced ..eg: |IP|), also, all of the "Include /usr/local..../httpd.conf" would be lost if you just overwrite your old one.

So for the *main* httpd.conf file, the template should be used as a reference and not just copied over.

John

smtalk
11-04-2008, 01:16 PM
It's an old thread, but if someone needs that:
cd /usr/local/directadmin/custombuild
./build rewrite_confs