Apache Virtual Host Linux PMC Tactical

Welcome to Apache Virtual Host Linux PMC Tactical.

PMC websites shut down September 13th 2025 unless yearly web hosting fees are paid. Please Support PMC to help keep these websites online.

Website hosting and domain registration fees are due, please Support PMC, thank you. You can read more details from PMC websites from shared hosting to Virtual Private Server forum topic.

Apache Virtual Host

Apache website config files are located in /etc/apache2/sites-available/ directory.

In this case I'm using fictional example.com website domain name.

Browse to that dir, then you could copy 000-default.conf file to example.com.conf or simply create brand new one and then copy-paste the following config/code block there:

<VirtualHost *:80>
DocumentRoot "/var/www/example.com"
ServerName example.com
ServerAlias www.example.com
<Directory "/var/www/example.com">
allow from all
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

When you create Letsencrypt SSL https domain config for your website domain, it will most likely complain about that RewriteCond/RewriteRule that its disabled because it might lead into never ending loop. I have no idea about that, I need to figure it out later :) PMCTODO

Enjoyed or found this pages content useful, please Support PMC to help me keep this web page online beyond september 13th 2025 when yearly web hosting fees are due.