Web

Create a temporary “Site Down” notice in Apache

This post describes how to make a “Site down for maintenance” notice using Apache .htaccess and the mod_rewrite module. I assume you know how to enable the Apache htaccess directive and the mod_rewrite module. First you need to create a .htaccess file in your root level of your website. Next you add the following lines […]

Read More
Security

Enable secure / https SSL login on mediaWiki 1.13.3

This is how I’ve enabled secure SSL login through https on a mediaWiki 1.13.3 installation. This description might work on other versions of mediaWiki, but that has not been tested. mediWiki doesn’t support SSL login out of the box so a little hack has to be performed. First you need to tell the webserver, in […]

Read More
Web

Using vlogger to split Apache logs

Vlogger is a program that handles large amounts of virtualhost logs and splits it to separate files. This is a short HOWTO to configure it using Apache. Install vlogger in debian etch # aptitude install vlogger Make sure you have working Apache server Configuring vlogger Change the LogFormat line (there are multiple LogFormat lines – […]

Read More
Scripting

Apache web connections pr hour

This is a bash oneliner to show Apache web connections pr hour. It lists up the IPs that has accessed your webserver and the amount og accesses. # cat /var/log/apache2/access_log_pario.no | grep “21/Jan/2008:..” | awk {‘ print $4″:”$1 ‘} | sed ‘s/\[//g’ | awk -F : {‘ print $1″:”$2″\t\t”$5 ‘} | sort | uniq -c […]

Read More
Web

Shortening Apache Configs using mod_macro

It is possible to use macros in the Apache config files to shorten them and make them easier to read and manage. To use this you have to install mod_macro if it’s not already installed in your distribution. Sample mod_macro usage <Macro VHost $customer $domain> <VirtualHost $domain:80> ServerName $domain ServerAlias www.$domain DocumentRoot /vaw/www/$customer/htdocs/$domain/ ScriptAlias /cgi-bin/ […]

Read More