|
Tip: Tomcat 6 connecting to MySQL - Ubuntu 8.10 |
|
|
|
|
Written by jay
|
|
Thursday, 12 February 2009 |
|
A good old db connection using the mysql jdbc driver was giving me problems. Placed the connector in the Catalina_Home\lib etc but just could not connect. Well it turns out the Apache Tomcat v6.0.18 has a default startup script that enables java security by default. There are two ways to solve this.
1) The easy way but surely is not to be done on a production server. Open the tomcat6 startup script like so: sudo gedit /etc/init.d/tomcat6. Locate these lines of code:
# Use the Java security manager? (yes/no) TOMCAT6_SECURITY=yes
Change the value from yes to no. Warning, I have no idea of the real implications of doing that other than the obvious - surely your environment will be less secure. Oh, and that my simple jsp tests started working, which is all I really wanted to do.
2) Probably the right way to do it, set the policies properly to allow db connections etc. Typically, in /etc/tomcat6/policy.d/, there are several files where one can set the various policies to allow things such as db connectivity etc. Never really tried it but in theory, can control quite a number of security settings. I shall refer you to the tomcat 6 documentation on how to actually perform that.
|
|
Last Updated ( Thursday, 12 February 2009 )
|