TITLE: Apache with a Dynamic IP LFS VERSION: any AUTHOR: Ian Chilton SYNOPSIS: How to get Apache working when you have a dynamic IP, ie. a PPP connection. HINT: I have worked out how to do Virutual domains in Apache, with a dynamic IP, a nd i'm so proud of this one, i'm going to share it with you :) ** (Note, this requires Apache doc the latest version of Apache (1.3.12) to work ** I copied /usr/local/apache/conf/httpd.conf to /usr/local/apache/conf/httpd.c onf.template and added this to the bottom: (Do NOT replace the "----REPLACE_THIS_WITH_DYNIP----" bits, they are suppose d to be typed in like that :) ------------ [SNIP httpd.conf.template ] ------------ NameVirtualHost ----REPLACE_THIS_WITH_DYNIP---- ServerName www.domain1.com DocumentRoot "/wwwroot/domain1" ErrorLog /var/log/http-domain1-error_log CustomLog /var/log/http-domain1-access_log common ServerName www.domain2.com DocumentRoot "/wwwroot/domain2" ErrorLog /var/log/http-domain2-error_log CustomLog /var/log/http-domain2-access_log common ------------ [SNIP httpd.conf.template ] ------------ Then, the clever bit.. If you running from /etc/ppp/ip-up, use: cat /usr/apache/conf/httpd.conf.template | sed -e "s/----REPLACE_THIS_WITH_D YNIP----/$4/g" > /usr/apache/conf/httpd.conf /usr/local/apache/bin/apachectl restart If not, use: MYIP=$(/sbin/ifconfig|grep -1 ppp0|cut -s -d ' ' -f12|grep addr|cut -d ':' - f2) cat /usr/apache/conf/httpd.conf.template | sed -e "s/----REPLACE_THIS_WITH_D YNIP----/$MYIP/g" > /usr/apache/conf/httpd.conf /usr/local/apache/bin/apachectl restart And that should be it !!