How to Install SourceBans++ on FreeBSD

SourceBans++ is an open-source web-based ban management system designed for game server administrators. In this tutorial, we will guide you through the steps to install the latest version of SourceBans++ on FreeBSD.

Prerequisites

Before proceeding, make sure you meet the following requirements:

Step 1: Update Your System

The first step before installing SourceBans++ is to update your FreeBSD system to the latest packages. Run the following command:

sudo pkg update
sudo pkg upgrade

Step 2: Install Required Dependencies

To install SourceBans++, we need to install some required dependencies. Run the following command:

sudo pkg install build-essential cmake git mysql57-client pcre libssh2 libcurl libxml2 libzip openssl

Step 3: Download and Install SourceBans++

Now we need to download and install SourceBans++. Run the following commands:

cd /usr/local/www/apache24
sudo git clone https://github.com/sbpp/sourcebans-pp.git
cd sourcebans-pp
sudo git submodule update --init --recursive
sudo mkdir public/cache
sudo chown -R www:www public/cache
cd build
sudo cmake ..
sudo make
sudo make install

Step 4: Configure SourceBans++

Now that we have installed SourceBans++, we need to configure it to work with our environment. Here's how to do it:

  1. Rename the config/database.php.dist file to config/database.php.
sudo mv config/database.php.dist config/database.php
  1. Open the config/database.php file in a text editor and replace the values to match your MySQL database information.
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'sourcebans',
  1. Save the changes and exit the file.

Step 5: Setup Apache Virtual Host

To access SourceBans on a web browser, we need to create an Apache virtual host. Run the following command to create a new configuration file in the /usr/local/etc/apache24/Includes/ directory:

sudo nano /usr/local/etc/apache24/Includes/sourcebans-pp.conf

Copy and paste the following content:

<VirtualHost *:80>
    ServerName your-domain-or-ip       # Replace with your domain name or IP address
    DocumentRoot /usr/local/www/apache24/sourcebans-pp/public/
    ErrorLog /var/log/httpd/sourcebans-pp_error.log
    CustomLog /var/log/httpd/sourcebans-pp_access.log combined

    <Directory "/usr/local/www/apache24/sourcebans-pp/public/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Save the changes and exit the file.

Step 6: Enable and Start Apache and MySQL

Enable and start Apache and MySQL services using the following commands:

sudo sysrc apache24_enable=YES
sudo service apache24 start

sudo sysrc mysql_enable=YES
sudo service mysql-server start

Step 7: Access SourceBans

You can now access your SourceBans installation by opening your web browser and navigating to your domain name or IP address. If everything went smoothly, you should see the SourceBans login page.

Conclusion

In this tutorial, you have learned how to install and configure SourceBans++ on FreeBSD. You can now start managing bans and other related features for your game server. If you encounter any issues during the installation process, please consult the official SourceBans++ documentation or seek help from the community.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!