Butingtaon's Corner

Posts by type
Other

Smartphone Home Servers

Modern smartphones, when compared to the computers of the past, are literal supercomputers. Seeing so much compute power going to e-waste all the time whenever it is no longer supported by android or its manufacturer, or even sooner in the case of most people, is extremely wasteful.

Utilizing a low power consumption device with its own UPS and integrated display as a webserver just makes sense. Especially when you want a home server for cheap.

The succeeding sections assume that the phone is connected to the LAN via wifi.

  • The basis of this is the UserLAnd application which runs an entire linux distribution inside a PRoot container. This allows us to use the same documentation and applications that run on the same server operating systems that most other people use.

    Follow the steps on the UserLAnd website how to install a distribution.

  • Configure apache2 and set it up to serve your website locally . Priveleged ports like port 80, etc, are served on higher ports (port+2000), so the actual port 80 is port 2080, etc.

    I had apache2 serve my local websites on seperate ports as apart from messing with host files on my client machine, there is no easy way of serving local websites out of their own domain names.

  • Using the UserLAnd console, run ip a and get the LAN IP address for the current device.

    In the example above, the website hosted on port 2080 could be served at the url 192.168.100.100:2080, etc.

One thing I did notice after setting this up is that the connection goes 'stale' after 30+ minutes even though the phone is still connected via wifi. I still need to fix this, but currently I just shut the wifi on the phone off and back on.