Systems Administration

Introduction


Here are quick and easy instructions to integrating Tomcat and Apache together in Linux that allows the :8080 (or other port number) to not show in the URL. I have seen other how-to's about this, but they always over complicate the instructions or they're missing vital steps.

Prerequisites


The steps in this article have been tested with the following versions:

  • Tomcat 5.5.27
  • Apache 2.2.8
  • mod_jk 1.2.27
  • Java 6

The following are assumed:

Here's a collection of Linux mount examples. I tend to forget these and have to search for examples on the Internet. This page will be updated regularly as I gather more mount examples. Note there are some example that use "-t auto". Most modern Linux distributions can recognize the type of the device automatically.

  • Mount an IDE hard drive partition - These are usually devices hda, hdb, hdc, etc.
          mount -t auto /dev/hda1 /mnt/point

DenyHosts is a fantastic application that just works. It was written in Python by Phil Schwartz, and his website is http://denyhosts.sourceforge.net. DenyHosts basically observes the auth.log or secure log file (depending on your Linux distro) and if a certain number of attempts are made, the application puts the IP address of the offender in /etc/hosts.deny file, and then refuses the connection from that point forward. The default setting for attempts is 10 and can be changed in the denyhosts.cfg file.

These are the steps to add a swap file without messing around with adjusting any partitions (plus it's safer). This will add 1 Gb of swap space.

   dd if=/dev/zero of=/mnt/swapfile bs=1024 count=1048576
   mkswap /mnt/swapfile
   swapon /mnt/swapfile

This quite easy and takes less than a minute to setup. To enable it at boot time, the following must be added to /etc/fstab:

   /mnt/swapfile    swap     swap    defaults  0      0

Here's a simple, one line script that finds all files roughly 2 megabytes in size in the filesystem's root directory.

   find / -mount -size 2M -exec ls -l '{}' \; | awk '{print $5 " " $9}' > ~/files_2m.out

Let's break this down.

  • -mount - This parameter says to ignore recursing through all mount points. Very handy if you want to ignore certain partitions. This is an all or nothing parameter.

This short tutorial instructs you on how to mount a Windows NTFS partition from a Linux partition using captive-ntfs tool. First, obtain captive-ntfs here. Follow the instructions for installation.

Next, mount the Windows partition:

mount -t captive-ntfs /dev/hda1 /mnt/win

Let's break this down.

Syndicate content