Working with Apache

Published on August 2016 | Categories: Book Excerpts | Downloads: 55 | Comments: 0 | Views: 271
of 8
Download PDF   Embed   Report

Tutorial sobre apache

Comments

Content

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

Register

Login

Contribute
Search

Subscribe

RSS

Howtos

Forums

Contribute

Subscribe

ISPConfig

FAQForge

News

Options For This Howto
Free Support Paid Support

Navigation
[+] Expand [-] Collapse

Howtos Linux Android CentOS Debian Fedora Kernel Mandriva PCLinuxOS SuSE Ubuntu Web Server Apache Cherokee Lighttpd nginx Backup Control Panels ISPConfig DNS BIND MyDNS PowerDNS djbdns Desktop Email Anti-Spam/Virus Postfix FTP High-Availability Monitoring MySQL Programming C/C++ PHP Samba Security Anti-Spam/Virus Storage Virtualization KVM OpenVZ VMware VirtualBox Xen Other FreeBSD Commercial Mini-Howtos Forums Contribute

1 of 8

22-12-2011 08:24

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

Subscription Login Site Map/RSS Feeds

User login
Username: Password: Remember Me?

Log in
Create a new account Request new password

Facebook
Find us on Facebook

HowtoForge
Like social Facebook plugin

Who's online
There are currently 8 users and 3567 guests online.

HowtoForge Forums
snmpv3 traps rounducubemail issues redirecting to /mail Squirrelmail webmail - ERROR 403 - Forbidden! Increase partition Postfix with Virtual Users And Domains Install ISPConfig 3 on Slackware 13.37 FTP-Server offline Set-up option using Debian 6 and ISPConfig 3 ISPConfig blocking spams by Junk box Virtual Users And Domains With Postfix, ...

2 of 8

22-12-2011 08:24

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

News
Firefox Add-On Bypasses SOPA DNS Blocking Ensign final Kickstarter push Apple's first major legal win against Android is no slam dunk Linux Desktop Environment Round Up Linux Professional Institute Hosts Exam Labs at SCALE 10X Pipes in Unix Based Operating Systems Arduino-Open Hardware and IDE Combo Keeping Pace in a Shifting IT Ops Landscape SQUID Proxy On RHEL5/CentOS Everything That You Should Know About Part 1 Best GNOME Shell extensions more

Recent comments
Thanks 15 hours 14 min ago A very good tutorial fast 16 hours 59 min ago Re: I got 21 hours 47 min ago delay pools 1 day 1 hour ago Thanks 1 day 3 hours ago Just tested it and it worked 1 day 9 hours ago SSH 1 day 14 hours ago Re: IP cams 1 day 18 hours ago Re: thank you for this 1 day 18 hours ago Remote API for adding email 2 days 29 min ago

Newsletter

3 of 8

22-12-2011 08:24

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

Subscribe to HowtoForge Newsletter and stay informed about our latest HOWTOs and projects. enter email address

Submit
(To unsubscribe from our newsletter, visit this link.)
English | Deutsch | Site Map/RSS Feeds | Advertise

You are here:
Mod_jk - Page 2

Home » Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk » Configuring Tomcat5 And Apache2 With Virtual Hosts Using

Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk - Page 2

Want to support HowtoForge? Become a subscriber!
Submitted by ctroyp (Contact Author) (Forums) on Sun, 2006-02-12 23:27. ::

0

Like

1

Send

Tweet

0

Installing and configuring mod_jk
In order to make the connection between Tomcat and Apache, we will need to download and install mod_jk connector. You will find that the Apache documentation recommends that you install the packaged version of mod_jk if it is available for your particular Linux distribution. Many outdated resources recommend installing the mod_jk2 connector, but I have found that it has been deprecated and although mod_jk was developed before mod_jk2, it is still fully supported and is very stable. Mike Millson gave some good reasoning behind using mod_jk for connecting Tomcat to Apache for Red Hat here: Integrating Tomcat and Apache on Red Hat Linux. Here is what he had to say:

"At this point, Apache and Tomcat should be working separately in standalone mode. You can run Tomcat in standalone mode as an alternative to Apache. In fact, in some cases, it is said that Tomcat standalone is faster than serving static content from Apache and dynamic content from Tomcat. However, there are the following compelling reasons to use Apache as the front end: 1. You can use Apache to buffer slow connections. Tomcat uses java.io, which uses a thread for each request, so Tomcat can run out of connections as the number of slow requests grows. This could be an issue if your application supports a large number of dial-up users. 2. You can use a connector such as mod_jk to load balance amongst several Tomcat instances.

4 of 8

22-12-2011 08:24

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

3. You can take advantage of Apache features such as cgi and PHP. 4. You can take advantage of Apache modules such as mod_rewrite, mod_headers, and mod_expire. 5. You can isolate virtual hosts in their own Tomcat instances. The increased functionality obtained by using Apache on the front end can outweigh the effort required to install and configure a connector."
At the time of this writing there were no mod_jk packages available from Dedian.org so we will need to build the package from source which will assure it is compiled for you particular installation anyways. I consider this the safer route although it requires more work. 1. I chose to download the current source from the Apache archives: http://archive.apache.org/dist/jakarta/tomcat-connectors /jk/source/jk-1.2.15/. Download the jakarta-tomcat-connectors-1.2.15-src.tar.gz file to your /usr/src/ directory. 2. Change to the /usr/src directory.

cd /usr/src

3. Next, extract the contents to create the /usr/src/jakarta-tomcat-connectors-1.2.15-src directory .

tar xvzf jakarta-tomcat-connectors-1.2.15-src.tar.gz

4. Change to the /usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native directory.

cd jakarta-tomcat-connectors-1.2.15-src/jk/native

5. Now you are ready to create the custom configure file for your system. Execute the following:

./buildconf.sh

This will create a configure file in the /usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native directory. 6. Execute the following command in order to configure mod_jk for your system. Important note: You will need to have apxs2 (APache eXtension tool) installed and configured with Apache. If you do not have it, as was my case, you can download and install the apache2-threaded-dev package (which replaced the former apache-dev package) from www.debian.org. At the time of this writing, the Debian package archive at www.debian.org was down and they referred me to their temporary site until they resolved their issues pdo.debian.net. I found the apache2-threaded-dev package and was able to install it successfully. Be sure to include the correct location apxs2 on your system in the path of the command.

./configure --with-apxs=/usr/bin/apxs2

5 of 8

22-12-2011 08:24

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

7. Now build the mod_jk with the following:

make

8. Finally, if you were successful with the previous commands, copy the newly created mod_jk.so to your Apache2 modules directory. My modules were located at /usr/lib/apache2/modules.

cd apache-2.0 cp /usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native/apache2.0/mod_jk.so /usr/lib/apache2/modules

You now are ready to move to the next stage which is to begin configuring Apache and Tomcat. You can find more information about the mod_jk connector at http://tomcat.apache.org/connectors-doc/howto/apache.html. previous Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk up next Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk - Page 3

Copyright © 2006 C. Troy Popplewell All Rights Reserved.
0 Like 1 Send Tweet 0

add comment |

view as pdf |

print: this | all page(s)

Related Tutorials
Simple Apache 2 Tomcat 5 mod_jk integration

Please do not use the comment function to ask for help! If you need help, please use our forum. Comments will be published after administrator approval.

easier with apt-get
Submitted by Anonymous (not registered) on Mon, 2006-05-08 16:38. Your tutorial is really good, but on a debian (ubuntu) with jdk1.5 and apache2 you only need to do: $ apt-get install libapache2-mod-jk2 And then enable the mod_jk module with 2 symbolic links on /etc/apache2/mod-enable Thanks a lot for your work.

reply |

view as pdf

...but not for sarge
Submitted by Anonymous (not registered) on Tue, 2006-07-18 13:41. mod_jk and mod_jk2 are two different connectors! As sarge only offers the deprecated mod_jk2 through the official repositories, you either have use backports.org or build mod_jk from the source.

reply |

view as pdf

install on ubuntu 7.04

6 of 8

22-12-2011 08:24

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

Submitted by showe1966 (registered user) on Wed, 2007-09-19 11:49. I checked out the repository, and the version available now via the apt-get command is version JK NOT version jk2, so a simple apt-get install libapache2-mod-jk seems to work for me. The version of debian under Ubuntu 7.04 is apparently debian 4.0

reply |

view as pdf

Buidconf on Ubuntu
Submitted by Anonymous (not registered) on Thu, 2006-03-30 20:22. Please Note that by default Ubuntu does not come with a C++ compiler (At least Hoary 5.04). It may be necessary to get it so that the ./buildconf.sh command doesn't bomb. you can get that using the command: sudo aptitude install build-essential

reply |

view as pdf

rpms
Submitted by Anonymous (not registered) on Mon, 2006-03-06 12:42. if you're on a RPM based distribution it is probably wise to stick to using RPMs, jpackage.org provides RPMs for all things java.

reply |

view as pdf

About Step 6
Submitted by Anonymous (not registered) on Tue, 2006-02-14 09:26. In step 6, the command should be ./configure --with-apxs=/usr/bin/apxs2 but not ./configure --with-apxs2=/usr/bin/apxs2 I've tried using the second one and ended in some very needless confusion down the road: "./configure" wasn't finished successfully with the the second one and complained that the "webserver" (parameter) is missing. But that should not be the case because we are configuring for a shared library, not a static one.

reply |

view as pdf

Good catch...
Submitted by Roman (registered user) on Fri, 2006-02-24 22:02. Thanks for catching that. Troy

reply |

view as pdf

7 of 8

22-12-2011 08:24

Configuring Tomcat5 and Apache2 with Virtual Hosts usi...

http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

Howtos | Mini-Howtos | Forums | News | Search | Contribute | Subscription Site Map/RSS Feeds | Advertise | Contact | Disclaimer | Imprint

Copyright © 2011 HowtoForge - Linux Howtos and Tutorials All Rights Reserved.

8 of 8

22-12-2011 08:24

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close