Subject: RE: apache dies with pppoe
From: Vince Hoffman <[email-masked]>
To: "[email-masked]'" <[email-masked]>, Martin Gainty <[email-masked]>
Cc: Cygwin <[email-masked]>
Date: Thu, 24 Jul 2003 18:07:56 +0100

Since dhcp is handled by windows i cant see how you can avoid having to run
a cron job, even if just a script to check if your ip has changed and
restart apache if so.
somthing like this
-----------cut foo.sh---------------
#!/bin/bash

#check if we have the old IP recorded
if [ -e /tmp/old.ip ]
        then
# we do so use it
OLDIP=`cat /tmp/old.ip`
        else
# we dont have it, set to a value that will cause apache to restart
OLDIP="restart"
fi
#get our current IP
NEWIP=`ipconfig |grep "IP Address" |sed -e 's/.*:\(.*\)/\1/' `

#check if they are the same
if [ "${OLDIP}" == "${NEWIP}" ]
        then
                exit 0
fi
echo "different ip"
echo "restart apache"
#add "/path/to/apachectl restart" here 
echo "saving new IP for next test"
echo "${NEWIP}" > /tmp/old.ip

----------------end foo.sh---------------------------

(probably over complex but my scripting needs all the practice it can get.)

> -----Original Message-----
> From: Bill McCormick [mailto:[email-masked]]
> Sent: 24 July 2003 17:29
> To: Martin Gainty
> Cc: Cygwin
> Subject: RE: apache dies with pppoe
> 
> 
> Ok ... let me back even further.
> 
> The problem is that when I open up port 80 (on my f/w router) 
> and start
> accepting outside connections (to the 'puter running Apache,) 
> it appears as
> though (after some period of time) Apache stops listening or accepting
> connections, including from the LAN. If I restart Apache 
> everything is fine
> again - for a while. Based on other web/news group chatter, I 
> believe this
> problem is related to my DSL time-out and WAN IP changing.
> 
> Now follow closely ... this is where I believe I'm on-topic here ....
> 
> Other's using other OS's (Linux) have devised schemes (like enhanced
> scripting in if.cfg-ppp) to restart Apache when this happens. 
> I've spent
> more than a few hours looking at this problem (before making 
> the original
> post) and maybe the DSL modem time-out is not the issue - but 
> at the moment
> it seems to be the only explanation.
> 
> So, simple question ... are there already CYGwin net 
> utilities that I might
> use solve this problem  from the angle I'm currently focusing (restart
> Apache when DSL time-out forces WAN IP change) ... right or wrong?
> 
> 
> In response to Martin:
> 
> > I used to have an Instructor that would say PAY ATTENTION 
> and that is what
> > you need to do
> 
> I won't even bother to comment here. Oops .. I guess I just did :)
> 
> > If you acquire a device which handles adjusting Dynamic 
> Addressing and
> > Routes the incoming (and outgoing)
> 
> I have just such a device configured as so. The word 
> "outgoing" was not in
> your original reply for me to pay attention to and I'm not sure how it
> applies - please explain. Even if the DSL modem connection 
> timed out and the
> IP changed during and http client/server transaction (which 
> it's not going
> to,) I'm not sure how that would effect Apache.
> 
> > Port 80 transmissions to the PC which hosts the Web Server 
> (because that
> > same device just assigned it an IP because it is a DHCP 
> Server) then your
> > transmission will be successful
> 
> My configuration is as so, usually clients can connect. 
> However, when my DSL
> modem IP address changes due to time out ... Apache stops 
> severing, or so I
> believe.
> 
> 
> Thanks,
> 
> Bill
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/