Hosting a website on a PinePhone, etc.
#1
Hi everybody,

I'm new here, and have a few questions:

1. My hope is to have the PinePhone be my ONLY device, just making a few voice calls, and hosting a website on it using NGINX or Apache 
    at the SAME time using the cellular modem, NOT WiFi. Before you say this is crazy - I'm at home (in the U.S.) almost all the time, but have a great
    connection using a Verizon unlimited voice/data plan. I'd just like to try it out - it would be cool if it works, don't you think? Does anyone know for
    sure if the PinePhone (preferably the Convergence package with more memory, etc.) will be able to handle this?

2. Is the PinePhone actually available? I've emailed the Sales Dept., but got no response. On the PineStore, it shows the EU edition only - being in the U.S.,
    would it be wrong for me to get that? And does it matter whether it is the Mobian, KDE, or Manjaro version?

3. Since the PinePhone is not an "officially supported" Verizon phone, would I be able to just take out the Sim card of my current phone (an iPhone)
    and put it in the PinePhone and have it work?


Sorry for all the questions, and thank you in advance to anyone who can help.
  Reply
#2
1. I mean, PinePhone is essentially just a little GNU/Linux computer with a touch screen, so I imagine you could, but I don't think performance would be great.  The far bigger issue though will be how do you expect to come up with a reachable IP address through your carrier's network?  If you want to play around with stuff like this, I would recommend buying one or more Single Board Computers (SBC), as you can see there are many inexpensive ones nowadays to choose from besides RPi (which I do not recommend, for a lot of different reasons).

2. It says right on the PinePhone page in the store what is in stock, and what isn't.  Looks like you are out of luck in US at the moment.  There were apparently a few 3/32 KDE edition available last weekend (I am in US, like you).  I decided just to order and see what happens.  Then on Monday I noticed they updated the website that they are now officially out of stock.  I received order confirmation (an almost immediate, what I assume was automated reply), but no further information yet whether I actually got one or not, no shipping info nor anything else, yet.  Although in fairness, it does state in big red letters that they are projected to ship later this month.  It does not matter really what software comes on it, you can always change that later.  Only difference being the logo on the back cover, although I seem to recall reading that Pine might even make the other back covers available in the store later, in addition to a plain one.

3. From what I have read on the forum, I would say no, but you can try and see.  Verizon is the one carrier that seems to be the fiddliest of all.  IMO obnoxious on their part and one of many reasons I will not do business with them.  But from what I have read, you will need to do some dickering around with SIMs and IMEI numbers or something (as compared to some other carriers who "just work" without hassle).  Some people have not gotten it to work, but it seems to me like if you put in a little time / research, you should be able to figure it out and get it working.
Cheers,
TRS-80

What is Free Software and why is it so important for society?

Protocols, not Platforms

For the most Linux-y experience on your Linux phone, try SXMO!

I am (nominally) the Armbian Maintainer for PineBook Pro (although severely lacking in time these days).
  Reply
#3
I hosted a small, static website for my own use on a smartphone-sized Linux tablet called a "SmartQ 5" about 10 years ago. (It was more an experiment to just see that it could be done rather than trying to run a "real" website that way.) Anyhow, that device had considerably less powerful hardware than a Pinephone and it worked. I used a very simple and lightweight open source web server available free from IBM:

https://www.ibm.com/developerworks/syste...index.html

Might be able to run something a bit more functional like lighthttpd or nginx on the Pinephone, especially if you have the 3GB memory version. Just don't expect to run a busy site with a lot of users! Tongue

Edit: It looks like the download of nweb from the IBM site no longer works, it just yields Error 500 "Internal server error". Oh, well, it hadn't been maintained since 2012 so that's not suprising! Sad

Another edit: Although the original IBM download page no longer works, a version of nweb updated in 2016 is available on sourceforge:

http://nmon.sourceforge.net/pmwiki.php?n=Site.Nweb

Just for grins I downloaded the nweb25.c source file, compiled it on my desktop, and it works. Will have to try it on the Pinephone...
  Reply
#4
TRS-80, thank you for your in-depth reply, and Zebulon Walton, thanks for your insights as well. You both obviously know a lot more
about this than I do, so if you don't mind I'm going to give you a bit more background:

1. My Internet access is limited to 1 line of unlimited voice/data with Verizon (unfortunately?).

2. I've tried connecting a computer to the Internet via the phone's Wifi (hotspot), but have never been able to keep it going - it always seems
    to cut off after some time. Obviously, a web server must have a persistent connection.

3. Since I only make a few phone calls, my 1st choice was to have a laptop or tablet with a cellular modem that is capable of voice calls
   (not VoIP, because I can't assume that the people I'm calling, like a doctor's office, are on a computer). However, to my knowledge, no such
   device exists - I think iPads, Samsung laptops, etc. with LTE capability are only for WiFi, right?

4. So when I discovered the PinePhone (actually, heard about the Librem5 1st, but PinePhone is so much cheaper, and almost as capable),
    it seemed like a great solution. I'm hoping that it's compatible with Verizon as far as the bands they use, GSM vs. CDMA, etc.
   
   TRS-80, you bring up the issue of static vs. dynamic IP - are you sure that a carrier like Verizon will always assign different addresses, and
   if so, is there a workaround when I set up the DNS records, etc.? And as far as the Sim card goes, isn't that just used by the carrier for billing
   purposes? Because I think you're right about the IMEI and also maybe something else (IMSI?), but the question is, how do you change them?
   By the way, when you were talking about SBC's, were you thinking of the Raspberry Pi? Because that looks like a fantastic machine, but again,
   I don't believe it has a cell modem.

   Zebulon Walton, I was originally thinking Apache, but people say that's overdoing it, and many recommend NGINX.  When I finally get a hold of
   a machine, I'll definitely try the IBM server also.

Thanks for your help, guys.
  Reply
#5
I think Apache would be way too heavy-handed for the Pinephone to handle, but you could always try it and see. I expect either nginx or lighthttpd would work well. IBM's nweb is a neat demonstration with simple, easily-modifiable code for experimentation but is obviously very limited. You could maybe look at using a dynamic DNS service to overcome the lack of a static IP. There are free ones available (such as freedns.afraid.org). However the freebies generally don't let you use your own domain name so you'd have to look at a paid service if you want that.

For what it's worth I use nginx to run several low-traffic sites on a virtual linux server that has 2GB memory and a single virtual CPU allocated to it, and have never had a problem with CPU or memory use.
  Reply
#6
I doubt there will be a problem running a webserver on a PinePhone - you can do it on a Pi Zero after all. The more likely problem will be getting an externally accessible address and port on the cellular interface. Most network operators will be using carrier grade NAT, and have no port forwarding for you to configure. You'd need some form of tunnel to get past this, but you'd probably be better off just running the web server at the outside end instead of using the tunnel.
  Reply
#7
(02-14-2021, 03:50 AM)a-l Wrote: 2. I've tried connecting a computer to the Internet via the phone's Wifi (hotspot), but have never been able to keep it going - it always seems to cut off after some time. Obviously, a web server must have a persistent connection.

Remember I said I don't like Verizon?  This is another one of many reasons why...  In addition to pioneering artificial scarcity marketing/pricing (charging per GB, lol) they also think you should pay extra if you dare try and share your data connection with any other device.  I am not sure whether you are paying for (or your plan supposed to include) "Wi-Fi hotspot" or not, but I would at least check that first.  BTW, there are ways around that, too, in either case...

(02-14-2021, 03:50 AM)a-l Wrote: 3. Since I only make a few phone calls, my 1st choice was to have a laptop or tablet with a cellular modem that is capable of voice calls (not VoIP, because I can't assume that the people I'm calling, like a doctor's office, are on a computer). However, to my knowledge, no such device exists - I think iPads, Samsung laptops, etc. with LTE capability are only for WiFi, right?

Well, at risk of confusing the issue, technically almost all businesses are on VOIP already, and also almost all cellular networks are too, at this point.  The only reason we still have to use their networks and "phone numbers" are due to Normie familiarity and legacy lock in business models.  But as I said, I digress...

Your thoughts are on the right track, however in practice I think it will probably be easier to find hardware and software to support "cell phone plan and share hotspot with other devices" sort of workflow, rather than the other way around.  As you apparently found out.  I mean, that's what I do (and I imagine many others do, too).

(02-14-2021, 03:50 AM)a-l Wrote: 4. So when I discovered the PinePhone (actually, heard about the Librem5 1st, but PinePhone is so much cheaper, and almost as capable), it seemed like a great solution. I'm hoping that it's compatible with Verizon as far as the bands they use, GSM vs. CDMA, etc.

Any "smart" phone (Android, etc.) would probably work for this "cell phone plan and share hotspot" workflow, but PinePhone have a lot of other advantages (IMO) like real GNU/Linux and other things.  OTOH, it is still "early days" for PinePhone...

(02-14-2021, 03:50 AM)a-l Wrote: TRS-80, you bring up the issue of static vs. dynamic IP - are you sure that a carrier like Verizon will always assign different addresses, and if so, is there a workaround when I set up the DNS records, etc.?

It's not about static vs dynamic, it's about "carrier grade NAT" as another poster have now also pointed out in the meantime. This is not like your internet service at home, where you have an IP address which is reachable from the rest of the Internet. Inside your mobile carrier's network, you only have some internal IP address. Nothing that can be reached from the outside coming in. Your data connection is essentially outbound only. Look in your phone settings and you might be able to see this.

(02-14-2021, 03:50 AM)a-l Wrote: And as far as the Sim card goes, isn't that just used by the carrier for billing purposes? Because I think you're right about the IMEI and also maybe something else (IMSI?), but the question is, how do you change them?

In Verizon's case, they are also using it to lock down their network, to try and force you to either buy a device from them, or at least introduce some hurdles to anyone trying to bring their own device.  Remember what I said about Verizon.  Wink

(02-14-2021, 03:50 AM)a-l Wrote: By the way, when you were talking about SBC's, were you thinking of the Raspberry Pi? Because that looks like a fantastic machine, but again, I don't believe it has a cell modem.

Well, the point I apparently failed to make was that there are a ton of other devices available than "Raspberry Pi" and in fact I am personally sick of RPi seemingly becoming synonymous with SBC in the minds of so many people.  RPi are only one of hundreds of options.  And many of those other options are less locked down, have more interesting (better) hardware, etc...

And as for "cell modem" I still don't think you have got your head around why that's not going to work, and therefore, why that is ultimately an irrelevant criteria.  Wink

Let's try to strike at the heart of this "hosting a web site" issue, shall we?

Because I don't recall reading what exactly you had in mind when you said "hosting a web site" because that could mean quite a lot of different things.  Are you talking about something personal, private, and available only on your local network to your other personal devices?  Or a public facing website?  Static or dynamic?  Etc...  Or do you just want to tinker and learn?  Depending on answers to these questions, we could probably get you going in some better direction.

I personally eschew all proprietary social media and "cloud" providers, instead preferring to self host my own (and have been doing so for years).  But I am not sure this is what you are really after or not (we need answers to above questions about "what is your real end goal" first).

(02-14-2021, 03:50 AM)a-l Wrote: Zebulon Walton, I was originally thinking Apache, but people say that's overdoing it, and many recommend NGINX.  When I finally get a hold of a machine, I'll definitely try the IBM server also.

Thanks for your help, guys.

Nginx (pronounced "Engine X") would be the modern, maintained, lightweight choice of many people nowadays.  There are some others, too, but Nginx will certainly be a name you hear thrown around a lot.
Cheers,
TRS-80

What is Free Software and why is it so important for society?

Protocols, not Platforms

For the most Linux-y experience on your Linux phone, try SXMO!

I am (nominally) the Armbian Maintainer for PineBook Pro (although severely lacking in time these days).
  Reply
#8
Is carrier-grade NAT being used only for IPV4 addresses, or are they assigning publicly-accessible IPV6 addresses? If the latter you could set up the web server to be accessible via IPV6. Although more than 90% of the internet is probably still running on IPV4, IPV6 connectivity is common.
  Reply
#9
I finally got around to compiling nweb on the Pinephone. I found that to get it to run I had to change the chroot() call to chdir() instead. (Args are the same, just s/chroot/chdir/.) Haven't had a chance to figure out why yet. Some kind of permission issue no doubt. Other than that nweb works fine for playing around with serving out static web pages from the Pinephone. It's so limited though that you'd probably want to run nginx if serious about really doing anything.
  Reply
#10
(02-17-2021, 07:31 PM)Zebulon Walton Wrote: Is carrier-grade NAT being used only for IPV4 addresses, or are they assigning publicly-accessible IPV6 addresses?

That's a good question.  I rather doubt it, but it would be very interesting if they are.

(02-18-2021, 11:06 AM)Zebulon Walton Wrote: It's so limited though that you'd probably want to run nginx if serious about really doing anything.

You know, on the one hand, I like to usually recommend actively developed software.

OTOH, there are still quite a lot of good tools out there, some of which are "mature / complete" and completely fine just as they are.  Now maybe a web server is perhaps not the best representative of something in this category, and as already mentioned, it depends on use-case, but anyway, I have a better/stronger point to make...

Then there is the hacking aspect.  Something old HAMs and early Linux adopters have always shared.  This curiosity for "seeing if I can get something to work, just because."  A lot of learning have resulted from such "pointless" endeavors.  We are still very early days on GNU/Linux phones, and so this is a very healthy mentality I think to foster at this point in time (well, in general, too).  We want and need hackers, not consoomers.  Whatever our limits as individuals currently are, it's always a good idea to keep pushing them little by little, as that's the only way to learn/grow.
Cheers,
TRS-80

What is Free Software and why is it so important for society?

Protocols, not Platforms

For the most Linux-y experience on your Linux phone, try SXMO!

I am (nominally) the Armbian Maintainer for PineBook Pro (although severely lacking in time these days).
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  eSIM on PinePhone just_a_q 8 4,671 11-05-2024, 11:10 AM
Last Post: zetabeta
  Want to buy second hand PinePhone 3G version rudi.timmermans 0 170 11-01-2024, 09:58 AM
Last Post: rudi.timmermans
  Can use PlayStation on Pinephone? willharper 6 5,659 10-30-2024, 08:07 AM
Last Post: biketool
  Ordered PinePhone till today have no info or confirmation about order hennadiyt 1 352 10-05-2024, 02:20 PM
Last Post: KC9UDX
  US Mobile, via T-Mobile, won't support Pinephone Pro - SOLVED, SIMPLY jovval 11 5,759 07-28-2024, 03:42 PM
Last Post: dchang0
  How can I record video on a Pinephone? kk22 18 7,154 07-22-2024, 05:18 PM
Last Post: baptx
  Pinephone not booting, always vibrating alexander12 8 6,867 07-19-2024, 07:50 PM
Last Post: Blackheart
  PinePhone Pro P. Siera 2 821 07-17-2024, 12:41 AM
Last Post: P. Siera
  PinePhone Boots but only Shows Black Screen with Backlight danyeaw 1 681 06-30-2024, 10:18 AM
Last Post: danyeaw
  Pinephone won't boot. spha 13 5,875 05-15-2024, 10:31 PM
Last Post: Richy_T

Forum Jump:


Users browsing this thread: 2 Guest(s)