APAMOD 0.1 - Tool for modifying VirtualHosts in Apache-Config
APAMOD is a commandline tool for manipulation and extraction of VirtualHost sections in apaches httpd.conf.
I've wrote it for a web-server configuration interface, but i've used it in many other scripts (backups, reports, webalizer-cron-scripts, ...), and maybe it's also helpful for you!
Features:
- APAMOD can extract a specified VirtualHost section into a file
- APAMOD can update a speficied VirtualHost section
- APAMOD can lock the file the VirtualHost section is in
- APAMOD follows included files (also recursiv)
- APAMOD can extract, add, modify, delete and comment specified lines in a VirtualHost section
- APAMOD can extract the ServerName or the ServerAliases for any ServerAlias/ServerName
- APAMOD can extract all ServerNames or all ServerNames and ServerAliases
- APAMOD is written in PHP (but not a web-frontend!)
- APAMOD is GPL'ed
Usage: apamod <DOMAIN> <ACTION> [<PARAM> <PARAM2> ...]
Actions:
getservername Print the ServerName
getserveraliases Print Aliases
getnames Print ServerName and Aliases
setnames Set new ServerName and Aliases
getsection Write VH-Section into file <PARAM> [lock with <PARAM2>]
setsection Write VH-Section from file <PARAM> [unlock using <PARAM2>]
getline Get line(s) starting with <PARAM>
___line Modify the line(s) starting with <PARAM>
setline Change the line(s) to <PARAM2>, add if not exists
Name is changed to <PARAM3> if given
modline Modify the line(s) to <PARAM2>, only if found
Name is changed to <PARAM3> if given
addline Add a line named <PARAM> [<PARAM2>]
delline Delete the line(s)
remline Remark the line(s)
unlock Unlock vh-file [using <PARAM>]
Special Domains: (no operations possible)
getallnames Get ALL ServerNames
getallvhosts Get ALL ServerNames and ServerAliases
Warning:
APAMOD makes no backup of your httpd.conf (or included files)!
It's not my fault if all your config is lost!
Download
apamod-0.4.tar.gz
View apamod source online