Custom Domain

1. Domain Config

Go to your DNS Registrar - E.G, Namecheap, Google Domains, Namecom, etc...

For this example, I will be using Cloudflare.

Locate your DNS Records


Add an "A Record" With the following information

NameIPV4 Adress

Subdomain or @ to use the whole domain

your servers IPV4 Adress


2. Apache Config

SSH into the server running your HTTP website as a user with sudo privileges.

You will need to be able to access your server's terminal for these following steps.

sudo apt update && sudo apt upgrade -y

sudo apt install apache2

List the ufw application profiles by typing:

sudo ufw app list

You will receive a list of the application profiles:

As indicated by the output, there are three profiles available for Apache:

Apache: This profile opens only port 80 (normal, unencrypted web traffic)

Apache Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)

Apache Secure: This profile opens only port 443 (TLS/SSL encrypted traffic)


Enable the following Apache Modules

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests

Restart Apache

sudo systemctl restart apache2

Configuring our webserver

cd /etc/apache2/sites-available

Once you run ls you should see 000-default.conf and any other available configs

Copying the default configuration

sudo cp 000-default.conf dashboard.conf
sudo nano dashboard.conf

Edit the default configuration to the below configuration

  GNU nano 7.2                                                   dashboard.conf                                                             
<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerName mochi.vikshan.me
        ProxyRequests On
        ProxyPreserveHost On

        ProxyPass / http://localhost:8080/
        # <-- Change the port if your bot is running on a different port
        ProxyPassReverse / http://localhost:8080/

        # ServerAdmin webmaster@localhost
        # DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

Press CTRL + X or Command-X for Mac, then press Enter to save changes.

Now run the following command.

sudo a2ensite dashboard.conf
sudo systemctl reload apache2

3. Setting up our Discord application redirect

Go to Discord Dev and go to your application -> Oauth2 -> General.

Add 2 Redirects to your dashboard.

Change http and https depending on whether you have SSL or not!

Now, you should be able to access and log in to your bot's dashboard!



Last updated