Sunday, November 29, 2009

Change default webapp in tomcat

- leave your war file in CATALINA_BASE/webapps, under its original name
- turn off autoDeploy and deployOnStartup in your Host element in the server.xml file.
- explicitly define all application Contexts in server.xml, specifying both path and docBase. You must do this, because you have disabled all the Tomcat auto-deploy mechanisms, and Tomcat will not deploy your applications anymore unless it finds their Context in the server.xml.

Note that this last method also implies that in order to make any change to any application, you will have to stop and restart Tomcat.

server.xml: Context path="" docBase="ihzh"

Friday, November 6, 2009

URL redirect

http://yost.com/computers/apache-redirect/index.html

Host multiple websites

http://wiki.gandi.net/en/hosting/using-linux/tutorials/ubuntu/virtualhosts

Friday, October 2, 2009

Automatically set "svn:needs-lock" property

http://www.svnforum.org/2017/viewtopic.php?t=8506

Saturday, September 19, 2009

Moving VirtualBox to a new machine

1) Copy the hard disk to the new machine.
2) Register it in VB (File->Virtual Medial Manager)
3) Create a new machine with the same name AND select the above HD for it and check settings (I had to change System-Processor->Enable PAE/NX + Network to Bridged).
4) If eth0 is gone!
Edit the file /etc/udev/rules.d/70-persistent-net.rules
Delete the line with eth0 and change eth1 to eth0.
Restart :)

Wednesday, September 9, 2009

Setting apache in front of tomcat

1) install apache, tomcat, php5 (not required for this, but is good), mod_jk (sudo apt-get install libapache2-mod-jk)

2) create workers.properties file with
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

3) add in httpd.conf
JkWorkersFile /etc/apache2/workers.properties

JkMount /ihzh/* worker1
OR
in the sites-available/webapp (if in tomcat)
JkMount /* worker1

Now if apache can be accessed on: http://host/
ihzh (running on tomcat) can be accessed on: http://host/ihzh/ (last "/" is important!).

Monday, April 27, 2009

using mutt with gmail - google apps account

It was easy to set up gmail app account on mutt to fetch email, but sending was a pain.

The problem was user id containing "@" symbol. For example exampleuser@exampledomain.com and gmail requiring smtp authentication for sending emails. Mutt config file gives no option to set user for smtp seperately. So it has to be passed in "smtp_url" variable.

set smtp_url = "smtp://exampleuser@exampledomain.com@smtp.gmail.com:587"

But this gives error cause mutt tries to find domain exampledomain.com instead of smtp.gmail.com.

The solution was to use the variable "imap_user".
set smtp_url = "smtp://$imap_user@smtp.gmail.com:587"

Hope that helps.