I have managed to set up 2 fileservers in my attic to act as storage for files etc for the people on my home network and others alike.

I have php, mysql and apache all installed and running. I can tap in the IP address of that machine and see my files perfectly via a browser, on any computer!

My problem is this:

I don't have a static IP, and i don't intend to buy one either. Is there a way that PHP or apache can regularly check what the IP address of the machine running the script is? i.e on my 2 servers have a file which say every 24 hours will check the IP address of the server and update the database or file on the server which I rent?

I basically want to be able to go away on holiday or leave the computer for prolonged periods but still be able to access it. Can I create a page on my rented server (which I can always access) which pulls the 'current' IP address of my attic server from a database; the same database which is updated every hour by the servers in my attic?

Can this be done via chron or anything? I'm not very familiar with apache or chron or anything. So any guidance would be great! Have I made myself clear or do I need to reword my query?

Thanks!

    If the fileserver is acting just as a file server, then why don't you just hard set the IP addresses in them? Give them a reserved class C address like 192.168.1.100 and 101. That way you don't have to deal with changing IP addresses? You can accomplish all of this without any special coding.

    Or are you talking about trying to access these files from a computer away from home?

      Hi,
      Setup static local ips on your two filesevers, like TheDefender suggests. I assume you are behind a firewall/router with a dhcp server like a linksys router. Unless you set up static ips with a router like that, you will have a different local ip each time you restart the computers.

      So since you have a dynamic internet ip address, use a dynamic dns service like swmaster suggests. I also use dyndns.org
      You can get a free address such as pablodelapena.mine.nu and then on one of your boxes, run a daemon which updates the internet ip at dyndns.org whenever it changes.

      So depending on what sort of servers you run, web, vnc, vpn etc,
      you can access your computers with your pablodelapena.mine.nu address in place of your ip.

        I see, ill check that site out. Yes i want to be able to access this amchine from another computer outside my own network....

        I didnt realise that you can set an IP address without paying for one? in windows where should i look to do this?

        Ta

          Hi,
          Well in your case, the only ip you are paying for is your internet ip which you get with your internet connection. As you have mentioned, that is a dynamic ip and so can change at any time.

          To have a way of always being able to address your computer/server you need to use the dyndns.org address which always points to your internet ip. dyndns.org is free to use if you want to use an existing address they provide like mine.nu. They charge like $20-30/year if you want to buy your own domain and have it point to your ip, ipickedmyownname.com (that is just the pointing of the address, not including the cost of the domain name) . You also need to run a daemon which updates your internet ip at dyndns.org. there are some free programs and some that cost money.

          Make note that I use 'local ip' and 'internet ip'. So even though you have a dynamic internet ip address, you can have a static local ip. There are many ways to have your own local network, but most likely you have a linksys, netgear, belkin router. Make note of the ip address to your router, linksys is http://192.168.1.1 . When you type that ip into your browser, the router admin page comes up. make note of your specific router ip as that is your gateway used below.

          Regardless of what OS you use, you will need the same basic info. The local ip address you want to assign to the computer, the gateway described above, the subnet mask and the dns servers from your isp.

          There are far more better sources for windows networking, but here is a pic to help you put in that info.

          windows networking

          use the same subnet mask as i have, to find your isp's dns servers, goto the windows command line and type 'ipconfig /all' you can have 1-3 dns servers, so just write those down and put them in where needed.

            I see, so if I aheva COMPLETELY scrubbed computer with XP on it then I'd do the following....

            Create the connection to my router using the addresses in your pic (i tapped in the example link you gave me and it gave me a login screen, so i assume that it was right).
            Once that is set up and i can browse the internet I then install apache, PHP, MySQL etc
            Create an account at dyndns.org
            Downlaod the updater software
            et voila i should be able to browse that spare computer I have in the attic from anywhere in the world...?

            Sounds quite simple?

            PS, yes that is the way my network is configured, all computers connect to the router to the modem to the www.

            I have a couple of final questions however.

            Are the other computers on my netowrk at risk of being hacked through this machine? If so how can I protect them?
            The computers will be on a wireless copnnection, this won't have any affect on anys ettigns or whatever, right?
            would I be able to fTP to this server should I not be at home and able to 'push' fiels onto it via the LAN. Again, how can i set this up, preferrably with the possibility for multiple users.

              Write a Reply...