Apache ProxyPass with dynamic hostname

To use Apache ProxyPass directives with dynamic hostnames you will need to also use ModRewrite.

Objective

All requests to the virtualhost will ProxyPass and ProxyPassReverse (also known as an “Apache Gateway”) to the %{HTTP_HOST}

The only reason this would make sense to do is if you have localhost entries on the apache server for specfic . . . → Read More: Apache ProxyPass with dynamic hostname

Testing SSL Chaining Issues

Recently I needed to debug an issue by testing SSL chaining issues My old standby tools (curl and openssl were not reporting any errors) The exception javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors Cause The cert from the keystore does not match the cert from . . . → Read More: Testing SSL Chaining Issues

Neo4j Couldn’t get file lock

Problem

A non-root user is running Neo4j and you are seeing locking errors in the log file

Symptom May 8, 2013 6:20:31 PM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode WARNING: Could not lock User prefs. Unix error code 2. May 8, 2013 6:20:31 PM java.util.prefs.FileSystemPreferences syncWorld WARNING: Couldn’t flush user prefs: java.util.prefs.BackingStoreException: Couldn’t get file lock. May 8, 2013 . . . → Read More: Neo4j Couldn’t get file lock

convert valid godaddy cert key to java keystore for tomcat

I spend hours trying to figure this out and here are the fruits of my labor

Problem

You are unable to create a valid Tomcat Keystore using a GoDaddy crt and key file

Curl output may look like this:

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify . . . → Read More: convert valid godaddy cert key to java keystore for tomcat

phone laws driving headphones

By State: phone laws driving headphones

Ever wondered if it is legal to wear headphones while driving in a particular state? Wonder no more!

Alabama

No prohibition on wearing of headsets while driving.

Alaska

Wearing an audio headset or earplugs is not permitted while driving.

Exempts headsets when used and designed to improve a driver’s . . . → Read More: phone laws driving headphones

Mandiant Highlighter – Log and Text File Viewer Review

Product Review - Mandiant Highlighter

Today we are looking at Mandiant Highlighter; Log and Text File Viewer

Product home page can be found here

Cost: Free!

Overview

MANDIANT Highlighter is a log file analysis tool. Highlighter provides a graphical component to log analysis that helps the analyst identify patterns. Highlighter also provides a number of features aimed at . . . → Read More: Mandiant Highlighter – Log and Text File Viewer Review

sed delete all lines after

Objective: Prep dev httpd.conf for production

Tasks:

Remove jenkins virtual host entry (which starts with a comment line “#Start Jenkins”) Replace .dev with nothing (ex: www.dev.example.com becomes www.example.com) Replace debug with error (ex: Loglevel debug becomes Loglevel error) Sed to remove lines after match

In this example we will use sed delete all lines after . . . → Read More: sed delete all lines after

rollback httpd.conf changes on error

To rollback httpd.conf changes on error use this script:

#!/bin/bash #File: deploy_new_httpd_conf.sh #Define this PATH_TO_NEW_HTTPD_CONF=”~/new_httpd.conf” #Backup old httpd.conf file /bin/cp -f /etc/httpd/conf/httpd.conf /root/httpd.conf.bak #Copy new httpd.conf over the existing one /bin/cp -f ${PATH_TO_NEW_HTTPD_CONF} /etc/httpd/conf/httpd.conf #Test the Syntax /usr/sbin/apachectl -t if [ $? != 0 ] then echo “apache syntax test failed! Reverting back to old . . . → Read More: rollback httpd.conf changes on error

Websphere Stop All Servers Script

Here’s a ksh script to stop all running websphere servers. Booyah!

#!/bin/ksh # # This script stops all running Websphere servers # cd /opt/ibm/WAS70/logs servers=`echo *Node*` cd /opt/ibm/WAS70/AppServer/profiles/AppSrv01/bin for server in $servers; do pid=`ps -ef | grep $server | grep Cell01 | awk ‘{print $2}’` if [ ! -z "$pid" ]; then echo Stopping $server . . . → Read More: Websphere Stop All Servers Script

mod_dav_svn.so undefined symbol: dav_register_provider

Recently, I attempted to install subversion on Centos6.  Apache failed to start with this error:

mod_dav_svn.so undefined symbol: dav_register_provider

To fix this error simply add this in your httpd.conf:

LoadModule dav_module modules/mod_dav.so

Make sure you add the line above BEFORE these lines:

LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so