views:

92

answers:

3

hi ,

i need to make a website such that it can be accessed through the internet if internet is available otherwise when there is no internet then it should work properly on the local intranet also can this be achieved , i have built my site on php/mysql

if this can be achieved please tell me and direct me to some examples of how to achieve this

thankyou

+1  A: 

Google Gears?

http://gears.google.com/support/

Tim
urm .. i forgot to mention but will i be able to access the data of the web server locally offline also with this , i mean will this synchronize the database also?
jarus
+1  A: 

If you have a local web server, why not just host everything from there instead of hosting it elsewhere, and set it up so incoming connections from the outside hit that machine as well.

Or set up a remote sync that will keep all files on the remote server and the local server sync'd up. Could change DNS upon internet outage and have it resolve to the local server?

David Ferguson
urm ....... could you give me an example or how can i sync the webserver with the local server automatically
jarus
A: 

This will depend on how your network is configured, there are two likely scenarios that I can think of:

  1. Your web server is behind a router and port 80 is forwarded
  2. Your web server has it's own IP address on the internet

In the first instance you shouldn't have to do anything unless you want to access the website using a URL (e.g. www.mywebserver.com) in which case you'll have to play some DNS tricks on the local network to get it to point to the local IP of the server instead of the actual internet IP. For example when accessed from the internet the dns record for www.mywebserver.com would point to 12.34.56.78 where as the dns record for any machine on the local network would be something like 192.168.0.10.

In the second case to my knowledge there is nothing you can do that will allow you to be able to access on the intranet (I could be wrong so if someone posts a solution in this case I'll update my answer).

So the answer to your question really depends on your network configuration, If you expand on that a little giving a more concrete answer will be a little easier.

Kevin Loney