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: jpda start 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`)
  ('1', ''),
  ('2', ''),
  ('3', 'hostname'),
  ('4', '');

Adding Email Accounts:

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

Adding Aliases for Email Accounts:

INSERT INTO `mailserver`.`virtual_aliases`
  (`id`, `domain_id`, `source`, `destination`)
  ('1', '1', '', '');

From this setup tutorial