Introduction

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
Tags:

Here's a simple and fairly cheap way of building a portable, external backup drive for Linux if you have existing internal hard drives lying around. The whole thing costs about $50 and an hour or two of your time. Let's begin.

Prerequisites

  1. Any old hard drive - I have a 40Gb hard drive from 2002 which I'll be referring. You can use any hard drive you want as long as it's supported by the external hard drive enclosure (see Venus DS3 below).

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.

Tags:

This document explains each section of the firewall script. The script is broken down into three parts. I found an example of the firewall script at http://www.iptablesrocks.org/ and modified it to fit our environment. This is not the only way to create a firewall script.

I'll use one of the firewall script examples which I modified for our machine (full firewall script is at the end of this document). Some of the descriptions come directly from the man pages of iptables. Iptables information will be written to kern.log file located in /var/log.

Tags:

Here's a simple command line example of a backup task for MySQL.

mysqldump <DB_NAME> -v -u <MYSQL_USERID> --password=<MYSQL_PASSWORD> > sql_file_name.sql

Let's break this down.

  • <DB_NAME> - The name of the database to dump.

  • -v - This outputs some dump information. You can add more than one of these (-vvv) for a very detailed dump information.

  • -u <MYSQL_USERID> - This is the userid of the database owner in MySQL.

Syndicate content