2019-04-29 11:15:00 -04:00
|
|
|
# Compiling and installing Gophernicus
|
2014-01-25 04:21:40 -05:00
|
|
|
|
|
|
|
Gophernicus requires a C compiler but no extra libraries aside
|
|
|
|
from standard LIBC ones. Care has been taken to use only
|
|
|
|
standard POSIX syscalls so that it should work pretty much on
|
2019-04-29 11:15:00 -04:00
|
|
|
any \*nix system.
|
2014-01-25 04:21:40 -05:00
|
|
|
|
2019-07-16 15:10:39 -04:00
|
|
|
Please make sure that you checkout to the correct version you want.
|
2021-01-02 20:39:23 -05:00
|
|
|
Currently, you most likely want version 3.1.1.
|
2019-07-16 15:10:39 -04:00
|
|
|
|
2014-01-25 04:21:40 -05:00
|
|
|
To compile and install run:
|
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2021-01-02 20:39:23 -05:00
|
|
|
$ git clone -b 3.1.1 https://github.com/gophernicus/gophernicus.git
|
2018-01-28 10:55:27 -05:00
|
|
|
$ cd gophernicus
|
2020-12-22 19:48:42 -05:00
|
|
|
$ ./configure --listener=somelistener
|
2014-01-25 04:21:40 -05:00
|
|
|
$ make
|
2019-07-16 14:59:54 -04:00
|
|
|
$ sudo make install
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2014-01-25 04:21:40 -05:00
|
|
|
|
2020-12-22 19:48:42 -05:00
|
|
|
Important configure arguments include:
|
|
|
|
|
|
|
|
- `--listener`. This is the only required argument. You must
|
|
|
|
choose a listener that passes network requests to
|
|
|
|
gophernicus, as gophernicus dosen't do this by itself. The
|
|
|
|
options are:
|
|
|
|
- systemd, a common init system on many Linux distributions
|
|
|
|
that can do this without an external program.
|
|
|
|
- inetd, an older, well-known implementation that is very
|
|
|
|
simple.
|
|
|
|
- xinetd, a modern reimplementation of inetd using specific
|
|
|
|
config files.
|
|
|
|
- mac, to be used on Mac OSX machines.
|
|
|
|
- haiku, to be used on Haiku machines.
|
|
|
|
- autodetect, which looks at what you have avaliable
|
|
|
|
(unrecommended, please manually specify where possible).
|
|
|
|
- `--hostname`. This is by default attempted to be autodetected
|
|
|
|
by the configure script, using the command `hostname`. It is
|
|
|
|
expected to be the publicly-accessible address of the server.
|
|
|
|
However, this might be completely wrong, especially on your
|
|
|
|
personal machine at home or on some cheap VPS. If you know you
|
|
|
|
have a fixed numerical IP, you can also directly use that.
|
|
|
|
For testing, just keep the default value of `localhost` which will
|
|
|
|
result in selectors working only when you're connecting locally.
|
|
|
|
- `--gopherroot`. The location in which your gopher server will
|
|
|
|
serve from. By default is `/var/gopher`. Also can be changed
|
|
|
|
later using the `-r <root>` parameter in configuration files.
|
2019-06-24 11:33:16 -04:00
|
|
|
|
2015-12-29 08:21:36 -05:00
|
|
|
That's it - Gophernicus should now be installed, preconfigured
|
|
|
|
and running under gopher://<HOSTNAME>/. And more often than not,
|
2019-06-24 11:33:16 -04:00
|
|
|
It Just Works(tm).
|
2014-01-25 04:21:40 -05:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
## Compiling with TCP wrappers
|
2016-01-01 03:12:19 -05:00
|
|
|
|
|
|
|
Gophernicus uses no extra libraries... well... except libwrap
|
|
|
|
(TCP wrappers) if it is installed with headers in default Unix
|
|
|
|
directories at the time of compiling. If you have the headers
|
2020-12-22 19:48:42 -05:00
|
|
|
installed and don't want wrapper support, too bad (for now, see
|
|
|
|
issue #89).
|
2016-01-01 03:12:19 -05:00
|
|
|
|
|
|
|
For configuring IP access lists with TCP wrappers, take a look
|
2019-04-29 11:15:00 -04:00
|
|
|
at the files `/etc/hosts.allow` and `/etc/hosts.deny` (because the
|
2019-06-24 11:33:16 -04:00
|
|
|
manual pages suck). Use the daemon name "gophernicus" to
|
2016-01-01 03:12:19 -05:00
|
|
|
make your access lists.
|
|
|
|
|
2020-12-22 19:48:42 -05:00
|
|
|
## Distributions
|
2019-07-16 14:59:54 -04:00
|
|
|
|
2020-12-22 19:48:42 -05:00
|
|
|
### Debian (and -based) (including Ubuntu) distributions
|
2016-01-01 03:12:19 -05:00
|
|
|
|
2020-12-22 19:48:42 -05:00
|
|
|
We used to distribute a `debian/` directory for people to `make
|
|
|
|
deb` and then install a deb. However, thanks to the work of
|
|
|
|
Ryan Kavanagh, gophernicus will be distributed in the official
|
|
|
|
debian repositories in the next stable release! In the interim,
|
|
|
|
either keep using the old version or install without deb.
|
2019-07-16 14:59:54 -04:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
## Cross-compiling
|
2014-01-25 04:21:40 -05:00
|
|
|
|
|
|
|
Cross-compiling to a different target architecture can be done
|
|
|
|
by defining HOSTCC and CC to be different compilers. HOSTCC
|
|
|
|
must point to a local arch compiler, and CC to the target
|
|
|
|
arch one.
|
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2020-12-22 19:48:42 -05:00
|
|
|
$ export HOSTCC=gcc CC=target-arch-gcc
|
|
|
|
$ ./configure ....
|
|
|
|
$ make
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2014-01-25 04:21:40 -05:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
## Shared memory issues
|
2014-01-25 04:21:40 -05:00
|
|
|
|
|
|
|
Gophernicus uses SYSV shared memory for session tracking and
|
|
|
|
statistics. It creates the shared memory block using mode 600
|
|
|
|
and a predefined key which means that a shared memory block
|
|
|
|
created with one user cannot be used by another user. Simply
|
2019-06-14 20:31:02 -04:00
|
|
|
said, running gophernicus under various different user
|
2015-12-31 02:30:39 -05:00
|
|
|
accounts may create a situation where the memory block is locked
|
|
|
|
to the wrong user.
|
2014-01-25 04:21:40 -05:00
|
|
|
|
|
|
|
If that happens you can simply delete the memory block and
|
2015-12-31 02:30:39 -05:00
|
|
|
let Gophernicus recreate it - no harm done:
|
2014-01-25 04:21:40 -05:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2015-12-31 02:30:39 -05:00
|
|
|
$ sudo make clean-shm
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2014-01-25 04:21:40 -05:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
## Porting to different platforms
|
2014-01-25 04:21:40 -05:00
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
If you need to port Gophernicus to a new platform, please take a look at
|
|
|
|
gophernicus.h which has a bunch of `#define HAVE_...` Fiddling with those
|
|
|
|
usually makes it possible to compile a working server.
|
|
|
|
If you succeed in compiling Gophernicus to a new platform please send
|
|
|
|
the patches to <gophernicus at gophernicus dot org> so we can include
|
2019-07-01 02:31:13 -04:00
|
|
|
them into the next release -- or even better, commit them to your fork
|
|
|
|
on Github and make a pull request!
|
2019-04-29 04:21:14 -04:00
|
|
|
|
2020-12-22 19:48:42 -05:00
|
|
|
## For packagers
|
|
|
|
|
|
|
|
Are you looking to package gophernicus for a Linux
|
|
|
|
distribution? Thanks! Please see issue #50 to help. Some tips:
|
|
|
|
|
|
|
|
- Hostnames will need to be configured by users at runtime, the
|
|
|
|
installed gophernicus.env will need to be a config file.
|
|
|
|
- You probably want to support as many listeners as possible.
|
|
|
|
We allow this through the use of a comma seperated list to
|
|
|
|
`--listener`.
|
|
|
|
- The default gopher root is `/var/gopher`; many disributions
|
|
|
|
prefer `/srv`.
|