Skip to content

Instantly share code, notes, and snippets.

@fabiomontefuscolo
Created December 3, 2016 19:57
Show Gist options
  • Save fabiomontefuscolo/bbb9629602fbac093373faefe880ec5d to your computer and use it in GitHub Desktop.
Save fabiomontefuscolo/bbb9629602fbac093373faefe880ec5d to your computer and use it in GitHub Desktop.
Apache config for TikiWiki
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName awesometiki.com
ServerAlias www.awesometiki.com
# Redirect all to safe connections
Redirect permanent / https://www.awesometiki.com/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName awesometiki.com
ServerAlias www.awesometiki.com
DocumentRoot /home/awesometiki/public_html/
SSLEngine On
SSLCertificateFile /etc/apache2/apache-ssl/awesometiki.com.crt
SSLCertificateKeyFile /etc/apache2/apache-ssl/awesometiki.com.pem
SSLCertificateChainFile /etc/apache2/apache-ssl/awesometiki.gd_bundle.crt
ErrorLog /home/awesometiki/logs/error.log
CustomLog /home/awesometiki/logs/access.log combined
<Directory /home/awesometiki/public_html>
Require all granted
AllowOverride All
</Directory>
# Deny all for db/
<Directory /home/awesometiki/public_html/db>
Order Deny,Allow
Deny from all
Options None
AllowOverride None
</Directory>
# Deliver only png, pdf, html, js, css from temp/ folder
<Directory /home/awesometiki/public_html/temp>
Order Deny,Allow
Deny from all
Options Indexes FollowSymLinks
AllowOverride None
php_flag engine Off
<Files ~ "\.(png|pdf|html|js|css)$">
Order Deny,Allow
Allow from all
</Files>
</Directory>
# Turn off php and deny some special types
<Directory ~ "/home/awesometiki/public_html/(css|doc|files|img|maps|mods|styles|templates|templates_c|whelp)">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
php_flag engine Off
<Files ~ "\.(php|sql|sh|pl|py)">
Order allow,deny
Deny from all
</Files>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment