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

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

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

multiple reverse proxy host broken

Nathan Bridgewater explained how to configure multiple reverse proxies properly with apache and IIS (without losing original domain name).  I’m reposting this for myself to keep a record of this fine work.

multiple reverse proxy host broken iis serving up local server name instead of the ServerName that was originally passed to it. How to . . . → Read More: multiple reverse proxy host broken

Secure Apache ServerTokes and ServerSignature directives

There are two config directives that controls Apache version. The ServerSignature directive adds a line containing the Apache HTTP Server server version and the ServerName to any server-generated documents, such as error messages sent back to clients. ServerSignature is set to on by default. The ServerTokens directive controls whether Server response header field which is . . . → Read More: Secure Apache ServerTokes and ServerSignature directives

current apache connections

how to check current apache connections

Since apache will spawn a new process for each new connection you need to determine how many httpd processes are currently running

I would recommend checking the count from this command against the MaxClients setting in apache’s httpd.conf:

ps aux | grep -c httpd

To show the number of . . . → Read More: current apache connections