Composed: 11/1/2021
Updated: 5/21/2025
These are the steps that were necessary to install Apache and configure it to be a reverse proxy for Subsonic & Navidrome on my Pop_OS! 20.04 LTS.
Install Subsonic and/or Navidrome
Forward ports 80 & 443 to the machine running them
Setup a domain name pointed to your public IP address
(Gleaned from this article)
sudo apt update
sudo apt install apache2
sudo systemctl status apache2
Enable Apache mods & disable default sites: (Gleaned from this article & this article)
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo a2enmod ssl
sudo a2enmod rewrite
sudo systemctl restart apache2
cd /etc/apache2/sites-available/
sudo a2dissite 000-default-ssl
sudo a2dissite 000-default
sudo a2dissite default-ssl
sudo systemctl reload apache2
Define your virtualhost(s): (Gleaned from this article)
sudo nano /etc/apache2/sites-available/your_domain.conf
<VirtualHost *:80>
ServerAdmin username@domain.suf
ServerName your_domain_name
#ServerAlias www.your_domain_name
#DocumentRoot /var/www/your_domain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass / http://localhost:port_num/
ProxyPassReverse / http://localhost:port_num/
RewriteEngine on
RewriteCond %{SERVER_NAME} =your_domain_name
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
sudo apache2ctl configtest
cd /etc/apache2/sites-available
sudo a2ensite your_domain.conf
sudo systemctl reload apache2
(Gleaned from this article.)
sudo apt update
sudo apt install snapd
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache
sudo certbot renew --dry-run