July 2012
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

July 2012
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Mod_rewrite

Turn Mod_Rewrite On

Mod_rewrite is used through your .htaccess file. Place the following code at the beginning of your .htaccess file to turn mod_rewrite on:

RewriteEngine on

(Don’t forget that .htaccess commands are case-sensitive.) This code needs to be entered at the beginning of any .htaccess file using mod_rewrite. The Basic Mod_Rewrite Layout

The basic […]

.htaccess – Authentication from File and LDAP or other sources at the same time

.htaccess – Authentication from File and LDAP or other sources at the same time

Sometimes you may need to authenticate a user against different credentials stores, like standard files (.htpasswd), databases, ldap, … With Apache, you can use these more authentication sources by defining them in the AuthBasicProvider property.

The configuration bellow will authenticate a […]

.htaccess – Redirect to SSL (HTTPS) before Basic Authentication

.htaccess – Redirect to SSL (HTTPS) before Basic Authentication

 

I prefer running a site in HTTP only mode when there are no confidential information transferred (username, password, credit card number, etc.). It saves some of the CPU time because there is no need to do data encryption. But I strongly recommend to use HTTPS […]

free -m

free -m Use ‘free -m’ utility to get REAL memory usage. [u…@server /]# free -m total used free shared buffers cached Mem: 3876 3557 319 0 212 1083 -/+ buffers/cache: 2261 1615 Swap: 0 0 0 That means I have 3876MB total used memory. 2261MB of it is allocated and needed. 1083MB is cached (mostly […]

Tcpdump

Tcpdump is one of the best network analysis-tools ever for information security professionals. Tcpdump is for everyone for hackers and people who have less of TCP/IP understanding. Many prefer to use higher-level analysis tools such Wireshark, but I believe it is a mistake. With tcpdump you can decode layers 2-7 of OSI model. The first […]

ssl secure https and redirection

ssl secure https and redirection

NameVirtualHost *:80 NameVirtualHost *:443

<VirtualHost *:80>

DocumentRoot /usr/share/webmail ServerName webmail.rmohan.com RewriteEngine on RewriteCond %{HTTPS} !^on$ [NC] RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L] </VirtualHost>

<VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/apache2/otherserver.crt SSLCertificateKeyFile /etc/ssl/apache2/otherserver.key ServerName webmail.rmohan.com SSLOptions StrictRequire SSLProtocol all -SSLv2 </VirtualHost>