John told me more than twice that is SHOULD work. But it doesnt work..
I have tested with doing a rewrite_confs after every user action, but that slows down the whole navigation within DirectAdmin. So I made some cool scripts to manage the rewrite_confs on the background.
# cd /usr/local/directadmin/scripts/custom/
# pico domain_create_post.sh
#!/bin/sh
# Cronjob to trigger custombuild './build rewrite_confs'
cd /usr/local/directadmin/scripts/custom/
echo -n " " > .rewrite_confs
exit 0;
# pico domain_destroy_post.sh
#!/bin/sh
# Cronjob to trigger custombuild './build rewrite_confs'
cd /usr/local/directadmin/scripts/custom/
echo -n " " > .rewrite_confs
exit 0;
# pico subdomain_create_post.sh
#!/bin/sh
# Cronjob to trigger custombuild './build rewrite_confs'
cd /usr/local/directadmin/scripts/custom/
echo -n " " > .rewrite_confs
exit 0;
# pico subdomain_destroy_post.sh
#!/bin/sh
# Cronjob to trigger custombuild './build rewrite_confs'
cd /usr/local/directadmin/scripts/custom/
echo -n " " > .rewrite_confs
exit 0;
# pico user_create_post.sh
#!/bin/sh
# Cronjob to trigger custombuild './build rewrite_confs'
cd /usr/local/directadmin/scripts/custom/
echo -n " " > .rewrite_confs
exit 0;
# pico user_modify_post.sh
#!/bin/sh
# Cronjob to trigger custombuild './build rewrite_confs'
cd /usr/local/directadmin/scripts/custom/
echo -n " " > .rewrite_confs
exit 0;
# pico user_destroy_post.sh
#!/bin/sh
# Cronjob to trigger custombuild './build rewrite_confs'
cd /usr/local/directadmin/scripts/custom/
echo -n " " > .rewrite_confs
exit 0;
# pico rewrite_confs.sh
Code:
#!/bin/sh
# Author: Tim Boormans, Direct Web Solutions
# Email: info [at] directwebsolutions.nl
# Description: This is a workaround for generating working httpd configs
# and is only effective for DirectAdmin on a Debian OS with custombuild.
if [ -f /usr/local/directadmin/scripts/custom/.rewrite_confs ]; then
cd /usr/local/directadmin/custombuild/
./build rewrite_confs
# make sure there are no errors in the config files
perl -pi -e 's/Port 80/#Port 80/' /usr/local/directadmin/data/users/*/httpd.conf
# only reload the configs if they are correct. So a RELOAD
/etc/init.d/httpd reload
# remove lockfile
rm -f /usr/local/directadmin/scripts/custom/.rewrite_confs
fi
exit 0;
# chmod +x *.sh
# chown diradmin:diradmin *.sh
# pico /etc/crontab (add on the last line):
*/2 * * * * root cd /usr/local/directadmin/scripts/custom/; /bin/sh rewrite_confs.sh
After you have done this the tool is working automatically in the background. Every time you add/modify or delete a user/domain/subdomain there will be added a job in the queue of my script, and will be processed within 2 minutes. The only thing you have to make sure is that you have running crond, which is usually installed by default.
# ps ax | grep crond | grep -v grep
If the above command does not show any process, then it is not running, and the script does not work. The default way to start it is:
/etc/init.d/crond start
Mail
[email protected] or use the forums if you dont get it started.