Atavism WordPress Server Install – Secured

Only use this process if you are installing your website on a remote server from your game server. You already configured this for the game server, if this is a Local Server install, skip this step. 

Create the SSH tunnel and then start it. SSH Public Key Authentication

 

ssh-copy-id –i /home/ubuntu/.ssh/id_ed25519.pub websiteuser@remoteserverip-fqdn

*note if you secured your external server already, this won’t work. You will need to manually copy your ssh key from the webservers ubuntu user into the /home/websiteuser/.ssh/known_keys file on the game server. 

 

 

sudo vim /etc/systemd/system/autossh-mysql-tunnel.service

 

[Unit]
Description=AutoSSH tunnel service MySQL on local port 3308
After=network.target

[Service]
Environment=“AUTOSSH_GATETIME=0”
ExecStart=/usr/bin/autossh -M 0 -o “ServerAliveInterval 30” -o “ServerAliveCountMax 3” -NL 3308:localhost:3306 ub****@******************vh.ca

[Install]
WantedBy=multi-user.target

 

sudo systemctl daemon-reload

Start the Autossh service:

 

sudo systemctl start autossh-mysql-tunnel.service

Enable at boot:

 

sudo systemctl enable autossh-mysql-tunnel.service

Check status with:

 

sudo systemctl status autossh-mysql-tunnel

 

Stop the Autossh service:

 

sudo systemctl stop autossh-mysql-tunnel.service