cvs commit: hints apache-dynamic-ip.txt

ian at linuxfromscratch.org ian at linuxfromscratch.org
Wed Sep 25 07:06:19 PDT 2002


ian         02/09/25 07:06:19

  Modified:    .        apache-dynamic-ip.txt
  Log:
  Few Updates
  
  Revision  Changes    Path
  1.2       +28 -15    hints/apache-dynamic-ip.txt
  
  Index: apache-dynamic-ip.txt
  ===================================================================
  RCS file: /home/cvsroot/hints/apache-dynamic-ip.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- apache-dynamic-ip.txt	1 Dec 2000 15:34:52 -0000	1.1
  +++ apache-dynamic-ip.txt	25 Sep 2002 14:06:19 -0000	1.2
  @@ -3,23 +3,24 @@
   AUTHOR:		Ian Chilton <ian at ichilton.co.uk>
   
   SYNOPSIS:
  -	How to get Apache working when you have a dynamic IP, ie. a PPP connection.
  +	How to get Apache virtual hosting 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 **
  +This document explains how to use Apache's virtual hosting when you have a
  +dynamic IP address such as a dialup account, ADSL or a cable modem.
   
  -I copied /usr/local/apache/conf/httpd.conf to /usr/local/apache/conf/httpd.c
  -onf.template and added this to the bottom:
  +I copied /usr/local/apache/conf/httpd.conf to
  +/usr/local/apache/conf/httpd.conf.template and added this to the bottom:
  +
  +(Do NOT replace the "----REPLACE_THIS_WITH_DYNIP----" bits, they are
  +supposed to be typed in like that :)
   
  -(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----
   
   <VirtualHost ----REPLACE_THIS_WITH_DYNIP---->
  @@ -36,6 +37,7 @@
      CustomLog /var/log/http-domain2-access_log common
   </VirtualHost>
   
  +
   ------------ [SNIP httpd.conf.template ] ------------
   
   
  @@ -43,19 +45,30 @@
   
   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
  +cat /usr/apache/conf/httpd.conf.template |
  +   sed -e "s/----REPLACE_THIS_WITH_DYNIP----/$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)
  +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_DYNIP----/$MYIP/g" > 
  +   /usr/apache/conf/httpd.conf
   
  -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 !!
  +
  +Just remember that in the future any changes you need to make are
  +made to httpd.conf.template, not httpd.conf and after changes
  +you need to run the sed statement which creates the httpd.conf.
  +(perhaps create a little script to do it for you).
  +
  +
  
  
  
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe hints' in the subject header of the message



More information about the hints mailing list