How to Install SourceBans++ on macOS
SourceBans++ is a powerful administration and ban management system for Source engine-based game servers, such as Counter-Strike: Global Offensive (CS:GO) or Team Fortress 2 (TF2). In this tutorial, we will guide you through the process of installing SourceBans++ on macOS.
Prerequisites
Before we start, make sure you have the following software installed on your macOS system:
- Git
- Apache web server
- PHP
- MySQL
If you don't have any of these software installed, you can install them using Homebrew, a popular package manager for macOS.
- Open Terminal and type the following command to install Homebrew:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- After installing Homebrew, use it to install the required software by running the following commands:
$ brew install git
$ brew install httpd
$ brew install php
$ brew install mysql
Installing SourceBans++
Now that you have the prerequisites installed, let's proceed with the installation of SourceBans++:
- Open Terminal and navigate to the document root of your Apache web server. This is usually located at
/Library/WebServer/Documents/.
$ cd /Library/WebServer/Documents/
- Clone the SourceBans++ repository using Git.
$ git clone https://github.com/sbpp/sourcebans-pp.git
- Rename the
sourcebans-ppdirectory to a name of your choice. For example, if you want to usesbppas the directory name, run the following command:
$ mv sourcebans-pp sbpp
- Open the
config.phpfile located in thesbppdirectory using your preferred text editor.
$ nano sbpp/config.php
- Modify the following settings in the
config.phpfile to match your MySQL database settings:
$config['database']['host'] = 'localhost';
$config['database']['port'] = 3306;
$config['database']['username'] = 'root';
$config['database']['password'] = '';
$config['database']['database'] = 'sourcebans'; // Replace with your database name
Save and close the
config.phpfile.Create a new MySQL user and grant it privileges to create tables and insert data into the
sourcebansdatabase.
$ mysql -u root -p
Enter your MySQL root password when prompted.
> CREATE USER 'sourcebans'@'localhost' IDENTIFIED BY 'your_password_here';
> GRANT ALL PRIVILEGES ON sourcebans.* TO 'sourcebans'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;
Replace your_password_here with a strong password of your choice.
- Import the
sourcebans.sqlfile into your MySQL database.
$ mysql -u root -p sourcebans < sbpp/sb.sql
Enter your MySQL root password when prompted.
- Configure Apache to serve the SourceBans++ directory.
- Open the
httpd.conffile located at/usr/local/etc/httpd/httpd.conf.
$ sudo nano /usr/local/etc/httpd/httpd.conf
- Uncomment the following lines to enable PHP and allow access to the
sbppdirectory:
LoadModule php_module libexec/apache2/libphp.so
Include /usr/local/etc/httpd/extra/httpd-vhosts.conf
- Add the following lines to the end of the
httpd-vhosts.conffile located at/usr/local/etc/httpd/extra/httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents/sbpp/"
ServerName sbpp.local
<Directory "/Library/WebServer/Documents/sbpp/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
- Save and close the
httpd.confandhttpd-vhosts.conffiles.
- Restart Apache to apply the changes.
$ sudo apachectl restart
Open your web browser and navigate to
http://sbpp.local. You should see the SourceBans++ installation page.Follow the on-screen instructions to complete the installation process.
Congratulations! You have successfully installed SourceBans++ on your macOS system.