Main Stories
Slash Boxes

Slash Open Source Project

Slashcode Log In

Log In

[ Create a new account ]

Article Poll

Poll I found this article to be
Very Helpful
Not Helpful
Not Very Helpful
[ Results | Polls ]
Comments:0 | Votes:0

Running Slash on a dynamic IP

posted by Krow on 07:54 AM July 22nd, 2002   Printer-friendly   Email story
My ISP just went dynamic on me, and I'm hosting my small slash site from home. I'm using a dynamic DNS name, so that is no trouble, I have a client setup that will update my hostname whenever my IP changes. I restarted slashd and apache and my site was working fine.

However, now whenever my IP changes, I have to restart apache for my site to be available, otherwise it shows the apache test install screen.

Is there a way to keep the slash site available even when my IP is changing?

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login
Loading... please wait.
  • I am not sure, but can't you just restart named?
    • I'm not sure either as I don't quite get why Apache would stop working on a new IP. Anyway, here is a workaround.

      PPP users can place apache/slashd restart commands in the file /etc/ppp/ip-up or /etc/ppp/ppp.linkup, which are called whenever a ppp connection is made.

      Users of dhcpcd may place those commands in the file /etc/dhcpc/dhcpcd-eth0.exe or /etc/dhcpc/dhcpcd-eth1.exe which are executed whenever a new dynamic IP address is acquired.
  • by Anonymous Coward
    If you're using ppp of some sort, you could put "apachectl restart; whatever slashd" in /etc/ppp/ip-up-- or, and I'm not sure if this would work, you could make a entry so that it listens on any ip and serves up the right page.
    • not sure if this would work because I have not detected any break in my connection when my IP changes; so does ip-up actually get run if the connection remains up?

      I am already using a client (ddclient) to update my entry, I guess if i knew where to add a line of code to that script I could restart apache whenever it updates my dynamic hostname.

      anybody know what code I would need to update to do this?

  • by Anonymous Coward
    I have a similar setup, but my webserver is behind a firewall. I am guessing that yours is naked on the Internet or that your firewall is part of the web server.

    If you use use port forwarding from your firewall to your webserver your internal IP address would always be the same, ie. VirtualHost

    You wouldn't need to restart Apache at all, but you would need to update your DNS entry for Dynamic DNS with a perl client like: ddclient, which automatically changes your CNAME or A RECORD when a new IP address is assigned.

  • If so then that's the reason. Write a short sed script which updates the file whenever the IP changed. That's what I did at least.

    -- []: YAGSS - yet another German slash si

  • I have a cable modem which is supposed to use DHCP to get it's info. I did find out at some point that it was possible to use DHCP to get the information, use ipconfig (on a Win2k Machine) to find out what info it was given, copy it down, then enter that info in for my TCP/IP Properties. In over a year, I haven't had any problems. Even after my ISP switched from @home to their own network.