Integrate apache with jdk + tomcat configuration in AS4

Source: Internet
Author: User
In AS4, jdk + tomcat configuration is integrated with apache-Linux Enterprise Application-Linux server application information. The following is a detailed description. Operating System: LINUX AS4
Software Version:
Jdk-1_5_0_06-linux-i586.bin
Httpd-2.2.4.tar.gz
Jakarta-tomcat-5.0.27.tar.gz
Jakarta-tomcat-connectors-jk2-src-current.tar.gz

1. jdk Installation
[Root @ localhost tja] # chmod + x jdk-1_5_0_06-linux-i586.bin
# Grant jdk1.5 the execution permission

[Root @ localhost tja] #./jdk-1_5_0_06-linux-i586.bin
# Binfile can be directly run and installed

[Root @ localhost tja] # mv jdk1.5.0 _ 06/usr/local/jdk
# Rename the installed file as jdk and test it to/usr/local/

[Root @ localhost tja] # vi/etc/profile
# Edit the profile file and add environment variables. Add the following at the end of the file:
JAVA_HOME =/usr/local/jdk/
CLASSPATH =.: $ JAVA_HOME/lib/tools. jar:/lib. dt. jar
PATH = $ JAVA_HOME/bin: $ PATH
Export JAVA_HOME CLASSPATH PATH
Save the disk and exit.

[Root @ localhost tja] # java-version
# Check whether the current java version is 1.5
Java version "1.5.0 _ 06"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 06-b05)
Java HotSpot (TM) Client VM (build 1.5.0 _ 06-b05, mixed mode, sharing)
If the above information is displayed, java is correctly installed.

2. install apache.
[Root @ localhost tja] # tar xzvf httpd-2.2.4.tar.gz
[Root @ localhost tja] # cd httpd-2.2.4
[Root @ localhost tja] #./configure -- prefix =/usr/local/apache2 -- enable-so
[Root @ localhost httpd-2.2.4] # make & make install
# Unpack the installation package compilation and installation directory. enable-so is used to load the jk2 connector, compile and install

[Root @ localhost httpd-2.2.4] #/usr/local/apache/bin/apachectl start
# Start the apache service and open the web page on the client to test the service.

3. install tomcat.
[Root @ localhost tja] # tar xzvf jakarta-tomcat-5.0.27.tar.gz
[Root @ localhost tja] # mv jakarta-tomcat-5.0.27/usr/local/tomcat
# Undo the installation package and rename it to tomcat and repeat it to/usr/local /.

[Root @ localhost tja] #/usr/local/tomcat/bin/startup. sh
# Start the tomcat Service
Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JAVA_HOME:/usr/local/jdk/
If the preceding information is displayed, tomcat is started properly.

At this time, the client can open IE and enter the tomcat service address: 8080. Normally, the default tomcat page will appear, a cat.
[Root @ localhost tja] #/usr/local/tomcat/bin/shutdown. sh
# Disable the tomcat Service

4. jk2 compilation and Loading
[Root @ localhost tja] # tar jakarta-tomcat-connectors-jk2-src-current.tar.gz
[Root @ localhost tja] # cd jakarta-tomcat-connectors-jk2-src-current/jk/native2
[Root @ localhost native2] #./configure -- with-apxs2 =/usr/local/apache/bin/apxs
[Root @ localhost native2] # make
# Unlock the installation package into the Undo package directory/jk/native2, compile, after make, you will find an additional jakarta-tomcat-connectors-jk2-src-current/jk/build directory.

[Root @ localhost tja] # cd jakarta-tomcat-connectors-jk2-2.0.4-
Src/jk/build/jk2/apache2/
[Root @ localhost apache2] #/usr/local/apache/bin/apxs-n jk2-I mod_jk2.so
# Go To/build/jk2/apache2 and run/usr/local/apache/bin/apxs-n jk2-I mod_jk2.so, mod_jk2.so is generated in/usr/local/apache/modules.

[Root @ localhost tja] # ll/usr/local/apache/modules/
View the/uyr/local/apache/modules directory and you will find that a directory named
Mod_jk2.so file.

[Root @ localhost tja] # vi/usr/local/apache/conf/httpd. conf
# Edit the httpd. conf file and add
LoadModule jk2_module modules/mod_jk2.so
Save disk and exit

[Root @ localhost tja] # vi/usr/local/apache/conf/workers2.properties
# Create the workers2.properties file in the/usr/local/apache/conf directory.
The content is as follows:
[Logger. apache2]
Level = DEBUG
[Shm]
File =/usr/local/apache2/logs/shm. file
Size = 1048576
# Example socket channel, override port and host.
[Channel. socket: localhost: 8009]
Port = 8009
Host = 127.0.0.1
# Define the worker
[Ajp13: localhost: 8009]
Channel = channel. socket: localhost: 8009
# Uri mapping
[Uri:/*]
Worker = ajp13: localhost: 8009
Save disk and exit

[Root @ localhost tja] #/usr/local/apache/bin/apachectl start
[Root @ localhost tja] #/usr/local/tomcat/bin/startup. sh
# Start apache and tomcat

Open IE on the client to access 192.168.1.121 (the address of apache and tomcat server in this example). The default Cat Screen of tomcat appears, and then access 192.168.1.121: 8080, still the cat picture./
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.