Set up apache + tomcat + jk instances under slackware10.1

Source: Internet
Author: User
Article Title: Set up apache + tomcat + jk instances under slackware10.1. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Software Download: tomcat 5.5.9

Http://mirror.vmmatrix.net/apache/dist/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9.tar.gz

Jk 1.2.14

Http://www.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.14/jakarta-tomcat-connectors-1.2.14-src.tar.gz

Install tomcat and put the downloaded tomcat in the/usr/local directory for decompression

Tar zxvf jakarta-tomcat-5. * .tar.gz

Change the decompressed directory to tomcat

Music jakarta-tomcat-5.5.9 tomcat

Start tomcat

Cd/usr/local/tomcat/bin
./Startup. sh

The following output indicates that the startup is successful.

Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/lib/java

In this case, you can access port 8080 of the server to display the default Interface of the tomcat server.
As follows:

Install jk 1.2.14 and decompress the file jakarta-tomcat-connectors-1.2.14-src.tar.gz in the/usr/local directory.

Cd/usr/local/
Tar zxvf jakarta-tomcat-connectors * .tar.gz

Compile and install

CDS/usr/local/jakarta-tomcat-connectors-1.2.14-src/jk/native
./Buildconfig. sh
./Configure? With-apxs = "/usr/sbin/apxs "? With-java-home = "/usr/lib/java
Make
Make install

Jk 1.2.14 has been installed.

If apache is configured, copy the mod_jk.so file from the jsp file to the/usr/libexec/apache directory.

Cp/usr/local/jakarta-tomcat-connectors-1.2.14-src/jk/native/apache-1.3/mod_jk.so/usr/libexec/apache/

Copy the/usr/local/tomcat/conf/workers. properties. minimal file to the/etc/apache/workers. properties file.

Cp/usr/local/tomcat/conf/workers. properties. minimal/etc/apache/workers. properties

Write the/etc/apache/mod_jk.conf file with the following content:


JkWorkersFile/etc/apache/workers. properties
JkLogFile/var/log/mod_jk.log
JkLogLevel warn

# Sample JkMounts. Replace these with the paths you wowould
# Like to mount from your JSP server.
JkMount/*. jsp ajp13w
JkMount/servlet/* ajp13w
JkMount/examples/* ajp13w
 

Edit the/etc/apache/httpd. conf file and add the following content:

LoadModule jk_module libexec/apache/mod_jk.so
AddModule mod_jk.c
Include/etc/apache/mod_jk.conf

Link the/var/www/htdocs directory to the/usr/local/tomcat/webapps/ROOT directory.
Note: you must first rename the original ROOT directory.

Cd/usr/local/tomcat/webapps/
Mv ROOT ROOTBAK
Ln-s/var/www/htdocs/usr/local/tomcat/webapps/ROOT
Cp-r/usr/local/tomcat/webapps/ROOTBAK/*/usr/local/tomcat/webapps/ROOT/

Restart tomcat and apache

Cd/usr/local/tomcat/bin
./Shutdown. sh
./Startup. sh
/Etc/rc. d/rc. httpd restart

Now you can directly access the server/index. jsp to display the tomcat interface. For example, my server is 192.168.0.254.

I have three index.html index. php index. jsp files under the/var/www/htdocs/directory.

The following are

Index.html

Index. php

Index. jsp


Good luck!

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.