From ad0bd3edf9e2bbfbd14bc7cde442974d85de301b Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 26 May 2025 19:40:47 +0100 Subject: [PATCH] Updates 2 --- README.md | 1 - doc/compiling/README.md | 4 +- doc/compiling/linux_server.md | 79 ----------------------------------- 3 files changed, 1 insertion(+), 83 deletions(-) delete mode 100644 doc/compiling/linux_server.md diff --git a/README.md b/README.md index 950b573d3..d49e45a5c 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,6 @@ Compiling - [Compiling - common information](doc/compiling/README.md) - [Compiling on Linux](doc/compiling/linux.md) -- [Compiling a headless Linux server](doc/compiling/linux_server.md) - [Compiling on Windows using Visual Studio](doc/compiling/windows.md) - [Compiling on Windows using MSYS2](doc/compiling/windows_msys2.md) - [Compiling on MacOS](doc/compiling/macos.md) diff --git a/doc/compiling/README.md b/doc/compiling/README.md index ba990ab43..d0d7ea2a8 100644 --- a/doc/compiling/README.md +++ b/doc/compiling/README.md @@ -1,8 +1,6 @@ # Compiling Luanti -- Linux - - [Compiling on Linux](linux.md) - - [Compiling a headless Linux server](linux_server.md) +- [Compiling on Linux](linux.md) - Windows - [Compiling on Windows using Visual Studio](windows.md) - [Compiling on Windows using MSYS2](windows_msys2.md) diff --git a/doc/compiling/linux_server.md b/doc/compiling/linux_server.md deleted file mode 100644 index ea4071772..000000000 --- a/doc/compiling/linux_server.md +++ /dev/null @@ -1,79 +0,0 @@ -# Compiling a headless Linux server - -While a regular Linux client build can be run as a dedicated server using `luanti --server` and give the same experience, a headless server build is useful if you wish to run a Luanti server on a headless system, as it will pull in less dependencies. - -This tutorial assumes your server is running Debian or some derivative. For other distributions, the package names may be different. - -## Building on a separate machine - -It may be useful to build the server on a separate machine from the one you deploy it to. If your host machine runs the same version of Debian as your server (i.e. both are running Debian stable) then you can simply compile there, otherwise you will have to set up a virtual build environment. - -A virtual machine works well even if you are on a Windows host, but if you are on another Linux distribution you may want to use `systemd-nspawn` which can create a more functional chroot-like environment. The following commands will create a base Debian stable root filesystem with `debootstrap` and then run `systemd-nspawn` on it. - -```bash -cd /var/lib/machines -debootstrap --include=dbus-broker,systemd-container --components=main,universe stable debian https://deb.debian.org/debian/ -systemd-nspawn -D debian -``` - -Do note this only works well if your host machine and server has the same architecture. - -## Dependencies - -The base dependencies for a server build are as follows: - -{{% comment %}} cspell:disable {{% /comment %}} - -```bash -sudo apt install g++ ninja-build cmake libsqlite3-dev libcurl4-openssl-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libncurses-dev -``` - -{{% comment %}} cspell:enable {{% /comment %}} - -This dependency list includes cURL for announcing to the serverlist and ncurses for the interactive server terminal (`--terminal`). - -Some further optional dependencies for the server: - -| Dependency | Development package | Runtime package | Purpose | -| ------------ | ------------------- | --------------- | ------------------------------ | -| LevelDB | `libleveldb-dev` | TODO | LevelDB database backend | -| PostgreSQL | TODO | TODO | PostgreSQL database backend | -| Redis | TODO | TODO | Redis database backend | -| Prometheus | TODO | TODO | Prometheus statistics logging | -| Spatialindex | TODO | TODO | Spatialindex AreaStore backend | - -## Build LuaJIT from source - -It is recommended to build LuaJIT from source, as the version found in repositories of Debian-based distributions can be quite old. - -```bash -git clone https://github.com/LuaJIT/LuaJIT luajit -cd luajit -make amalg -``` - -(`luajit` should be a sibling directory to the `luanti` directory cloned below) - -## Download - -Clone Luanti with Git. `-b stable-5` will checkout the latest stable version to build, which may be recommended to run a server for stability reasons over the latest development version. Omitting this will clone the latest development version instead. - -```bash -git clone -b stable-5 --depth 1 https://github.com/luanti-org/luanti.git -cd luanti -``` - -## Build - -Generate a build folder set to build a headless server and not a client, as well as specifying paths to the LuaJIT we built previously. - -```bash -mkdir build; cd build -cmake .. -G Ninja -DBUILD_CLIENT=0 -DBUILD_SERVER=1 -DRUN_IN_PLACE=1 -DBUILD_UNITTESTS=0 \ - -DLUA_INCLUDE_DIR=../../luajit/src/ -DLUA_LIBRARY=../../luajit/src/libluajit.a -ninja -``` - -The resulting server binary can be found at `./bin/luantiserver`. You can move the binary out of the source tree to somewhere cleaner to run your server out of, only other thing that is required to copy over for the server binary to work is the `builtin` folder. - -If you are building on a separate machine from where you would want to run the server, you can run `ninja package` which will package up the server binary along with necessary files into a `.tar.gz` archive that can be deployed onto your server.