Creation and management of government Web sites (Next) (2)

Source: Internet
Author: User
Web| created earlier we've introduced Apache, and here's the Tomcat server software. Tomcat is a collaboration between Sun and Apache to Jspserver, support to Servlet2.2 and JSP1.1. It is recommended that Tomcat be used, and Tomcat will replace Jserv as the main servlet&jspengine of Apache in the future. Tomcat is designed to perform in a standalone server, unlike Jserv, which is attached to Apache, and thus more capable of httpservlet in the servlet. Tomcat is a Java program, so you can use it as long as you have a JDK, and you don't need to consider the operating system platform.

The Tomcat server extended as a Web server has some questions to note:

* Tomcat is not as fast as Apache when dealing with static pages.
* Tomcat is not as configurable as Apache.
* Tomcat is not as strong as Apache.

For the above reasons, a realistic web site uses Apache as a Web server to service static page requests for a Web site, and uses Tomcat server as a servlet/jsp plugin to display the dynamic pages of a Web site.

The use of apache->tomcat such a structure to have more outstanding advantages, mainly reflected in the better scalability and security. The main feature of this type of site is that each page may be dynamically generated, but the main part of the data is still static (for example, all kinds of images gif, JPG, PNG, streaming media, etc.), the advantages of this structure are both scalability and security.

Take Solairs8 as an example, download the Solaris version of apache1.3.27,tomcat4.1.12 for free to illustrate the installation configuration Web services software Apache and application services software tomcat (including JDK), other platforms can be analogous.

Note: The version of Apache and Tomcat downloaded is related to the type of operating system.

(i) Application environment

The operating system is SOLARIS8, the application environment is Java1.3 (assuming installed in the/usr/java1.3 directory), perl5.6 (assuming installed in the/usr/local/bin directory) and gzip (assumed to be installed in the/usr/loca/bin directory).

(ii) Download, compilation and installation of software packages

1) Download Address

In http://www.apache.org you can download the Apache source code package apache_1.3.27.tar.gz.
In http://jakarta.apache.org/builds/tomcat/release/v4.1.12/src/you can download the Tomcat source code package jakarta-tomcat-4.1.12-src.tar.gz.
In http://jakarta.apache.org/builds/jakarta-tomcat/release/v4.1.12/bin/ You can download the compiled Tomcat application package jakarta-tomcat-4.1.12.tar.gz.

2) Compiling and installing

Assuming that the packages are downloaded to a current working directory (such as:/HOME/TMP), Apache and Tomcat will be installed in the/home directory. In the current directory we can do the following.

(1) Compiling and installing Apache application services

① Solution Package
$/usr/local/bin/gzip-dc./apache_1.3.27.tar.gz|tarxf-
② compilation
$cdapache _1.3.27
$./configure--prefix=/home/apache-1.3.27
--with-perl=/usr/local/bin/perl--enable-module=so
Suppose Perl's interpretation commands are installed in the/usr/local/bin directory,
The Apache service is installed in the/home/apache-1.3.27 directory.
$make
③ Installation
$su
#makeinstall

(2) Compiling and installing MOD_JK plug-ins

① Solution Package
$/usr/local/bin/gzip-dcjakarta-tomcat-4.1.12-src.tar.gz|tarxf-
② compilation
$cdjakarta-tomcat-4.1.12-src/src/native/apache1.3
$/home/apache-1.3.27/bin/apxs-omod_jk.so-dsolaris-i.. /jk-i/
usr/java1.3/include-i/usr/java1.3/include/
Solaris-lposix4-c*.c.. /jk/*.c
Suppose Java is installed in the/usr/java1.3 directory.
③ Installation
$su
#/home/apache-1.3.27/bin/apxs-i-a-njkmod_jk.so
The installation is successful when the screen displays the following content.
Cpmod_jk.so/home/apache-1.3.27/libexec/mod_jk.so
Chmod755/home/apache-1.3.27/libexec/mod_jk.so
[Activatingmodule ' jkin/home/apache-1.3.27/conf/httpd.conf] uses the Superuser identity to unpack the compiled Tomcat4.1.12 to the/home directory.

$su
#/usr/local/bin/gzip-dcjakarta-tomcat-4.1.12.tar.gz|
(cd/home;tarxf-)

3) Parameter Configuration

(1) Configure Apache Service

Use the VI command to open the Apache configuration file httpd.conf.
#cd/home/apache-1.3.27/conf
#vihttpd. conf
Add the following at the end.
Jkworkersfile/home/jakarta-tomcat-4.1.12/conf/workers.properties
Jklogfile/home/apache-1.3.27/logs/mod_jk.log
Note: The log file can be adjusted according to the specific situation.
Jkloglevelwarn
Jkmount/*.jspajp13
Jkmount/servlet/*.jspajp13

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.