ServUO Installation on CentOS/RHEL8

  • Views Views: 46
  • Last updated Last updated:
  • ServUO CentOS/RHEL 8 Tutorial

    This guide intended to cover the installation and setup of ServUO and its dependencies as well as some optional tools to make administration easier on CentOS 8 as well as register it as a system service.

    CentOS is a de-branded, community supported version of Red Hat Enterprise Linux, so the instructions should also work almost, if not verbatim on Red Hat 8. They may also work on other RPM based distros like Fedora or SUSE, but there are no guarantees and modifications may be necessary.

    This guide assumes the following:
    • You have root (or sudo) terminal access of a Linux host running CentOS 8 with internet access
    • You have the required UO client-side files for ServUO to operate and/or possess a means to transfer those files to/from the host if the host is remote. (SFTP/SCP/Samba etc)
    • You have already configured your network adapters with the necessary IP Address(es), gateways and DNS Servers
    • Any intermediate network devices such as routers or firewalls between your server and the desired networks (ie Internet) are already configured to allow connections on TCP Port 2593
    As written, the instructions assume full root access. Prefix them with sudo if needed/desired for your setup. A dedicated "servuo" user for the process to run under may also be created/desired as a best practice. Also, for failsafe reasons, all paths given in instructions will be absolute paths, not relative. All testing was done on a KVM based VM with 2GB of memory.

    Step 1) Install Mono

    These directions are taken directly from the mono project website:
    Code:
    rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
    su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
    yum install mono-complete
    Step 2) Install other dependencies as needed

    Note that some of these may already be installed:

    Code:
    yum install make git zlib zlib-devel tmux unzip
    Step 3 - Deciding where to store ServUO Files

    Choose a parent directory for the "ServUO" Folder to reside. The “ServUO” directory itself will be automatically created during the next Steps. The directory chosen is somewhat user preference, although you should be wary of storing it in certain directories. For more info on reserved directories or the original intended functions of them, you can consult the Unix Filesystem Hierarchy Standard. Also note that some applications do not like spaces in path names. Avoid if possible.

    Common valid choices could be /srv/, /var/ or /opt/. You can also store it inside a user’s home directory, but this may complicate permissions if you have multiple users needing access to it. We will use /srv/ for our example. Use “cd” to change your working directory

    Code:
    cd /srv/
    Step 4A - Retrieve the ServUO Files (Git)

    For the current git revision, you would simply:
    Code:
    git clone https://github.com/ServUO/ServUO.git
    This method should create a new directory called 'ServUO' inside of the current working directory, , ie "/srv/ServUO" (should be the one chosen in step 3) and then download the latest files from the ServUO github.

    Step 4B - Retrieve the ServUO Files (Numbered Release)

    For a numbered release zip file, you could use either wget or cURL on the source code link in github:
    Code:
    wget https://github.com/ServUO/ServUO/archive/56.1.zip
    OR
    Code:
    curl -LJO https://github.com/ServUO/ServUO/archive/56.1.zip
    For a release, you also need to extract the files from the zip.
    Code:
    unzip 56.1.zip
    This method should make a ServUO.XX folder where XX is the release version inside of the current working directory, , ie "/srv/ServUO-56.1" (should be the one chosen in step 3)

    Step 5 - Acquire the necessary UO client files and point ServUO at them

    Go ahead and create a subfolder for your client files inside your ServUO folder.

    Code:
    mkdir /srv/ServUO/Muls
    You don’t need the entire client, a full list of which files are required is in the comments of /srv/ServUO/Scripts/DataPath.cs. If you have local access to the server you can get these off the UO CD or copy them using a flash drive using the mount command.

    If the server is remote, you will need to transfer them somehow, if transferring from a Windows Desktop, WinSCP is an easy, free and secure way to move them with an intuitive graphical interface. Regardless of how, place the required files as mentioned into the newly created /srv/ServUO/Muls/ Directory.

    Now, we need to edit datapath.cfg to point ServUO at these files. nano is an easy to use text editor and should already be included in most distributions. vi and emacs are common alternatives with steeper learning curves.

    Code:
    nano /srv/ServUO/Config/DataPath.cfg
    You should see:

    Code:
    # Uncomment this line and set it to the path of the client files to set a
    # custom data path. Otherwise ServUO will look for the client in the default
    # Windows installation directories. Note that this is *required* when running
    # on non-Windows systems.
    # CustomPath=C:\Program Files (x86)\Electronic Arts\Ultima Online Classic
    Note that you can put either an absolute or relative path here. If using a relative path, it is relative from the perspective of the ServUO.sh we will create later, not the Config folder. A relative path may be preferred for portability reasons if you foresee moving to another system where the paths may change.

    Absolute Path example: CustomPath=/srv/ServUO/Muls

    Relative Path example: CustomPath=./Muls

    Once you have made the changes, CTRL+O will save the file (will prompt for verification) and CTRL+X will quit. These commands and shortcuts are also shown on the bottom bar of the nano text editor.

    Step 6 - Compile the ServUO Core and (hopefully) first successful run.

    Go back to the ServUO directory and type in make. make is a linux utility that will automatically build software according to predefined instructions in a MakeFile. (ServUO distro includes one).

    Code:
    cd /srv/ServUO
    make
    It should build both Ultima.dll and ServUO itself, and if successful, will attempt to run the program for the first time. If any part of this process fails, you can try starting over from scratch by:

    Code:
    make clean
    make
    If, however, ServUO loads fine and begins listening, you should be able to test client connections now. You may need to open up TCP 2593 via
    Code:
    firewall-cmd --zone=public --add-port=2593/tcp
    Client should be able to connect and interact ingame now. Can also test console commands from the terminal. When done with this initial testing, you can go ahead and shutdown the server.

    To run the software again in the future, you don’t need to rebuild the core with make each time. Part of the make process also created a shell script called ServUO.sh that loads the ServUO executable via mono for you.

    To run it, simply enter:

    Code:
    /srv/ServUO/ServUO.sh
    Step 7 (Optional) - Using tmux to manage the ServUO “window”

    You may have noticed that if you logout the vty session, the ServUO process ends. This can be a bit of a pain if you need to do other tasks, or maybe you just don't want to always have keep the ServUO window open. tmux (similar to the old unix screen utility, deprecated as of CentOS 8) utility allows you to attach/detach from certain terminal sessions without closing the programs.

    There are many features to tmux, that are outside the scope of this guide, and I am also relatively new to using it, so we will just cover creating a new named tmux session, starting servuo from it, detaching from it, and then reattaching to it to resume console.

    Simplest method:

    Code:
    tmux new-session -s servuo /srv/ServUO/ServUO.sh
    To detach from the tmux session to do something else or close the vty session, simply CTRL+B, followed by d.

    To reattach:
    Code:
    tmux attach -t servuo

    Step 8 (Optional) - Creating a systemd service to have the service start and stop on system boot
    Incomplete