Welcome!

Here you will find useful tutorials and guides on how to manage your OTS server.

This guide has multiple sections that will answer most of your questions and explain how to efficiently run your server!

Preinstalled software

The OTS Hosting Service comes with a lot of software preinstalled and preconfigured.

It is based on Ubuntu 24.04 LTS.

A brief overview of preinstalled functionality:

  • nginx web server
  • PHP 8.1 (based on PHP-FPM), serving files from /home/otsmanager/www/public_html
  • MariaDB Server 10 with root access
  • phpMyAdmin interface
  • mysql daily backups in /var/lib/automysqlbackup
  • Compiled and running TheForgottenServer (master branch) in /home/otsmanager/forgottenserver
  • TFS auto-restarter and auto-start utility
  • packages needed to build most TFS versions

Some useful packages and tools are preinstalled as well:

  • mc
  • htop
  • unrar
  • rar
  • zip
  • p7zip
  • git
  • cmake
  • build-essential
  • libgmp3-dev
  • libmysqlclient-dev
  • libboost-system-dev
  • liblua5.2-dev

Important paths

There are a few important configuration files and directories that you may want to know about.

First, as otsmanager, the directory layout is as follows:

  • /home/otsmanager/ is your home directory
  • /home/otsmanager/www/public_html/ is the document root for your website files
  • /home/otsmanager/forgottenserver/ is the default location of where TFS is installed
  • /home/otsmanager/.my.cnf - MySQL client config (contains root password)

At the system level:

  • /etc/systemd/system/tfs.conf is where your TFS systemd service unit file lives
  • /etc/php/8.1/fpm/php.ini - the php.ini file
  • /etc/nginx/sites-available/default - the website vhost configuration file
  • /var/lib/automysqlbackup/ - here daily MySQL backups are stored
  • /etc/mysql/my.cnf - the MySQL server config file

Check out built-in help

  • Most commands offer --help argument, e.g. aptitude --help
  • Most also have a "manual" accessible via man aptitude (replace aptitude with whatever command you want)

What is sudo?

If you prepend sudo to the command invocation, you will run it as "root" user. Some commands require that, such as when installing system packages or managing system service. However, you should NEVER run commands with sudo that you do not understand. You could break your system or allow an attacker into your server!

Common commands:

  • start <unit> (eg. start tfs) - start service (as a user)
  • stop <unit> (eg. stop tfs) - stop service (as a user)
  • restart <unit> (eg. restart tfs) - restart service (as a user)
  • status <unit> (eg. status tfs) - show status for a service (as a user)
  • serverip (otsmanager bash alias) - show server IP
  • duedate (otsmanager bash alias) - show server expiration date
  • mc - midnight commander
  • nano - another file editor
  • df -h - show disk usage
  • du -hs /home - count disk usage for directory /home
  • netstat -lntp - list ports and programs that are listening for TCP connections
  • crontab -e - edit cron jobs
  • sudo <command> - execute as root
  • sudo reboot - reboot whole server
  • sudo systemctl restart nginx - restart nginx webserver
  • sudo systemctl restart mysql - restart MySQL server
  • sudo aptitude - manage system packages
  • sudo aptitude update && sudo aptitude -y full-upgrade - do full system update