Skip to content

Instantly share code, notes, and snippets.

@d1rk
Created November 28, 2011 13:50
Show Gist options
  • Save d1rk/1400460 to your computer and use it in GitHub Desktop.
Save d1rk/1400460 to your computer and use it in GitHub Desktop.
setup
AuthUserFile :vhosts/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
<Limit GET>
require user d1rk
:vhosts/:appname/log/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
copytruncate
sharedscripts
}
# removing www
#RewriteCond %{HTTP_HOST} ^www.:serveralias$ [NC]
#RewriteRule ^(.*)$ http://:serveralias/$1 [R=301,L]
# adding www
#RewriteCond %{HTTP_HOST} ^:serveralias$
#RewriteRule (.*) http://www.:serveralias$1 [R=301]
# redirect to https
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !=/server-status
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
<VirtualHost *:443>
ServerName localhost
ServerAlias :serveralias www.:serveralias
DocumentRoot :vhosts/:appname/:webroot
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/apache2/ssl/:appname.crt
SSLCertificateKeyFile /etc/apache2/ssl/:appname/:appname.key
SSLCACertificateFile /etc/apache2/ssl/:appname/:appname.ca
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
# Possible values include: debug, info, notice, warn, error, crit,
LogLevel info
ErrorLog :vhosts/:serveralias/log/apache2-error.log
CustomLog :vhosts/:serveralias/log/apache2-ssl-access.log combined
FileETag none
Include /etc/apache2/sites-available/:appname.conf.d/local
RewriteEngine On
RewriteLog :vhosts/:appname/log/rewrite.log
RewriteLogLevel 0
# Disable htaccess starting at /
<Directory />
AllowOverride none
</Directory>
<Directory ~ "\.git">
Order allow,deny
Deny from all
</Directory>
<Directory :vhosts/:appname/:webroot/>
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
Order allow,deny
Allow from all
#Include /etc/apache2/auth.conf
RewriteEngine On
Include /etc/apache2/sites-available/:appname.conf.d/rewrite
<Files sitemap.xml>
RewriteEngine Off
</Files>
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
ServerAlias :serveralias www.:serveralias
DocumentRoot :vhosts/:appname/:webroot
# Possible values include: debug, info, notice, warn, error, crit,
LogLevel info
ErrorLog :vhosts/:appname/log/apache2-error.log
CustomLog :vhosts/:appname/log/apache2-access.log combined
FileETag none
Include /etc/apache2/sites-available/:appname.conf.d/local
RewriteEngine On
RewriteLog :vhosts/:appname/log/rewrite.log
RewriteLogLevel 0
# Disable htaccess starting at /
<Directory />
AllowOverride none
</Directory>
<Directory ~ "\.git">
Order allow,deny
Deny from all
</Directory>
<Directory :vhosts/:appname/:webroot/>
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
Order allow,deny
Allow from all
#Include /etc/apache2/auth.conf
RewriteEngine On
Include /etc/apache2/sites-available/:appname.conf.d/rewrite
<Files sitemap.xml>
RewriteEngine Off
</Files>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment