Keep Server Online
  
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
  
or
  
 
  
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
  
Thank You! Steffen
  
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
 |    |   
 | 
     Topic: Apache, Tomcat and MySQL | 
 |   
| Author | 
  | 
 
podibuhaa
 
 
  Joined: 01 Nov 2006 Posts: 2
 
  | 
 Posted: Wed 01 Nov '06 20:29    Post subject: Apache, Tomcat and MySQL | 
     | 
 
  | 
 
Hello!
 
 
I have been struggling with this setup and would appreciate any input:
 
 
I have installed Apache 2.2.3, Tomcat 5.5 and MySql 5.0. Apache is setup to communicate with Tomcat using the AJP module and ConnectorJ is used to connect Tomcat and MySQL. 
 
 
The httpd.conf setup for the virtual host looks like this:
 
<VirtualHost *:80>
 
    DocumentRoot d:\rrc
 
    ErrorLog logs/rrc-error_log
 
    CustomLog logs/rrc-access_log common
 
 
    DirectoryIndex index.html
 
	#DO NOT ALLOW THE DISPLAY OF DIRECTORY CONTENTS
 
	<Directory "d:\rrc">
 
		Options indexes
 
		AllowOverride None
 
		Order allow,deny
 
		Allow from all
 
	</Directory>
 
 
ProxyPass /rrc ajp://localhost:8080/rrc
 
</VirtualHost>
 
 
I can view the jsp pages without the database access using this configuration. As soon as I view a jsp page with database access, it spits out code on the browser.
 
 
If I access any jsp including the ones with database access using the tomcat server on port 8080 directly, I can view them successfully. 
 
 
Am I missing a step where I have to configure Apache with MySQL?
 
 
Thank you! | 
 
  | 
 
| Back to top | 
 | 
 
James Blond Moderator
  
  Joined: 19 Jan 2006 Posts: 7442 Location: EU, Germany, Next to Hamburg
  | 
 Posted: Thu 02 Nov '06 13:30    Post subject:  | 
     | 
 
  | 
 
 	  | Quote: | 	 		  
 
Am I missing a step where I have to configure Apache with MySQL? 
 
 | 	  
 
 
MySQL is a server itself. You don't have to configure that in Apache configs.
 
 
If MySQL is running, you can use it in your scripts. | 
 
  | 
 
| Back to top | 
 | 
 
Jorge
 
 
  Joined: 12 Mar 2006 Posts: 376 Location: Belgium
  | 
 Posted: Thu 02 Nov '06 14:26    Post subject:  | 
     | 
 
  | 
 
 	  | James Blond wrote: | 	 		  
 
If MySQL is running, you can use it in your scripts. | 	  
 
 
This taken that MySQL is setup correctly    | 
 
  | 
 
| Back to top | 
 | 
 
podibuhaa
 
 
  Joined: 01 Nov 2006 Posts: 2
 
  | 
 Posted: Fri 03 Nov '06 0:58    Post subject:  | 
     | 
 
  | 
 
| I know that MySQL is running and the jsp's can access the database because I can use the jsp's with data access when run directly on port 8080. But, when I try to use these pages through the connector from Apache to Tomcat is when this fails. | 
 
  | 
 
| Back to top | 
 | 
 
 
 
 
 | 
 
 
 |  
 
 |  
  |   
 |