163 lines
14 KiB
Plaintext
163 lines
14 KiB
Plaintext
|
|
Episode: 444
|
||
|
|
Title: HPR0444: Cherokee And Asyncronous Servers
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0444/hpr0444.mp3
|
||
|
|
Transcribed: 2025-10-07 20:42:26
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
.
|
||
|
|
Hi, my name is Gordon Sinclair, I'm known on IRC as this whole web. This HPR episode
|
||
|
|
is on a lightweight web server that not many have heard of called Cherokee. Now Cherokee
|
||
|
|
is one of a category, a whole category of lightweight web servers. But first of all, I'll
|
||
|
|
read out a part of a wiki page. I'll put a link in the show notes as well. I'll read
|
||
|
|
out a section of a wiki page from Lighty Versus Niggins to sort of explain what I mean.
|
||
|
|
Then I'll talk about it. So from the website, from the wiki, both Lighty and Niggins are asynchronous
|
||
|
|
servers. Niggins in Lighty are probably the two best known asynchronous servers, and Apache
|
||
|
|
is undoubtedly the best known process-based server. The main advantage of the asynchronous
|
||
|
|
approach is scalability. In a process-based server, each simultaneous connection requires
|
||
|
|
a thread which incurs significant overhead. An asynchronous server, on the other hand, is
|
||
|
|
event-driven, and handles requests in a single or at least very few threads. Pulling numbers
|
||
|
|
from thin air for illustrative purposes serving 10,000 simultaneous connections would probably
|
||
|
|
only cause Niggins a few megabytes of RAM, whereas Apache would probably consume hundreds
|
||
|
|
of megabytes of RAM if it could do it at all. Lighty runs a single process with a single
|
||
|
|
thread and non-blocking IO, and Niggins works as one master process, but delegates its
|
||
|
|
work onto worker processes. Now that is from the Lighty Versus Niggins wiki page, which
|
||
|
|
is all included in the show notes. Now, the reason for that to explain that is I wanted
|
||
|
|
a web server that I could run on my desktop computer and only use it when I needed it. I've
|
||
|
|
got an old computer, it's a Pentium 4, which at that in itself isn't a problem, but it's
|
||
|
|
only a 256 mega RAM, which most definitely is a problem. So I've got to be quite careful
|
||
|
|
about switching things on and off and things like that. So I looked at the only server that
|
||
|
|
I really knew was Apache. Apache has lots of modules and patches and plugs for different
|
||
|
|
all sorts of functions. The problem with Apache was when I installed it, I found that
|
||
|
|
just as it explains on that web page, each click would add another process, and that
|
||
|
|
process would be another 20 meg. I would install Drupal, which is a fantastic CMS, I would
|
||
|
|
install Drupal and you go to login to do something, you click on the login button and boom,
|
||
|
|
that's another process started, another 20 meg. You get into the back end of Drupal and
|
||
|
|
you click on one of the options in the control panel to add a new content or something and
|
||
|
|
boom, that's another process of another 20 meg. So before too long, you can see on my computer
|
||
|
|
you can see the RAM going up and up and up, when I was using that. Now that seemed crazy
|
||
|
|
to me because the way I'm not using the server to let anyone else connect it, it's only
|
||
|
|
for my use, the only computer that was going to connect it, it was mine, and that would
|
||
|
|
only be when I was actually working with it. So even although Drupal might be on there,
|
||
|
|
no one else is, it's no use to anyone for these processes to sit and mount up. It doesn't need to
|
||
|
|
be able to handle hundreds of thousands of connections all going to a process, splitting off into
|
||
|
|
different CPUs and all this kind of stuff, it doesn't need any of that. So the other alternative
|
||
|
|
was to have to go for the ZAMP approach, which is basically a one stop click, basically,
|
||
|
|
that you switch on, that you install as a single package, it's from Apache and Friends,
|
||
|
|
I'll include that in the show notes as well. And that's the full kitchen sink stuff, whether
|
||
|
|
you need it or not, it's an FTP, the Apache, MySQL, PHP, Perl, and various modules for who can
|
||
|
|
all that together. And that is basically switched on or off as needed. So I've got that as well.
|
||
|
|
But I wanted a server that I could have switched on all of the time that would only
|
||
|
|
take up resources as and when I was on with a browser open and on localhost and when it actually
|
||
|
|
needed to do something that would be when it would take its resources. And other than that,
|
||
|
|
it would sit there with negligible strain on the system. Now for that, that's when I started
|
||
|
|
looking into, that's when I started looking into different types of servers and alternatives
|
||
|
|
to Apache. And that's where I found out, found us page and found these two differences between
|
||
|
|
them. Now after all that rumbling background, Cherokee is one of a huge list of what they call
|
||
|
|
as asynchronous servers. There's an awful lot of them, I've found niggings as the one that
|
||
|
|
is compared to Lighty, which I don't think is all that light, but it's certainly lighter than
|
||
|
|
Apache. It's probably the best known pirate bay, for example, runs on Lighty. But there's a whole
|
||
|
|
list of asynchronous servers and they're all pretty much light. What I've noticed is because
|
||
|
|
Apache and Lighty are the two that get all the attention. They have the ones that are,
|
||
|
|
they've got all the plugs to different things, different hooks for different services.
|
||
|
|
That's where the lighter servers don't seem to have as many modules and it's maybe a bit more
|
||
|
|
awkward to get different things running on them. I don't see me having as many options.
|
||
|
|
But however, that all aside, I'll leave you to look into other asynchronous servers if that's
|
||
|
|
what you want. But what I'm going to talk about after that preamble is a server called Cherokee,
|
||
|
|
which runs, I've got it running right now in my system and it's lucky to take up two megabytes
|
||
|
|
of RAM sim there. It's fantastic. It's really, really light. On an old system, you don't even
|
||
|
|
notice it's there and that's running a desktop as well. I feel good desktop knowing that when I open
|
||
|
|
my browser and go to a local host, boom, it's there, it's running. Not only that, it's hooked up
|
||
|
|
to CRPHP as well. It can be hooked up to run MySQL and all that as well. It's not a problem.
|
||
|
|
I can do all that. Now, what is Cherokee? First of all, the website is Cherokee Project.
|
||
|
|
There's no comments. Cherokee Project.com. It's a bit unusual in the way that you configure it
|
||
|
|
and you administer it. The way to do that is at the command line, basically, it does know
|
||
|
|
usually servers have a config file somewhere, an XA or whatever, but this generates it's own.
|
||
|
|
It's a little bit different. Let's see if I can remember what the command is.
|
||
|
|
I've been trying, I've been recorded this a few times and I've been trying to think how to explain
|
||
|
|
all right, there we go. As I say, I've recorded this quite a few times now and trying to get how
|
||
|
|
to explain the differences between the servers and how to set out this episode. The one thing I've
|
||
|
|
forgotten, I forgot to put my notes, was how to start the Admin. Anyway, I found that. That sort of
|
||
|
|
caught me off guard there. It's, it's at least the runner's route. So in my case, I'm in Crunchbang,
|
||
|
|
so it's pseudo-space Cherokee-Admin at the command line. Now, that doesn't take you into
|
||
|
|
the Admin part itself. What it does do is it opens the service as it opens the Admin section.
|
||
|
|
It switches that on a localhost, colon, or port, 9090. That's, you've got to go onto the website,
|
||
|
|
onto the one-year browser and go to localhost, colon, 9090. That'll open the Admin page.
|
||
|
|
It also will be required to log in. Now, what this does, not only it starts, but it runs the Admin
|
||
|
|
page. It switches it on to that port, but it also gives it a temporary one-off password,
|
||
|
|
which you then copy and paste into the browser. And that, as I said, that's a one-off password.
|
||
|
|
As soon as you close the terminal, close that, that tab or that window in the terminal,
|
||
|
|
it closes, it switches off that Admin function. So you've got to, that's how to get into the Admin
|
||
|
|
section anyway. And it's all Admin started via Ague. From there, you can set up, you can teach it,
|
||
|
|
or add things like PHP so that it recognizes PHP and can run PHP applications. That's where they
|
||
|
|
do it. Now, you can set, you can change the default home folder for that server, you can create
|
||
|
|
set up virtual servers. It's actually quite advanced when you get into that.
|
||
|
|
So anyway, that's the Cherokee Admin. I'm going to put a link to how to forge as well.
|
||
|
|
I found that was the first place I found when looking into how to set up Cherokee
|
||
|
|
and how to get it configured with PHP. And my sequel, and they've got quite a few tutorials on
|
||
|
|
how to get it set up on different Linuxies, basically. I found that Cherokee have their own
|
||
|
|
have their own PPA as well. That's where I installed from, is their own PPA at Launchpad.
|
||
|
|
That means you'll always get the latest and greatest from them, which is what I've done.
|
||
|
|
One thing to note that mic quality problems, depending on which version of Cherokee you're running,
|
||
|
|
or which, if you're running it from the repos of your own distribution, there might not be the
|
||
|
|
latest ones. As a program to watch out for, or something to watch out for, a spawn CGI.
|
||
|
|
Now, spawn CGI is something that was included in Lighty. That was something that was built into Lighty.
|
||
|
|
At one point, one of the tutorials instructed you to install Lighty because it needed that particular
|
||
|
|
part of it. Not to run Lighty, you had to install it, and then specifically tell it not to run
|
||
|
|
because you only wanted that one part of it. Now, I've noticed that recently that's been spun off
|
||
|
|
and it's now included in the Cherokee PPA. It should include that. If you collect the install Cherokee,
|
||
|
|
it should include that. If it doesn't, make sure you include that. That's basically a lightweight
|
||
|
|
CGI program. The theory is it's supposed to be able to handle PHP. Now, even although mine is set
|
||
|
|
up to PHP, it's set up to be handled by a spawn CGI. It still runs. It still needs PHP 5 CGI to
|
||
|
|
actually run. It's PHP 5 that's still doing the processing. I'm not quite sure how that works.
|
||
|
|
I would love some feedback on that because PHP 5 is another little boost in the RAM that I could
|
||
|
|
use to tweak to trim off if I possibly can. But anyway, there's that. Now, Cherokee
|
||
|
|
is, remember I said that the Niggins works as one master process, but delegates work to other
|
||
|
|
worker processes. Cherokee is the same thing. Cherokee Admin is the Admin process that runs.
|
||
|
|
I've already mentioned that. But when it's actually doing its work and when it's serving its web pages,
|
||
|
|
it's Cherokee Worker. It's Cherokee Worker that you'll see in the logs. That's what's running
|
||
|
|
your, serving your pages. So, after that, I don't know how much sense that I made because I've tried
|
||
|
|
to record this several times now and I keep sort of getting a bit flustered trying to figure out
|
||
|
|
I know what it is I'm trying to explain, but thinking of ways to explain it in order to put it in
|
||
|
|
and you know, anyway. So, after you've got that, that basically allows you to run an extremely
|
||
|
|
lightweight web server on your computer. Now, as I say, I happen to use it on the same machines
|
||
|
|
my desktop. The majority of the machine is running the desktop. I've got my Zim working
|
||
|
|
open with my notes. I've got Firefox 3.5, open with the the Light-A page
|
||
|
|
or the Light-A version of Niggins work. My machine is a desktop. That's what it's for,
|
||
|
|
but it also runs, it's also running as a server as well when I want to go to a local host.
|
||
|
|
Now, it has the reason for this rather than just serving a blank page. It allows you to have PHP
|
||
|
|
stuff and there's a three applications that I'm going to mention which are flat file PHP
|
||
|
|
applications. They don't need the MySQL daemon running. So, even if you just if you just install
|
||
|
|
a Cherokee and the PHP interpreter, that's all you need and you can have your very own
|
||
|
|
wiki for taking notes. You can dock your wiki as used by a lot of websites now.
|
||
|
|
I heard a bit of that on Linux basement. Chad uses dock your wiki for his wiki and it's
|
||
|
|
best brilliant. It's it's very, very advanced. It's a full-blown wiki and it runs its flat files.
|
||
|
|
All you need is PHP. So, you can use that as a note taker or whatever you want.
|
||
|
|
Another one is one that a few people see me have heard of. It's Nano-CMS.
|
||
|
|
Now, this is a it's a content management system along the lines of Drupal, albeit it hardly,
|
||
|
|
it doesn't know it hardly has any plugins or add-ons or anything like that. But what it is,
|
||
|
|
it's a flat file wiki, a flat file CMS. So, that's that itself is quite unusual. It's
|
||
|
|
everything's theme above, of course. So, I'll put the the link to the show notes and for both of
|
||
|
|
these, link to these in the show note scene. And the other one is, I've not actually tried it yet,
|
||
|
|
but it happened to be ghosting in the IRC and I saw a quick glimpse of a conversation between,
|
||
|
|
I believe it was monster being called, to mentioning flatpress. And flatpress is,
|
||
|
|
it's a flat file PHP block, plugins offer. Now, the beauty of all these is you don't need a
|
||
|
|
database. All you need is PHP and a web server that can interpret it. So, this works ideal. If you
|
||
|
|
want something that's really lightweight in my case, sitting as a sort of as an additional process
|
||
|
|
on desktop, or if you've got a really on old machine that you're sitting and it's not really
|
||
|
|
doing anything, it doesn't, it's not really that much power in it. You could set up Cherokee with
|
||
|
|
any of these applications. CMS, CMS are a blog, a wiki. When docky wiki has got all sorts of
|
||
|
|
modules and plugins that can turn on air, they can serve us at a blog, for example, as well.
|
||
|
|
But it gives it opens up new options with with little resources, basically, that's what I'm trying
|
||
|
|
to say. So, that is, I think I'm going to call it a day there. Yeah, I think that'll be it for today.
|
||
|
|
So, this rather incoherent episode, I'll do a apologise to say, I'm getting that explanation
|
||
|
|
at the start, proved to be quite a bit more difficult than I actually thought, when I thought
|
||
|
|
about doing this episode. So, anyway, I'm going to call it a day at that. Thanks for listening.
|
||
|
|
My name is Gordon Sunkler. I am known on the IRC SSL web, and the last shameless plug-all-up,
|
||
|
|
the last few days I've finally got my blog up and running. So, if you want to visit that,
|
||
|
|
it's thistleweb.co.uk. If you want to contact me, my emails changed as well to reflect that.
|
||
|
|
It's now Gordon at thistleweb.co.uk, although my previous ones have still reached me as well.
|
||
|
|
So, that's it, and thanks for listening.
|
||
|
|
Oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh, oh
|
||
|
|
Thank you for watching!
|