MySQL/Tomcat/JSP question (original) (raw)
Hi! I'm currently running my Apache, MySQL, Tomcat servers on one machine. I have these JSPs that calls these database beans to connect to the MySQL server and execute queries on the mysql server.
My question is this:
If I am on a machine with IP address A and I'm trying to access a JSP on the server with IP address B, from which IP address would the mysql server get the request? Would it get it from 'A' since it is the machine accessing the JSP? or would it get it from 'B' since it is where the Tomcat container is?
My problem is that I'm running into this bug in Redhat 9 where any machine that accesses the mysql server that is not defined in the /etc/hosts file will crash and restart the mysql server. I placed the local IP address of the server(localhost,127.0.0.1, and as well as it's real IP address) in the /etc/hosts file and that seems to work well as a workaround. The whole application works locally and as well as from another machine that is in the /etc/hosts file.
I figure that if I list the Tomcat container as the machine that accesses the mysql server, the mysql restart problem will not exist since the Tomcat container is in the /etc/hosts file. Apparently, something else is amiss and therefore I'm asking these questions.
Thanks for any help offered!