I'm currently writing a script to automate our CMS setup and deployment. Part of that process is adding an alias to Apache2 which is normally done manually via Webmin. At current, I'm looking to append a line into the Apache2 include file that stores all the alias, using the following:
echo Alias /path \"/var/www/directory\" >> alias.include
The problem I have is that this include file is owned by root and currently has the permissions -rw-r-r-. The only way i can append this file is to chmod the permissions, make the change, then chmod it back. This seems really dodgy to me. Any suggestions?