Using an iPad to view offline

Until now I’ve been able to take a MBP to show off a website using Apache
and PHP.

Now I’d like to do the same on an iPad.

Q: Has anyone done this?
What is the procedure?

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Until now I’ve been able to take a MBP to show off a website using
Apache
and PHP.

Now I’d like to do the same on an iPad.

Q: Has anyone done this?
What is the procedure?

I’ve found “claims” of this being possible with 3rd Party hack
software but it seems very dangerous. I’m dubious it’s even possible.
I think it would be extremely difficult to port PHP and Apache to the
very restricted iPad. I would like to be proven wrong though! Anyone?

Todd


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s no server available on an iPad (or any iOS device). So anything that relies on PHP executing in the context of an Apache server will not run at all. But if your application is more of a CMS than a true Web app, you can simulate this quite easily using wget to crawl the site and download it as html files. The links between files will be converted so they still work, and the entire site – even a deep “fake” hierarchy – will be duplicated on your desktop, and you can browse it from local storage, assuming you can figure out how to link to the index.html file in the first place from local storage.

Here’s where you have to start:

  1. Make sure you are using “pretty” URLs in your application. No querystrings allowed, so no filename.php?foo=bar&baz=blarg. You can use a simple .htaccess rule to rewrite these into /foo/bar/baz/blarg.html -style URLs instead.

  2. Make sure you’re not relying on sessions or cookies for any part of your experience.

  3. Host your site on a server that DOES have PHP running, and make sure it works perfectly when browsed by a regular browser.

If you haven’t installed wget (it used to be standard, and now you have to install it separately) do so[1]. Then open Terminal.app, move into a folder somewhere, maybe like this: cd Documents, and enter this command (adjusted for your site address):

/usr/bin/env wget --html-extension --recursive --convert-links http://www.softpress.com

You will end up with a folder in your Documents folder called www.yourapp.com, containing the entire site – everything that wget could find a link to, anyway – recursively crawled and converted into HTML. All URLs will work, all image paths will be relative, and all foreground images will be copied over. Please note that any background images, or any images referenced in the CSS or JavaScript will not be copied over, so some post-processing may be needed, either copying over files, or updating paths in script or stylesheets to match the new reality.

Test the result in a browser with the network disconnected. Make sure that there are no dependencies on files you won’t have with you. Now make sure you can get the files onto your iPad. Maybe use DropBox or something like that, this is the one part I haven’t tried, so I don’t know how you’ll get this part done. But converting a dynamically-generated site into static is a fairly simple trick (as such things go).

Walter

  1. Be sure you have Xcode installed, then download http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz, open Terminal.app, and do the following:
cd Downloads
tar xzf wget-1.9.1.tar.gz
cd wget-1.9.*
./configure
make
sudo make install

On May 17, 2011, at 9:02 AM, Todd wrote:

Until now I’ve been able to take a MBP to show off a website using Apache
and PHP.

Now I’d like to do the same on an iPad.

Q: Has anyone done this?
What is the procedure?

I’ve found “claims” of this being possible with 3rd Party hack software but it seems very dangerous. I’m dubious it’s even possible. I think it would be extremely difficult to port PHP and Apache to the very restricted iPad. I would like to be proven wrong though! Anyone?

Todd


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Assuming you have network access (3G perhaps) wherever you happen to be, then you could also use a remote terminal type of app (something like Logmein) to access and control a remote Mac somewhere running MAMP for example to display your site without actually having it live on the web.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Why offline?

Is there no WiFi access.

You can use a MiFi with a wireless iPad if it is not 3G

and also share your iPhone4 3G connection (if you have one)

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

At 15:41 -0400 17/5/11, DeltaDave wrote:

Why offline?

Is there no WiFi access.

You can use a MiFi with a wireless iPad if it is not 3G

and also share your iPhone4 3G connection (if you have one)

It’s a good idea to be prepared. If you wanted to demonstrate a
product with a laptop/iPad in a large-company office I visit a few
times a year you’d be stuck if you relied on outward connections.
Although it’s in central London there is no 3G. Not even all 2G
phones work. They may have installed blockers, but no-one you ever
meet there knows (or is prepared to say). Their internal network is
tied down. I’m sure they won’t be the only ones.

David


David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
email@hidden
www.ivdcs.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options