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.
|
2019-07-21 04:37:21 -04:00
|
|
|
Currently, you most likely want version 3.0.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
|
|
|
```
|
2019-06-14 11:43:03 -04:00
|
|
|
$ git clone https://github.com/gophernicus/gophernicus.git
|
2018-01-28 10:55:27 -05:00
|
|
|
$ cd gophernicus
|
2019-08-01 23:53:39 -04:00
|
|
|
$ git checkout 3.0.1
|
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
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
after having set the correct public hostname in the `gophernicus.env`
|
|
|
|
file. If this is wrong, selectors ("gopher links") won't work!
|
|
|
|
|
|
|
|
On \*nix systems, `hostname` might give you an idea, but please
|
|
|
|
note this might be completely wrong, especially on your personal
|
|
|
|
machine at home or on some cheap virtual server. 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.
|
|
|
|
|
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
|
|
|
By default Gophernicus serves gopher documents from `/var/gopher`
|
|
|
|
although that can be changed by using the `-r <root>` parameter.
|
2014-01-25 04:21:40 -05:00
|
|
|
To enable virtual hosting create hostname directories under
|
|
|
|
the gopher root and make sure you have at least the primary
|
2019-04-29 11:15:00 -04:00
|
|
|
hostname (the one set with `-h <hostname>`) directory available
|
|
|
|
(`mkdir /var/gopher/$HOSTNAME`).
|
2014-01-25 04:21:40 -05:00
|
|
|
|
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
## Dependencies
|
2019-04-29 04:21:14 -04:00
|
|
|
|
2019-08-01 23:53:39 -04:00
|
|
|
These were obtained from a base docker installation.
|
2019-04-29 04:21:14 -04:00
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### Ubuntu 18.04, 16.04, Debian Sid, Buster, Stretch, Jessie
|
2019-04-29 04:21:14 -04:00
|
|
|
- build-essential
|
|
|
|
- git
|
|
|
|
- libwrap0-dev for tcp
|
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### Centos 6, 7
|
2019-04-29 04:21:14 -04:00
|
|
|
- the group 'Development Tools'. less is probably required, but
|
|
|
|
I know this works and couldn't be bothered to find out what was
|
|
|
|
actually required.
|
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### Fedora 29, 30, rawhide
|
2019-04-29 04:21:14 -04:00
|
|
|
- the group 'Development Tools'. less is probably required, but
|
|
|
|
I know this works and couldn't be bothered to find out what was
|
|
|
|
actually required.
|
|
|
|
- net-tools
|
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### OpenSuse Leap, Tumbleweed
|
2019-04-29 04:21:14 -04:00
|
|
|
- the pattern devel_C_C++
|
|
|
|
- the pattern devel_basis
|
|
|
|
- git
|
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### archlinux
|
2019-04-29 04:21:14 -04:00
|
|
|
- base-devel
|
|
|
|
- git
|
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### Gentoo
|
2019-04-29 04:21:14 -04:00
|
|
|
- git
|
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### Alpine Linux
|
2019-04-29 04:21:14 -04:00
|
|
|
- alpine-sdk. once again, less is probably required.. blah blah.
|
|
|
|
|
2019-08-01 23:53:39 -04:00
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
### Other installation targets
|
2019-03-31 17:32:21 -04:00
|
|
|
|
|
|
|
Suppose your server runs systemd, but you'd rather have Gophernicus
|
2019-04-29 11:15:00 -04:00
|
|
|
started with inetd or xinetd. To do that, do `make install-inetd`
|
|
|
|
or `make install-xinetd`. Likewise use `make uninstall-inetd` or
|
|
|
|
`make uninstall-xinetd` to uninstall Gophernicus.
|
2019-03-31 17:32:21 -04:00
|
|
|
|
2019-07-16 14:59:54 -04: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
|
|
|
|
installed and don't want wrapper support, run 'make generic'
|
|
|
|
instead of just 'make', and if you have wrappers installed in
|
|
|
|
non-standard place and want to force compile with wrappers
|
|
|
|
just run 'make withwrap'.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2019-07-16 14:59:54 -04:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
## Running with traditional inetd superserver
|
2015-12-29 08:21:36 -05:00
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
If you want to run Gophernicus under the traditional Unix inetd, the
|
|
|
|
below line should be added to your `/etc/inetd.conf` and the inetd
|
2019-03-03 20:43:26 -05:00
|
|
|
process restarted.
|
2015-12-29 08:21:36 -05:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2019-06-14 20:31:02 -04:00
|
|
|
gopher stream tcp nowait nobody /usr/sbin/gophernicus gophernicus -h <hostname>
|
2019-04-29 11:15:00 -04:00
|
|
|
```
|
2015-12-29 08:21:36 -05:00
|
|
|
|
2019-03-31 17:32:21 -04:00
|
|
|
The Makefile will automatically do this for you and remove it when
|
|
|
|
uninstalling.
|
2019-03-03 20:43:26 -05:00
|
|
|
|
2019-07-16 14:59:54 -04:00
|
|
|
|
2019-04-29 11:15:00 -04:00
|
|
|
## Compiling on Debian Linux (and Ubuntu)
|
2014-01-25 04:21:40 -05:00
|
|
|
|
|
|
|
The above commands work on Debian just fine, but if you prefer
|
2019-04-29 11:15:00 -04:00
|
|
|
having everything installed as packages run `make deb` instead
|
|
|
|
of plain `make`. If all the dependencies were in place you'll
|
2014-01-25 04:21:40 -05:00
|
|
|
end up with an offical-looking deb package in the parent
|
|
|
|
directory (don't ask - that's just how it works). And instead
|
2019-04-29 11:15:00 -04:00
|
|
|
of `sudo make install` you should just install the deb with
|
|
|
|
`dpkg -i ../gophernicus_*.deb` after which It Should Just
|
2014-01-25 04:21:40 -05:00
|
|
|
Work(tm).
|
|
|
|
|
2016-01-01 03:12:19 -05:00
|
|
|
If you need TCP wrappers support on Debian/Ubuntu, please
|
|
|
|
install libwrap0-dev before compiling.
|
|
|
|
|
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
|
|
|
```
|
2014-01-25 04:21:40 -05:00
|
|
|
$ make HOSTCC=gcc CC=target-arch-gcc
|
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-07-16 14:59:54 -04: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
|
|
|
|
2019-06-24 11:33:16 -04:00
|
|
|
## Supported Platforms
|
2019-04-29 04:21:14 -04:00
|
|
|
|
|
|
|
| Platform | Versions |
|
|
|
|
| ------------ | ---------------------------- |
|
|
|
|
| Ubuntu | 18.04, 16.04 |
|
|
|
|
| Debian | Sid, Buster, Stretch, Jessie |
|
|
|
|
| Centos | 7, 6 |
|
|
|
|
| Fedora | 29, 30, Rawhide |
|
|
|
|
| Opensuse | Leap, Tumbleweed |
|
|
|
|
| Arch Linux | up to date |
|
|
|
|
| Gentoo | up to date |
|
|
|
|
| Alpine Linux | Edge, 3.9 |
|
2019-06-24 11:33:16 -04:00
|
|
|
| FreeBSD | 12.0 |
|