Configure Apache

This example assumes:

  • you have a domain called zenariosite.com
  • you want to temporarily use http (insecure) while setting up
  • after you've done a basic set up, you want to redirect all non-secure traffic to secure (from http to https), and also redirect www subdomain and other domains to the main secure domain.

Create an Apache virtual host file, in /etc/apache2/sites-available/zenariosite-http.conf, with these contents:

<VirtualHost *:80>
        # This configuration is INSECURE and uses just http. Use a secure https configuration for production!
        ServerName zenariosite.com

        ErrorLog ${APACHE_LOG_DIR}/zenariosite-error.log
        CustomLog ${APACHE_LOG_DIR}/zenariosite-access.log combined

        DocumentRoot /var/www/clients/zenariosite/public_html
        <Directory /var/www/clients/zenariosite/public_html/>
                Options +FollowSymLinks +MultiViews -Indexes
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        #List any subdomains for which you want to redirect to the main domain
        ServerName www.zenariosite.com

        RewriteEngine On
        RewriteRule ^ http://zenariosite.com%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Enable the site and reload Apache:

sudo a2ensite zenariosite-http.conf
sudo systemctl reload apache2

Go to the control panel for your domain name, and change its "A" DNS records to point to the IP address of your server.

Secure https

This guide provides a simple way to set up Zenario as quickly as possible, and so the next step shows you how to install with http only.

For better security, you may go straight to the page on redirecting traffic to https before installing Zenario.