diff --git a/INSTALL b/INSTALL.md similarity index 69% rename from INSTALL rename to INSTALL.md index 07a088a..4ced26d 100644 --- a/INSTALL +++ b/INSTALL.md @@ -1,17 +1,18 @@ -Compiling and installing Gophernicus -==================================== +# Compiling and installing Gophernicus 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 -any *nix system. +any \*nix system. To compile and install run: +``` $ git clone https://github.com/kimholviala/gophernicus.git $ cd gophernicus $ make $ sudo make install +``` That's it - Gophernicus should now be installed, preconfigured and running under gopher:///. And more often than not, @@ -19,25 +20,23 @@ It Just Works(tm). If gopher links don't seem to work you may need to configure your public hostname explicitly in whatever config file Gophernicus is using. -By default Gophernicus serves gopher documents from /var/gopher -although that can be changed by using the -r parameter. +By default Gophernicus serves gopher documents from `/var/gopher` +although that can be changed by using the `-r ` parameter. To enable virtual hosting create hostname directories under the gopher root and make sure you have at least the primary -hostname (the one set with -h ) directory available -(mkdir /var/gopher/$HOSTNAME). +hostname (the one set with `-h `) directory available +(`mkdir /var/gopher/$HOSTNAME`). -Other installation targets -========================== +## Other installation targets Suppose your server runs systemd, but you'd rather have Gophernicus -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. +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. -Compiling with TCP wrappers -=========================== +## Compiling with TCP wrappers Gophernicus uses no extra libraries... well... except libwrap (TCP wrappers) if it is installed with headers in default Unix @@ -48,52 +47,53 @@ 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 -at the files /etc/hosts.allow and /etc/hosts.deny (because the +at the files `/etc/hosts.allow` and `/etc/hosts.deny` (because the manual pages suck). Use the daemon name 'in.gophernicus' to make your access lists. -Running with traditional inetd superserver -========================================== +## Running with traditional inetd superserver 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 +below line should be added to your `/etc/inetd.conf` and the inetd process restarted. +``` gopher stream tcp nowait nobody /usr/sbin/in.gophernicus in.gophernicus -h +``` The Makefile will automatically do this for you and remove it when uninstalling. -Compiling on Debian Linux (and Ubuntu) -====================================== +## Compiling on Debian Linux (and Ubuntu) The above commands work on Debian just fine, but if you prefer -having everything installed as packages run "make deb" instead -of plain "make". If all the dependencies were in place you'll +having everything installed as packages run `make deb` instead +of plain `make`. If all the dependencies were in place you'll end up with an offical-looking deb package in the parent directory (don't ask - that's just how it works). And instead -of "sudo make install" you should just install the deb with -"dpkg -i ../gophernicus_*.deb" after which It Should Just +of `sudo make install` you should just install the deb with +`dpkg -i ../gophernicus_*.deb` after which It Should Just Work(tm). If you need TCP wrappers support on Debian/Ubuntu, please install libwrap0-dev before compiling. -Cross-compiling -=============== +## Cross-compiling 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. +``` $ make HOSTCC=gcc CC=target-arch-gcc +``` -Shared memory issues +## Shared memory issues ==================== Gophernicus uses SYSV shared memory for session tracking and @@ -107,16 +107,18 @@ to the wrong user. If that happens you can simply delete the memory block and let Gophernicus recreate it - no harm done: +``` $ sudo make clean-shm +``` -Porting to different platforms -============================== +## Porting to different platforms If you need to port Gophernicus to a new platform, please take -a look at gophernicus.h which has a bunch of HAVE_* #defines. +a look at gophernicus.h which has a bunch of `HAVE_*` `#defines`. 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 so we can include them into the next release. + diff --git a/README.md b/README.md index bb2b415..8ce968f 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ daemon. It is licensed under the BSD license. ## Setting up a gopher site -After succesfully installing Gophernicus (see INSTALL) you need to set +After succesfully installing Gophernicus (see [INSTALL](./INSTALL.md)) you need to set up the gopher root directory. By default Gophernicus serves documents from /var/gopher so start by creating that directory and making sure it's world-readable. Then, simply add files and directories under your @@ -96,7 +96,7 @@ By default all gopher menus are automatically generated from the content of the directory being viewed. If you want to have informational text along with the files, or if you want to completely replace the generated menu with your own you need to take a look at -gophermaps. See the file README.gophermap for more information. +gophermaps. See the [README.gophermap](./README.gophermap) for more information. ## Gophertags @@ -113,7 +113,7 @@ littering the file system with spaces and weird characters. ## Personal gopherspaces Gophernicus supports users personal gopherspaces. If a user has -world-readable directory called public_gopher/ under his home, a +world-readable directory called `public_gopher` under his home, a request for `gopher://HOSTNAME/1/~user/` will serve documents from that directory. @@ -292,3 +292,4 @@ Example: accept = :::7070 connect = 127.0.0.1:70 protocol = proxy +