Following up my last article I also need to configure MySQL and Tomcat. As the services are up and running I also want to access them from other VMWare instances and the host system. Apparently I get an error when I try to access either one of them remotely. So let’s see which other steps are required.
I have installed MySQL GUI Tools on the Mac. When I tried to access the remote server from the MySQL Administrator I got an error that the server is not available, pinging the host was successful. This reminded me that I need to configure MySQL for remote root access. Calm down it is a development machine only ;)
$ mysql -u root
mysql> SET PASSWORD FOR ‘ROOT’@'LOCALHOST” = PASSWORD(‘new_password’);
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@'%’ IDENTIFIED BY ‘new_password’ WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
After log in in MySQL as root I set a password and defined that the root user has access to all objects from where ever he logs in from.
I also needed to change the Firewall settings. For that I open Systems > Administration > Security Level and Firewall. There I set the SELinux setting to disabled, in Firewall options in the Other ports section I have added the port 3306 for TCP access as allowed port. MySQL can now be accessed from remote. Yeah!
I checked also the box for WWW (HTTP) in the Trusted services section. Tomcat doesn’t really care for that as it runs on another port, and www is port 80 only. So add the configured port for tomcat (in this case 8080) in the allowed port section too.
Some wisdom to share: If you use the correct IP address the tomcat start page will show up without problems. Doh!
Once Tomcat is running I installed the desired application; so I ended up getting this error:
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
(with a nice stack trace)
This is caused by a bug, more information available here. Basically they forgot to put a jar file in the install package. As recommended I simply copied the missing naming-factory-dbcp.jar from another tomcat instance running on another machine. Annoying!
I had also installed the servlet-api which isn’t put into the tomcat/common/lib directory. As the script of the vendor determines which tomcat version is installed by checking this jar I needed to add this line:
sudo ln -s /usr/share/java/tomcat5-servlet-2.4-api.jar servlet-api.jar
Finally it worked.
Popularity: 2% [?]Tags: CentOS, configuration, MySQL, tomcat