Help: a minimal VPS Gemini server with CGI
I am considering getting an OVH VPS for $5/month to run a Gemini server. I have many questions, and appreciate your feedback.
Which servers supports CGI and are minimal/easy to manage? Preferably written in C.
Can I generate a certificate for Gemini or do I need to buy one somewhere?
I would like to avoid registering a domain name and OVH gives you a permanent IP address. Is that workable?
Anything else you can think of I should look into?
Aug 23 · 4 months ago · 👍 fab
33 Comments ↓
@stack You may be philosophically opposed to the idea but my site is running on an Ubuntu VM in the Google "free tier" for less than a dollar a month. The IP is static. It's not particularly beefy: 2 cores, 1 gb of ram and 10 gb of storage. I first set it up as a web server so I paid for a cert (I didn't know about Let's Encrypt at the time). When I later shoehorned in a Gemini server, I used the same cert but could have generated a new one (for free). At the time, Google Domains was still a thing so that was covered as part of the $300 free tier "credit". They later transferred the domain business to Squarespace so you would probably have to pay someone to register your domain.
As a server I can recommend gmid but CGI is a bit tricky (especcialy on Linux I believe), because you need fcgiwrap as a wrapper for fastCGI, which can be difficult to configure for gmid on Linux.
For a DNS name you could register a DynDNS at a free provider like "nsupdate.info" and set the IP for it and never change it.
As a cert I'm not sure if it works with a raw IP address, but if you use the above service, you can create a self signed cert with the registered DNS address and a expiration date far in the future.
If you heavily rely on CGI you should probably not use gmid and look for something which supports CGI out of the box.
If I have time I'll probably write a simple server or mangle an existing one to run the games in-process -- CGI overhead seems pretty dumb and spinningnupna process so wasteful...
@stack: what's your (nomen omen) stack?
I mean, what the CGI is written in?
(I'm asking, cause imo, it's much easier to turn CGI into SCGI or FastCGI, rather than hacking around server process)
as for ovh itself, TBH, I cannot recommend them, they're overselling hard. IMO better options are contabo and/or netcup.
(that's likely not your case, but on netcup you can also get ARM vps)
@stack Molly Brown (written in go by solderpunk) with (S)CGI works well for me. I have some C code which might help with converting to SCGI. You'll need to register a domain name or use a DynDNS (or potentially get someone to point a subdomain they control to your server, e.g. you'd be welcome to sb.thegonz.net). Definitely generate your own certificate; here's a recipe for that:
openssl ecparam -genkey -name prime256v1 > my.key && openssl req -key my.key -subj "/CN=example.net" -addext "subjectAltName = DNS:example.net" -new -x509 -days 2000000 -out my.crt
My games are currently written in C and are tiny. Spinning up a process and juggling environment variables likely takes up much of the work, and having to open the game file and look up the user in the 'database' is likewise an idiotic waste of effort.
I know no one gives a hoot about these things, but it makes so much sense to keep this in-process. A specialized gemini server does not seem like much code; I've written compilers and video compressors.
It is a compulsion of mine, I know, and on a VPS I am sure swapping dominates all overhead, but it makes me less serene than normal (which is not very)...
I like OVH because of the flat billing structure. With 0.00000031 cents per byte transfered, depending on region etc. I would always wonder if some botnet attack will result in a $70,000 month.
Contabo is weird! They keep talking about low tier <$5.00 a month. Their pages show a vps for euro 4.51, but when I clicked it, it changed to 5.36. It did that a couple of times, then stayed at 5.36. I've never been there before, so it's not a stale page; maybe some on-demand pricing or some AI decided I can afford it?
their pricing depends on time (the longer the time, the lower the fee), but this is only visible at a later step.
No, I mean I was literally looking at the price changing on the same page
yeah, I'm guessing they're displaying "lowest" (12mo) and then dynamically changing it to 1mo.
Not the greatest idea, but never had issues with them.
Their <$5 tier is substantially less than OVH -- 2GB Ram, I don't know if debian or ubuntu would fit in that anymore... I don't need much but the os may. I didn't see the one pictured. Need to use a real computer, doing this on a phone sucks
@stack With SCGI you don't need to fork, you can have a single process reading requests from a socket. Not sure how much more you'd gain by writing a dedicated server.
and depending on the Gemini server you might be able to use unix sockets for communication with scgi.
Although by the time you have a well-behaved domain socket client written, you could have made a specialized gemini server without any IPC
@stack My opinion means nothing but I've been hosting a combined web/gemini server (written in Java no less) with CGI support and a server side scripting API in 1GB of RAM on Ubuntu for nearly two years with no issues.
I think 2 GB is plenty for a base system and deps to run a Gemini server. You won't even need to slim it down.
I guess without a GUI you need a lot less. The damned browser needs gigabytes.
I would be comfortable running a headless system in 512MB of RAM. Biting my nails the whole time but still
“CGI” is up to your gemini server. You can just as easily program your entire capsule in C and write a listener.
Do not buy a certificate or use one from certbot.
You will learn the hard way – as many have – that this is retarded when every single person visiting your capsule starts getting errors. Gemini is TRUST ON FIRST USE. When the certificate changes, THAT is when it is assumed something is compromised. It is not dependent on a certificate authority like the Web.
Any VPS will work fine for your purposes because gemini is very lightweight and the amount of traffic here is smaller than the web.
Good luck and ask any questions you have. We are eager to help.
tl;dr
The Elites don't want you to know this but certificates are free. You can generate them. I have generated 458 certificates. [alexjones.jpg]
I had no idea there were so many cheap vps providers. like a dollar a month. But chances are they will suck as bad as the tildes i've been using...
I pay something like $45 for two years through CrunchBits. 3 cores, 80GB SSD space. It’s had one week of downtime in four years when the node broke and they needed parts, but still no data loss.
I’ve been very happy with it.
crunchbits: unable to order -- out of stock?
ionos -- order page does not load fully, gave up
oracle: could not find what I wanted and gave up after a few minutes. Don't really want to deal with Oracle-flavored everything.
google: would never give them my credit card.
Gah. The more I look the more my eyes glaze over and I think to myself: my requirements are so close to 0 as to be a rounding error. It's almost as someone should pay _me_ for the headache. I am giving up for today.
Check the old LowEndBox site. They still post lots of VPS deals in the range of $15-$30 /year.
Watch out. All the lowendbox deals seem to be 'specials', like $150/yr with a $120 first year discount.
I almost signed up following another link talking about a $2.25/mo deal, put in a credit card, but noticed last-minute that it was $28/mo, not per year...
Woah. Be careful! I’ve never seen a switch like that.
They most definitely are not *all* like that. I grabbed one linked from them through HudsonValleyHost that was something like $18/yr paid in full with recurring discount. Used it for a while.
Have used a number of their advertised plans over the years and never seen anything like what you described unless it was a link to an offer that already ended.
If you are sure they tried to bill you $28/mo you should report it to the site so hopefully they never advertise that VPS again.
I think it was mostly my ADHD. I followed a link from a very old reddit thread and was not paying attention.
That sounds very possible. If it was any ad from the actual LowEndBox site in the last 30 days that would be wild. But something advertised years ago the price could be anything today.
I just tried to sign up with netcup (German), but received an email that I am required to verify my identity using a device with a camera. So much for this low-priced option.
DigitalOcean?
I thought I'd give Oracle a try -- tired of dicking around with unknown clowns. But oracle.com seems to be down for the last hour! They are aware of the issue, thank god.
Spent a couple of hours trying to set up an Oracle account. Between the server going down and being rejected for no real reason, tried 3 times. Now there is an open ticket and they will get back to me within 48 hours. Great. I really didn't want to deal with that ****hole, but a free tier got the better of me.
So now 3 random places have my credit card to be leaked at some future date, and I got absolutely nothing.
Just in case you're still shopping for a VPS....
I'm happy with my $2/mo RackNerd VPS. They have specials going on all the time like this 1 vCPU/1 GB RAM/20 GB SSD for $10.96/yr:
That should be way more than enough to run a small Gemini site, or even a small Web site if you care for that.