View Single Post
  #4   (View Single Post)  
Old 7th June 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,131
Default

Code:
$ cat update_apache
#!/bin/sh

FILE=httpd.conf

HOSTNAME=$1
YOU=$2
DOMAIN=$3 
IP=$4


cat <<EOF >>${FILE}
<VirtualHost ${HOSTNAME}:80>
    ServerAdmin ${YOU}@${DOMAIN}
    ServerName ${IP}
    DocumentRoot /www
    ErrorLog logs/error_log
    CustomLog logs/access_log combined
</VirtualHost>
EOF

$ sh  update_apache hercules.utp.xnet j65nko pietje_puk.nl 81.00.00.01

$ cat httpd.conf                                                     
<VirtualHost hercules.utp.xnet:80>
    ServerAdmin j65nko@pietje_puk.nl
    ServerName 81.00.00.01
    DocumentRoot /www
    ErrorLog logs/error_log
    CustomLog logs/access_log combined
</VirtualHost>
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote