September 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

Categories

September 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930

htaccess-examples

I was testing authentication against Active Directory (LDAP) using Apache 2. The following worked for me in a .htaccess file but only after adding:

LDAPVerifyServerCert Off

in the main httpd.conf file. I presume this is related to the server name in the SSL certificate on the Active Directory server.

AuthBasicProvider ldap AuthzLDAPAuthoritative Off […]

SSL CERT EXPIRE certwatch

Certwatch checks for Apache certificates which are due to expire. By default on Red Hat / Centos there is a cron job in /etc/cron.daily which runs and sends its output to root. To configure it:

vi /etc/sysconfig/httpd

Add a line such as:

CERTWATCH_OPTS=”–period 30 –address test@rmohan.com”

It is also possible to switch it […]

Linux Security

Centralized SSH Keys

There are times when it is beneficial to take control of SSH key management on a server. This brief tutorial will centralize all user SSH keys to a single location and allow root to manage them.

We will be keeping all keys in a single directory located in /etc/ssh/authorized_keys. Within the directory, […]

Iptables rewirte for 8080 and 8443

Another way of achieving the same thing is to add an iptable redirection rule.

We have done it this way, because we didn’t want to add the xinit package to our standard configuration.

These instructions were created on a Debian Lenny system.

Create a new “if-up” script:sudo vim /etc/network/if-up.d/jira-redirect

Make this its content:

#!/bin/bashfor i […]

MySQL 5.5

TABLE OF CONTENTS (HIDE)

1. Introduction1.1 Relational Database and Structure Query Language (SQL)1.2 SQL By Examples1.3 MySQL Relational Database Management System (RDBMS)2. How to Install MySQL 5.5 and Get Started2.1 Step 1: Download and Install MySQL2.2 Step 2: Create the Configuration File2.3 Step 3: Start the Server2.4 Step 4: Start a Client2.5 Step 5: Set […]

Apache Tomcat 7

TABLE OF CONTENTS (HIDE)

1. Introduction1.1 Web Application (Webapp)1.2 Hypertext Transfer Protocol (HTTP)1.3 Apache Tomcat HTTP Server2. How to Install Tomcat 7 and Get Started with Java Servlet Programming2.1 STEP 0: Read the Tomcat Documentation2.2 STEP 1: Download and Install Tomcat2.3 STEP 2: Create an Environment Variable JAVA_HOME2.4 STEP 3: Configure Tomcat Server2.5 STEP 4: […]

yum command

Task: Display list of updated software (security fix)

Type the following command at shell prompt: # yum list updates

Task: Patch up system by applying all updates

To download and install all updates type the following command: # yum update

Task: List all installed packages

List all installed packages, enter: # rpm -qa # […]

IPTABLES TO BLOCK FACEBOOK

-A FORWARD -s 192.168.0.232 -m string –string “facebook.com” –algo kmp –to 65535 -j ACCEPTA FORWARD -m string –string “youtube.com” –algo kmp –to 65535 -j DROP-A FORWARD -m string –string “facebook.com” –algo kmp –to 65535 -j DROP-A FORWARD -m string –string “meebo.com” –algo kmp –to 65535 -j DROP

Apache Httpd Server root privileges other than permission to start

Error message

Will output the following message when you run with the privileges other than root privileges when starting Apache HTTPD Server. 1 Permission denied: make_sock: could not bind to address 0.0.0.0:80

Cause

Smaller than the 1024 port enables the user to access only the root level of the port. Resolution […]

Apache force use https

Force Apache to use https :

RequestHeader set X_FORWARDED_PROTO ‘https’