httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Fortin" <>
Subject [users@httpd] VirtualHost command line automation
Date Mon, 02 Dec 2002 15:17:01 GMT

I'm looking for a way to automate Apache VirtualHost additions/removals from
a command line interface.  The purpose being that we can then process
information from a remote database in the form of a batch file, to be
transferred to our Apache server and executed there to make the appropriate

I'm toying with the idea of creating one file per VirtualHost entry, and
appending an "Include" line in httpd.conf itself referencing it..  A simple
'grep -v httpd.conf' could then be used to remove the entry from
httpd.conf, without having to remove a range of lines..  The downside is,
this creates a LOT of files, depending on how many domains we add using this

Another similar option would be to append the whole VirtualHost entry into
httpd.conf, and use the grep -Ax command to remove x amount of lines after
an initial identifying line.  This would require that all VirtualHost
entries have the same amount of lines..

As you can tell, I'm not terribly advanced in file manipulation..  Am I
re-inventing the wheel?  Perhaps the tools already exist to do this, and
have just been looking in the wrong places; if not, is there a better way to
do it than I proposed?

Thanks in advance,

Andre Fortin
Systems Administrator Technician
Persona Communications, Northern Division
500 Barrydowne Rd.
Sudbury, Ontario
Tel.: (705)560-1560 ext. 266

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message