Archive

Archive for the ‘Apache’ Category

control ip access to apache via .htaccess

July 6th, 2009 No comments

1. Allow only specific ip address :

order allow,deny
deny from all
allow from 192.168.1.1
allow from 192.168.1.2

2. Block specific ip address :

order deny,allow
allow from all
deny from 192.168.1.1
deny from 192.168.1.2

you can substitute ip for :

subnet -> deny from 192.168.1.0/24
subnet wild cards -> deny from 192.168.*.*
domain -> deny from domain\.com

you can also combine ip’s on one line:

deny from 192.168.1.1 192.168.2.1

Fix mod_rewrite erros in apache

March 12th, 2009 No comments

change :


RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* – [F]

To this:


RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* – [F]
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 0

as described here

Remove pass-phrase prompt when loading apache-ssl

January 16th, 2008 No comments

Somehow , I always forget this …

openssl rsa -in server.key -out server.pem

server.pem and server.key MUST be 0600 and owned by root !

Apache SSL

June 13th, 2007 No comments

Notes on creating an apache SSL cert

Read more…