Skip to content

Instantly share code, notes, and snippets.

@asamofal
Last active December 6, 2018 08:39
Show Gist options
  • Save asamofal/1a228179ec9316243c9cfc77a67db1f2 to your computer and use it in GitHub Desktop.
Save asamofal/1a228179ec9316243c9cfc77a67db1f2 to your computer and use it in GitHub Desktop.
# remove access via domain.com/phpmyadmin
nano /etc/phpmyadmin/apache.conf
#Alias /phpmyadmin /usr/share/phpmyadmin
# create new virtualhost for subdomain:
nano /etc/apache2/sites-available/pma.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName pma.demo-itmaster.com
ServerAlias pma.demo-itmaster.com
DocumentRoot /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =pma.demo-itmaster.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# install lets encrypt ssl certs
certbot --apache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment