# Linode/Forge Hosting

# Create New Block Storage Volume on Linode

This is for NAPCO Central. When you create for a different place, the steps above can be copied and pasted onto the command line. You will need to use sudo in front of the commands. The last command is not something you run as it is. You run nano on that file, and then past that line into the end of the file.

Here are the commands as I ran them below:

sudo mkfs.ext4 "/dev/disk/by-id/scsi-0Linode_Volume_napco-central-backup"

sudo mkdir "/mnt/napco-central-backup"

sudo mount "/dev/disk/by-id/scsi-0Linode_Volume_napco-central-backup" "/mnt/napco-central-backup"

sudo nano /etc/fstab

# Then, I pasted in this line to the end of the file:
/dev/disk/by-id/scsi-0Linode_Volume_napco-central-backup /mnt/napco-central-backup ext4 defaults,noatime,nofail 0 2

cd /mnt/napco-central-backup/

Now you are in the newly created block storage volume.

# Install Apache / FTP

remove default site

install all the php versions you think that you will need

# install apache
sudo apt-get install apache2

# drop into root
sudo su

# stop nginx
service nginx stop

# start apache
service apache2 start

# disable nginx on on start
systemctl disable nginx

# check status of nginx
systemctl list-unit-files | grep nginx

# check status of apache
systemctl list-unit-files | grep apache

# if it is not enabled, set it to enable
systemctl enable apache2

# do a test restart and then check and make sure nginx is not running and apache is
shutdown -r now

# ssh back in and then drop back down into root
sudo su

# Install dependency for certbot
snap install core; snap refresh core

# Install certbot
snap install --classic certbot

# Prepare the Certbot Command
ln -s /snap/bin/certbot /usr/bin/certbot

# Exit root
exit

# change apache to run as forge user and group
sudo nano /etc/apache2/envars


change php fpm config for forge user

restart php fpm

install repo for site in forge user

setup apache virtual host with php fpm setting

# install certifacate on domain
sudo certbot --apache

# install ftp
sudo apt-get install vsftpd

# start ftp service
sudo systemctl start vsftpd

# enable ftp service to start on boot
sudo systemctl enable vsftpd



List Services Commands - https://linuxconfig.org/ubuntu-20-04-list-services (opens new window)

Linode Doc on installing apache - https://www.linode.com/docs/guides/how-to-install-apache-web-server-ubuntu-18-04/ (opens new window)

Digital Ocean article on installing multiple versions of php - https://www.digitalocean.com/community/tutorials/how-to-run-multiple-php-versions-on-one-server-using-apache-and-php-fpm-on-ubuntu-18-04 (opens new window)

Article on installing certbot - https://certbot.eff.org/lets-encrypt/ubuntufocal-apache (opens new window)

Last Updated: 3/25/2021, 6:42:18 AM