Blog

2009/04/26

All around Apache2

It is not that I have done nothing over the past weeks. I have been installing a few packages but they have not become active. I started with SubVersion. This package has a web interface that uses Apache2. I never planned to install this because I wanted to handle the static pages through Tomcat even when there is some performance loss. For me this is no problem. My intranet will not be used very heavy for the static page part. But because of this feature I decided to install Apache2. Beside the 'basic' Apache2 I also installed the mod_jk module to integrate Tomcat. Here I stopped. I wanted to set up a back-up for the server.

For the back-up I created a system to run jobs in the crontab daemon. The basic idea is that there is a central repository with all the jobs for all servers in the network. The location of the scripts and the parameters that are used are stored in 2 configuration files. 1 is common to all servers. The other one is for the server (and user) where the script runs. This makes a script look like:

# -----------------------------------------------------------------------------
# skelet.sh - Deze script ...
#
# Version: $Revision$
# -----------------------------------------------------------------------------

. ~/default
. $COMMON_CONFIG/default
. $LOCAL_CONFIG/default

export today=`date '+%y%m%d%H%M'`
export runlog=$LOG_DIR/skelet.$today

echo "skelet: Gestart op "`date '+%d/%m/%y @%H:%M'` >> $runlog
echo " "                                            >> $runlog

echo " "                                            >> $runlog
echo "skelet: Gestopt op "`date '+%d/%m/%y @%H:%M'` >> $runlog

In the ~/default you set the COMMON_CONFIG and the LOCAL_CONFIG. These files hold all variables that are used in the scripts. Next time I will speak about 'my' crontab system.

Unfortunatelly the back-up system came a few days to late. While I was editing the apache2.conf file I deleted by accident the first half of the file. Do not ask me how because I do not know. What I know is that I could not get the file back. Apache2 refused to start. I re-installed Apache2 but the file came not back. I Googled and found the solution. When you install the Apache2 the apache2-common is also installed. When you un-install this package then everything is re-created when you install Apache2 again.