[gopher] Gophernicus 1.2-beta & virtual hosting
Kim Holviala
kim at holviala.com
Thu Sep 15 13:58:16 UTC 2011
On 14.9.2011 17:10, Walter Vermeir wrote:
>> "The primary vhost directory (set with the -h<HOSTNAME> option) must exist
>> or virtualhosting will be disabled."
>
> What hostname? I understood it as the hostname of the server, not the domainname
FQDN, as in the hostname your users will use to come in. Again, badly
written documentation...
> So with the settng in xinetd at -hvermeir.dyndns.org I created the
> directory /var/gopher/vermeir.dyndns.org
>
> The only result was that vermeir.dyndns.org did serv directly from
> that new directory but also gopher.wikizine.org
OK, now we're talking, it's actually working.
Gopher the protocol doesn't have virtual hosting. What Gophernicus does
is fake vhosting, the kind we used to do in HTTP in ~1997 before
HTTP/1.1 and it's fancy Host: header came along.
The way it works is simple: if a user has visited any virtual domain
before that's where he'll stay. If not, he'll get the default virtual
host menu (in your case /var/gopher/vermeir.dyndns.org). The trick is to
have a generic "directory" page in your default virtual host gophermap.
That way a new user can select the vhost he wants to be in.
Also, if content only exists in one vhost then the user is redirected there.
Example:
gopher://holviala.com/1/~kim/
gopher://gophernicus.org/1/software/
Both resolve to the same IP and are just vhosts in a single server.
Browse around my comics collection and you'll stay under holviala.com,
and do the same for gopher software and you'll stay in gophernicus.org.
However, if you'll wait for your session to expire (or are simply a new
user) AND open up the root selector then you'll *always* land into the
same root menu (as the system doesn't know where you want to be). The
way I solved that was to simply remove the holviala.com root and combine
them into the same gophernicus.org root.
> The gophermap contains only a title of what directroy it is;
> /var/gopher , gopher.wikizine.org , vermeir.dyndns.org
>
> .... and %
That percent sign was just a shorthand way of listing all of your vhosts
in your default landing page (the one that doesn't belong to any vhost).
I admit that the whole vhost feature requires some twisted thinking to
work correctly :-).
Here's my primary landing gophermap. Notice how the domain is
gophernicus.org for everything else except my personal gopherhole.
!Welcome to The Gophernicus Project!
#
# $ figlet -f chunky Gophernicus
#
_______ __ __
| __|.-----.-----.| |--.-----.----.-----.|__|.----.--.--.-----.
| | || _ | _ || | -__| _| || || __| | |__ --|
|_______||_____| __||__|__|_____|__| |__|__||__||____|_____|_____|
|__|
The Gophernicus Project is a one-man mission to modernize gopher,
the precursor of the evil that is WWW. Oh look, shiny windmills!
0The Gopher Archive /archive gophernicus.org
7Browse The Gopher Archive (enter hostname or a full URL)
/archive.q gophernicus.org
1Gophernicus, The Most Awesome(tm) gopher server
/software/gophernicus/server/ gophernicus.org
1Gopher software and patches /software/ gophernicus.org
1Gopher protocol documentation /doc/gopher/ gophernicus.org
1Live gopher statistics of this server /statistics/ gophernicus.org
1My personal gopherhole and contact information /~kim/ holviala.com
=/home/kim/shared/code/gophernicus/server/examples/counter/counter.sh
"We're not counting, but you're visitor number " "."
- Kim
More information about the Gopher-Project
mailing list