Monthly Archives: June 2014

Tomcat Debugging

I use cygwin on my windows box at work to run tomcat.  I wanted to be able to debug tomcat from eclipse but everything I found on google talked about adding environment variables and seemed over complicated.  Based on the apache wiki it’s really simple.  In cygwin find your Tomcat’s bin directory and run the following:

catalina.sh jpda start
catalina.sh jpda stop

It’ll start the debugger on port 8000.  Go into eclipse and create a “Remote Java Application” debug configuration and connect to that port on localhost.  Why so much fuss?

Adding Email Accounts to Mail Server

Recently I setup dovecot and postfix to handle email for my multiple domains.  I configured MySQL in order to manage the many accounts I plan to create.  Below is a cheat sheet on how to add domains and accounts.

Adding Virtual Domains to the mail server:

INSERT INTO `mailserver`.`virtual_domains`
  (`id` ,`name`)
VALUES
  ('1', 'example.com'),
  ('2', 'hostname.example.com'),
  ('3', 'hostname'),
  ('4', 'localhost.example.com');

Adding Email Accounts:

INSERT INTO `mailserver`.`virtual_users`
  (`id`, `domain_id`, `password` , `email`)
VALUES
  ('1', '1', ENCRYPT('firstpassword', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), 'email1@example.com'),
  ('2', '1', ENCRYPT('secondpassword', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), 'email2@example.com');

Adding Aliases for Email Accounts:

INSERT INTO `mailserver`.`virtual_aliases`
  (`id`, `domain_id`, `source`, `destination`)
VALUES
  ('1', '1', 'alias@example.com', 'email1@example.com');

From this setup tutorial