<IfModule mod_ssl.c>
<VirtualHost *:443>
	ServerAdmin Adrian.Pop@liu.se
	ServerName encryption.openmodelica.org

	DocumentRoot /var/www/encryption/
	<Directory />
		Options FollowSymLinks
		AllowOverride All
	</Directory>
	<Directory /var/www/encryption/download>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>


WSGIDaemonProcess encryptionsite python-home=/var/www/encryption/.virtualenv-with-system

# encryption
WSGIScriptAlias / /var/www/encryption/py/form.wsgi
Alias /download /var/www/encryption/download/

<Directory /var/www/encryption/py>
  AuthType Basic
  AuthName "OpenModelica Encryption Version"
  AuthUserFile /etc/apache2/.htpasswd
  Require valid-user
  WSGIProcessGroup encryptionsite
  WSGIApplicationGroup %{GLOBAL}
  Order deny,allow
  Allow from all
</Directory>

SSLCertificateFile /etc/letsencrypt/live/openmodelica.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/openmodelica.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
