Author Topic: Webserver On Zaurus  (Read 3351 times)

markbedish

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://
Webserver On Zaurus
« on: March 14, 2005, 06:55:24 am »
Hi,

I am trying to run some webpages from my 750 on a local network (for my own use only). I have hardcoded the IP address in the web pages and links which work fine but of course this doesnt work if I change networks, e.g. from ethernet to wireless or bluetooth or if I am offline (required 127.0.0.1).

Does anyone know how to get round this limitation, e.g. do I need to register a domain name?

The other alternative is to buy webhosting space but I thought I would ask the linux gurus first if there was another method, as I would rather keep the pages on the zaurus!

Thanks very much.

Mark
-----
slc750 rc9.1
ethernet cf
bluemonkey bt cf
512 sd
3200 from conics.net (switched from sharp to pdaxii13)

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
Webserver On Zaurus
« Reply #1 on: March 14, 2005, 07:21:25 am »
I'm not sure that i'm picking you up fully, but use relative urls instead of absolute so that you don't have to hardcore the ip address. do a google.
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

markbedish

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://
Webserver On Zaurus
« Reply #2 on: March 14, 2005, 07:48:39 am »
Quote
I'm not sure that i'm picking you up fully, but use relative urls instead of absolute so that you don't have to hardcore the ip address. do a google.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=70573\"][{POST_SNAPBACK}][/a][/div]

I probably wasnt clear enough. The web pages are local to the zaurus on my sd so to access them I use for example 192.168.0.4/index.html.en which points to the links and these are all hardcoded too with the same ip address.

If I change network then the zaurus may get a different IP from the router so the links dont work. If I am offline then 127.0.0.1 gets me to the index but then I have to change the other links.  I guess I need to register a domain and use that though it is behind a firewall, but just wondered if there was another way of doing it.

Thanks.

Mark
-----
slc750 rc9.1
ethernet CF, bluemonket BT, sd 512
3200 from conics.net (switched from sharp to pdaxii13)

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Webserver On Zaurus
« Reply #3 on: March 14, 2005, 08:12:14 am »
As previously menitioned if you encode your links as 'relative' rather than 'absolute' links you shouldn't have the problem... i.e.

relative..

anotherpage.htm

absolute..

http://thiswebserver/anotherpage.htm

OK ?... It may be the case, however, that you are using some technology that generates the pages for you - for example PHPWIKI - and I seem to recall that PHPWIKI insists in generating some absolute URLs.

If you HAVE to go this way then simply create an entry in your hosts file (on the client machine, not the web server) with the IP address and access it that way (update the 'Web Server' to specify the host name rather than IP address).

You are then free to modify the IP address in the hosts file accordingly.

- Andy
« Last Edit: March 14, 2005, 08:13:47 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Webserver On Zaurus
« Reply #4 on: March 14, 2005, 08:16:16 am »
As per omega's suggestion DONT use hardcoded links - change the links to relative links, that way it doesn't matter what ip you have.

Instead of
Code: [Select]
Some linkuse
Code: [Select]
Some link
Or if you really really must have hardcoded links, give them a name (ie Zaurus) and add Zaurus to your /etc/hosts file.

If you don't need to share the pages off the Z, then use 127.0.0.1, but hardcoded links are a curse and should be avoided whenever possible

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Webserver On Zaurus
« Reply #5 on: March 14, 2005, 08:18:17 am »
Doh, took too long to reply and iamasmith bet me to it
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Webserver On Zaurus
« Reply #6 on: March 14, 2005, 08:24:26 am »
Quote
Doh, took too long to reply and iamasmith bet me to it
[div align=\"right\"][a href=\"index.php?act=findpost&pid=70584\"][{POST_SNAPBACK}][/a][/div]

Ooh, the amount of times that's happened to me too!  
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

bluedevils

  • Hero Member
  • *****
  • Posts: 1284
    • View Profile
    • http://
Webserver On Zaurus
« Reply #7 on: March 14, 2005, 10:53:45 am »
As per others, don't hardcode the pages with absolute links.  If you are sharing these pages to other computers on your network, then try not using DHCP.  If you don't use them at the same time, use the same static IP for wireless and ethernet.  If you want to share these pages out onto the internet from any network, then you would need to register with a dynamic dns organization.  I do not know if the Z has software or what scripts you can make to have the Z notify of change address.  Some home routers can do this.
I'm now an iphone user and use my zaurii as serial terminals, perl and shell scripting and when I need 640x480 screens

sl-c3100/pda cacko 1.23 | sl-6000l/needs battery | sl-c760/server pdaxrom rc12 | Former sl-5500/tkcrom owner (sister's birthday gift)

markbedish

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://
Webserver On Zaurus
« Reply #8 on: March 14, 2005, 01:50:06 pm »
Quote
As per others, don't hardcode the pages with absolute links.[div align=\"right\"][a href=\"index.php?act=findpost&pid=70607\"][{POST_SNAPBACK}][/a][/div]

Thanks for all the help from everyone. Local links are obviously the way, but I do use somethingh called pmwiki. also not sure about settings on Apache (httpd.conf), I think I hardcoded the url!

Mark
-----
slc750 rc9.1
3200 from conics.net (switched from sharp to pdaxii13)