Host a Registration Page for Your Private WoW Server

Host a Registration Page for Your Private WoW Server

This post is an addition to something I posted recently: Build a private WoW WotLK server with NPC bots on Ubuntu 22.04. So, you have your own private WoW server running now, and you would like to invite some friends to come and play with you on your realm. That is exactly when this tutorial comes in handy! To streamline the process of creating a user account for your realm, we'll be setting up a simple web page where people can register themselves.

https://i.ytimg.com/vi/NdRK5WWfYp0/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&rs=AOn4CLBFtE55M-57LMf8yuYN76T92mZ5Dg

In order to follow this guide, an important requirement is that you have a domain name pointing to the IP address of the server that you'll be using to host the pages. In this example, I'm using the domain wotlk.servegame.com, which is pointing to the same server where I'm running a private World of Warcraft realm. This is the easiest way to do this, but it is entirely possible to host the pages on a different server if you would prefer.

Please note that I did all this on a server running Ubuntu 24.04. The website that we'll be setting up can run on any web server that supports PHP. This can be, for example, Apache or Nginx, or Lighthttpd, or really any other web server hosting software that works with PHP. The web package does however depend on a couple of modules for PHP that are not installed by default when you install PHP. So, manually installing these modules is very important. If you don't, it simply isn't gonna work. I like Nginx, so I decided to use it in this tutorial since it's arguably the easiest one to set it all up.

Chapters on this page

  1. Installing some requirements
  2. Setting the hostname
  3. Preparing our Nginx web server
  4. Allow traffic for Nginx through the firewall
  5. Enable PHP modules
  6. Certificates
  7. Enable SOAP in worldserver.conf
  8. Create a free hCaptcha account
  9. Setting up the website

For the sake of this tutorial, I used the temporary, dynamic DNS name: wotlk.servegame.com. I want the web files to be in a sub folder of /var/www, so I choose: /var/www/wotlk.servegame.com/web. I'm setting it up on the same server as where my WoW server is running on. This is not required, but it does require you to use different settings as what I'll be showing here. Just use your brains, and all is going to be fine.


1. Installing some requirements

The registration pages require a web server, obviously, like Apache or Nginx with PHP in order to run. I choose to use Nginx because I simply prefer using it. The website we're going to run requires a couple very specific PHP packages, so let's start with installing these. But first we'll add the very popular Ondrej repository, and after we proceed with installing all the required packages.

sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt install git nginx php php-fpm php-cli php-json php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-soap php8.3-fpm php8.3-soap php8.3-gd php8.3-mbstring php8.3-gmp php8.3-curl php8.3-zip php8.3-mysql

We're going to host the web files in a folder under /var/www. So let's create this folder and some subfolders first.

sudo mkdir -p /var/www/wotlk.servegame.com/{web,logs}

The next line will create an index.html page as a temporary placeholder for your website.

echo "Test HTML Page" | sudo tee /var/www/wotlk.servegame.com/web/index.html

I want to see if PHP is working once we're done configuring everything. The easiest way to achieve this is to place a phpinfo.php file in the web root folder that contains PHP code that will show us info on PHP.

sudo nano /var/www/wotlk.servegame.com/web/phpinfo.php

Copy the following bit of code in the phpinfo.php page and save the file:

<?php
phpinfo();
?>

2. Setting the hostname

I always prefer to set the host-name of a server to the domain name I'm using for the server. Skip this step if you want to keep your current hostname.

sudo hostnamectl set-hostname wotlk.servegame.com

Or add an entry in the /etc/hosts file.

sudo nano /etc/hosts

Here's what my hosts file looks like as an example:

127.0.0.1 localhost
127.0.1.1 wotlk.servegame.com wotlk
127.0.0.1 localhost.localdomain localhost

Save the file and let's continue setting up Nginx.


3. Preparing our Nginx web server

The web server Nginx uses the group and user www-data, so we should change the ownership of the hosted files to this.

sudo chown -R www-data:www-data /var/www/wotlk.servegame.com

Now we're going to create a virtual host config file in Nginx for the domain that is pointing to your server. In my case: wotlk.servegame.com

sudo nano /etc/nginx/sites-available/wotlk.servegame.com.vhost

Paste what you see below, but make sure you change the address so it will be your own domain.

server {
listen 80;
# listen [::]:80;
server_name wotlk.servegame.com;
root /var/www/wotlk.servegame.com/web;
index index.php index.html index.htm index.nginx-debian.html;
access_log /var/www/wotlk.servegame.com/logs/access.log combined;
error_log /var/www/wotlk.servegame.com/logs/error.log warn;

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

Perhaps you noticed that line 3 is commented out? Why is that? Well, I'm not using IPv6 on my server, so I had to disable this line to prevent an error in Nginx when reloading it. In case you are using IPv6, go ahead and uncomment this, so your webserver will also listen for requests over IPv6 and not just IPv4. In case you don't know, just try if it works when uncommenting line 3. If it doesn't, then simply restore the comment.

To activate our new configuration, we'll need to create a virtual link from our sites-enabled to our sites-available.

sudo ln -s /etc/nginx/sites-available/wotlk.servegame.com.vhost /etc/nginx/sites-enabled/

Let's do a test first to see if Nginx finds any errors in our config file.

sudo nginx -t

If there are no errors found, we can restart Nginx so it will load the new config.

sudo systemctl restart nginx

4. Allow traffic for Nginx through the firewall

Ubuntu comes default with UFW firewall. We need to let UFW firewall know that traffic to Nginx should be allowed. First, let's see if Nginx is mentioned in the UFW app list.

sudo ufw app list

The following command will instruct your firewall to allow all traffic for Nginx.

sudo ufw allow 'Nginx Full'

5. Enable PHP modules

The next couple of lines will enable a bunch of modules for PHP in our php.ini config file. Once the changes are made, don't forget to restart the php-fpm service. I'm showing this with version 8.3 for PHP, since this is the default version for Ubuntu 24.04 server.

sudo sed -i 's/;extension=gd/extension=gd/g' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/;extension=gmp/extension=gmp/g' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/;extension=curl/extension=curl/g' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/;extension=soap/extension=soap/g' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/;extension=mysqli/extension=mysqli/g' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/;extension=mbstring/extension=mbstring/g' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/;extension=pdo_mysql/extension=pdo_mysql/g' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/8.3/fpm/php.ini
sudo systemctl restart php8.3-fpm

6. Certificates

We're going to need a certificate so we can ensure a safe website. Luckily, Letsencrypt allows us to request a free, valid certificate. There are many ways to achieve this. I'm going to install Certbot through Snap, a method that Letsencrypt advises everybody to use.

sudo apt install snapd -y

This will update Snap to its latest release.

sudo snap install core; sudo snap refresh core

Now install Certbot:

sudo snap install --classic certbot

I prefer to use this little trick, but it is completely optional for you. If you don't know what it does or means, simply skip it then.

sudo ln -s /snap/bin/certbot /usr/bin/certbot

With Certbot installed, we can finally request our free certificate.

sudo certbot --nginx -d wotlk.servegame.com

I always prefer to take a peek after the Nginx configuration was edited by certbot, to make sure all went well.

sudo nano /etc/nginx/sites-available/wotlk.servegame.com.vhost

Do another quick test to see if there are no errors:

sudo nginx -t

And restart Nginx once more:

sudo systemctl reload nginx

For those who are following this guide: You're doing great! We're at least halfway done with the tutorial right now.

At this point you could do a quick check to see if your server is properly configured or not. Simply visit your website in a webbrowser. We created a file that tells us if PHP is enabled, so you might as well view this file at this moment. https://wotlk.servegame.com/phpinfo.php


7. Enable SOAP in worldserver.conf

In case your WoW server is currently online, please make sure that you stop the server before continuing, because we'll need to change a setting in the worldserver.conf

sudo nano /games/wow/wotlk-bots/etc/worldserver.conf

We need to enable the SOAP functionality, so scroll all the way down, or simply search for "soap". Make sure that you set SOAP.Enabled = 1 here. The other two options for SOAP can be left how they are.

Save the worldserver.conf and then you can restart the WoW server again. At this point, it might be a good idea to start the realm manually from the command line, because that allows us to create a new user account for the SOAP protocol on your server. So, once your realm is up and running, use the example below to create a user. This creates an account named SOAP with 'trinity' as the password.

account create SOAP trinity

Feel free to use a different username and password if you prefer. Just make sure you remember what you used, because we'll need it in the next steps.


8. Create a free hCaptcha account

To prevent bots from automatically creating accounts on your registration page, we'll use hCaptcha. Head over to hcaptcha.com and create a free account.

Once you're registered, add a new site to get your site key and secret key. Make sure to choose the "hCaptcha" option and not "hCaptcha Enterprise" since we want the free version.

Copy your site key and secret key - you'll need these for the registration page configuration.


9. Setting up the website

Now we'll install the WoWSimpleRegistration script, which is a fantastic open-source solution for creating WoW server registration pages. It supports multiple server cores including TrinityCore, AzerothCore, AshamaneCore, and CMangos.

First, let's navigate to our web directory and clone the repository:

cd /var/www/wotlk.servegame.com/web
sudo git clone https://github.com/masterking32/WoWSimpleRegistration.git .
sudo chown -R www-data:www-data /var/www/wotlk.servegame.com/web

Now we need to install Composer, which is a dependency manager for PHP:

sudo apt install composer -y

Navigate to the application directory and install the required dependencies:

cd /var/www/wotlk.servegame.com/web/application
sudo composer install

Now we need to configure the registration page. Navigate to the config directory and rename the sample config file:

cd /var/www/wotlk.servegame.com/web/application/config
sudo mv config.php.sample config.php

Edit the configuration file:

sudo nano config.php

Here are the key settings you need to configure:

// Database configuration
$config['db_host'] = 'localhost';
$config['db_port'] = '3306';
$config['db_user'] = 'trinity';
$config['db_pass'] = 'trinity';
$config['db_name'] = 'auth';

// Server core type (TrinityCore, AzerothCore, AshamaneCore, CMangos)
$config['core_type'] = 'TrinityCore';

// SOAP configuration
$config['soap_host'] = 'localhost';
$config['soap_port'] = '7878';
$config['soap_user'] = 'SOAP';
$config['soap_pass'] = 'trinity';

// hCaptcha configuration
$config['hcaptcha_site_key'] = 'YOUR_HCAPTCHA_SITE_KEY';
$config['hcaptcha_secret_key'] = 'YOUR_HCAPTCHA_SECRET_KEY';

// Website settings
$config['site_name'] = 'My Private WoW Server';
$config['expansion'] = '2'; // 2 = WotLK
$config['allowed_characters_per_account'] = '10';

Make sure to replace the placeholder values with your actual database credentials, SOAP credentials, and hCaptcha keys that you obtained earlier.

Save the configuration file and let's test our registration page. Open your web browser and navigate to your domain: https://wotlk.servegame.com

You should now see a beautiful registration page where users can create their own accounts for your private WoW server!

Troubleshooting Common Issues

If you encounter any issues, here are some common problems and their solutions:

  • Blank white page: Check your PHP error logs at /var/log/php8.3-fpm.log and make sure all PHP modules are enabled correctly.
  • Database connection failed: Verify your database credentials in config.php and ensure the MySQL user has proper permissions.
  • SOAP connection failed: Make sure SOAP is enabled in worldserver.conf and your WoW server is running.
  • hCaptcha not working: Double-check your site key and secret key, and ensure your domain is properly registered with hCaptcha.
  • Permissions issues: Ensure all files in /var/www/wotlk.servegame.com/web are owned by www-data:www-data.

Security Considerations

Since this is a public-facing registration page, keep these security tips in mind:

  • Use strong passwords for your database and SOAP accounts
  • Keep your PHP and web server software updated
  • Regularly check your server logs for suspicious activity
  • Consider implementing rate limiting to prevent brute force attacks
  • Use fail2ban to protect against malicious login attempts

Wrapping Up

Congratulations! You now have a fully functional registration page for your private WoW server. Your friends can now visit your website and create their own accounts without needing you to manually create them through the console.

This setup provides a professional, secure, and user-friendly way to manage account creation for your private server. The WoWSimpleRegistration script includes additional features like:

  • Password strength requirements
  • Email verification (optional)
  • Account recovery options
  • Anti-bot protection with hCaptcha
  • Multiple language support
  • Responsive design that works on mobile devices

Remember to regularly update both your server software and the registration page script to ensure you have the latest security patches and features.

Happy gaming with your friends on your private WoW server! 🎮✨


This guide is provided for educational purposes. Please respect Blizzard Entertainment's intellectual property rights.