suggestion: script to repair/rebuild httpd.conf

johnallen

Verified User
Joined
Sep 23, 2003
Messages
47
Location
minneapolis
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
 
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
 
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.
 
Hello,

Correct. Also, to restore a *Users* httpd.conf file (not the /etc/httpd/conf/httpd.conf) you can type:
Code:
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
 
It's an old thread, but if someone needs that:
Code:
cd /usr/local/directadmin/custombuild
./build rewrite_confs
 
Back
Top