π | Connect Dashboard - DJS Bot - Ubuntu - Apache

Search for a command to run...

No comments yet. Be the first to comment.
How to login to a server via SSH & VScode or Command Prompt

A JavaScript library for building user interfaces What Is React? React is a JavaScript-based UI development library. Meta and an open-source developer community run it. Although React is a library rather than a language, it is widely used in web dev...

Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications. How to setup Kubernetes The central component of Kubernetes is a cluster, which is itself made up of multiple ...

To setup, configure and install the Docker-based, Nginx Proxy Manager so you can manage reverse proxy servers, streams and redirection hosts, follow these steps: Ensure Docker and docker-compose are installed Create a docker-compose file to configur...

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
| Name | IPV4 Adress |
| Subdomain or @ to use the whole domain | your servers IPV4 Adress |

You will need to be able to access your servers terminal for these following steps
$ sudo apt update
$ sudo apt install apache2
List the ufw application profiles by typing:
$ sudo ufw app list
You will receive a list of the application profiles:
Output
Available applications:
Apache
Apache Full
Apache Secure
OpenSSH
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
lsyou should see 000-default.conf

Copying the default configuration
$ cp 000-default.conf dashboard.conf
nano dashboard.conf
Edit the default configuration to the below configuration
<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 yourdomain.com
ProxyRequests On
ProxyPreserveHost On
ProxyPass / http://localhost:8080/ # <-- Change the port if your bot is running on a different port
ProxyPassReverse / http://localhost:8080/
# 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
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
Press
CTRL + XorCommand-Xfor Mac then press Enter to save changesNow run the following command
$ a2ensite dashboard.conf
$ systemctl reload apache2
Setting up our Discord application redirect
Go to https://discord.dev and go to your application -> Oauth2 -> General
Add 2 Redirects with the following contents

Now you should be able to access and login to your bots dashboard!
https://certbot.eff.org/instructions?ws=apache&os=ubuntufocal
Written by River
CEO @ AIO Tech Ltd
CEO @ Seven Seas Hosting