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!
Usage: apamod <DOMAIN> <ACTION> [<PARAM> <PARAM2> ...]

    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
APAMOD makes no backup of your httpd.conf (or included files)!
It's not my fault if all your config is lost!


View apamod source online


© 1999-2019 by Folke Ashberg | <>