Skip to content

Instantly share code, notes, and snippets.

@JBlond
Last active April 24, 2016 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JBlond/5ae987627c4b6b025f1475df0c32f77d to your computer and use it in GitHub Desktop.
Save JBlond/5ae987627c4b6b025f1475df0c32f77d to your computer and use it in GitHub Desktop.
<VirtualHost _default_:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ErrorLog /var/log/apache2/localhost_error.log
LogLevel warn
CustomLog /var/log/apache2/localhost_access.log combined
</VirtualHost>
<VirtualHost _default_:443>
DocumentRoot /var/www/
ServerName localhost
<Directory /var/www/>
Options Indexes FollowSymlinks Multiviews
AllowOverride None
Require all granted
</Directory>
ErrorLog /var/log/apache2/ssl.localhost_error.log
TransferLog /var/log/apache2/ssl.localhost_access.log
SSLEngine on
SSLCertificateFile /opt/apache2/conf/certs/example.crt
SSLCertificateKeyFile /opt/apache2/conf/certs/example.key
SSLCertificateChainFile /opt/apache2/conf/certs/sub.class1.server.ca.pem
SSLCACertificateFile /opt/apache2/conf/certs/ca.pem
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@example.com
ServerName example.com
ServerAlias www.example.com static.example.com
DocumentRoot /var/www/
FileETag MTime Size
<Directory /var/www/>
Options Indexes FollowSymLinks Multiviews ExecCGI
AllowOverride None
<RequireAll>
Require all granted
Require not ip 212.105.204.244
# fucking pix bot
Require not ip ${BADIPS}
</RequireAll>
AddHandler fcgid-script .php
FCGIWrapper /usr/bin/php5-cgi .php
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /opt/apache2/logs/access.log combined
<Location "/readme.html">
Require all denied
</Location>
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/
ServerName example.com
ServerAlias www.example.com static.example.com
<Directory /var/www/>
Options Indexes FollowSymlinks Multiviews ExecCGI
AllowOverride None
<RequireAll>
Require all granted
Require not ip 212.105.204.244
# fucking pix bot
Require not ip ${BADIPS}
</RequireAll>
AddHandler fcgid-script .php
FCGIWrapper /usr/bin/php5-cgi .php
</Directory>
ErrorLog /opt/apache2/logs/ssl.error.log
CustomLog /opt/apache2/logs/ssl.access.log combined
Header always set Public-Key-Pins 'pin-sha256="LES0hUn6hDGNOdeobfiWqvx6/Q/c7/+/Iv37LflkJ9M="; pin-sha256="bZ3qT75yZLagDEADBEEF0h3KAseeheXXJ5dliOfLB2A="; max-age=5184000'
SSLEngine on
SSLCertificateFile /opt/apache2/conf/certs/example.com.2015.crt
SSLCertificateKeyFile /opt/apache2/conf/certs/example.com.2015.key
SSLCertificateChainFile /opt/apache2/conf/certs/sub.class1.server.ca.pem
SSLCACertificateFile /opt/apache2/conf/certs/ca.pem
SSLCARevocationFile /opt/apache2/conf/certs/sub.class1.client.sha2.ca.pem
<Files ~"\.(cgi|shtml|phtml|php|htm|html?)$>
SSLOptions +StdEnvVars
</Files>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment