Kill Tomcat with a single command

This will kill all Tomcat processes running on the machine

ps -ef | grep tomcat | awk '{print $2}' | xargs kill -9

If the Tomcat process is running as root, adding sudo before the kill command may be required

ps -ef | grep tomcat | awk '{print $2}' | xargs sudo kill -9

Apache on Mac OS X

Mac OS X includes Apache, but it isn’t enabled by default. To enable Apache, open a Terminal and enter

sudo apachectl start

Config files

sudo vi /etc/apache2/httpd.conf
sudo vi /etc/apache2/extra/httpd-vhosts.conf

More information here: Mac OS X – Apache 2

Installing memcached on Mac OS X

Easiest way to install memcached on Mac OS X is using MacPorts (port)

According to the MacPorts website…

The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system. To that end we provide the command-line driven MacPorts software package under a BSD License, and through it easy access to thousands of ports that greatly simplify the task of compiling and installing open-source software on your Mac.

The easiest way to install MacPorts on a Mac OS X system is by downloading the dmg for Lion, Snow Leopard or Leopard and running the system’s Installer by double-clicking on the pkg contained therein, following the on-screen instructions until completion.

Now, to install memcached, type the following command

sudo port install memcached

Memcached Server can be started by running the following command

memcached -vv

To run memcached as a daemon

memcached -d

These instructions have been tested on Mac OS X 10.6.8 (Snow Leopard)