Apache here to introduce my Redhat Linux 7.2 under the integration of Apache and TOMCAT4 process, focusing on mod_webapp.so production methods,
And in the virtual Host environment configuration, management and application, has been tested successfully. I hope to help you, please correct me if you have any mistakes.
First, the correct installation of TOMCAT4
Installation of the necessary software, as follows:
1. Java SDK
Version 1.3.1 or 1.4, it is recommended to install it under/usr/java and make a soft link to the JDK.
If there is a problem installing the version 1.3.1 SDK, read the documentation: http://java.sun.com/j2se/1.3/install-linux-sdk.html
2, TOMCAT4
It is recommended that you install the binary file installation package for the latest release version. Currently the latest Tomcat version is 4.1.12.
Download Address:
Http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.12/bin/jakarta-tomcat-4.1.12.tar.gz
This example installs Tomcat in the/OPT directory and makes a soft link for Tomcat.
Set the following environment variables and enable:
It is recommended that you create a single user tomcat to/opt/tomcat the owner of all of the following directory files and start Tomcat by it:
# Useradd Tomcat
# Chown-r Tomcat:tomcat/opt/tomcat
# su-tomcat-c "/opt/tomcat/bin/startup.sh"
Access http://localhost:8080/should be able to see the successful Tomcat installation page.
Second, the integration of Apache and TOMCAT4
1, first install Apache,
Please note that Apache must be installed in DSO mode, that is, when executing./configure should be added--enable-module=so
The default installation is in the/usr/local/apache directory. The version of Apache installed in this example is the 1.3 series.
2, the production of mod_webapp.so
The following packages are required:
Jakarta-tomcat-connectors-4.x.xx-src.tar.gz
The download address is in the Tomcat version of the SRC directory. For example, the Tomcat version I installed is 4.1.12, and now the location of the package you need is:
As long as the "Syntax OK" shows that the mod_webapp.so has been installed successfully.
Start Apache
#/usr/local/apache/bin/apachectl Start
Visit the Http://localhost/examples to see the Tomcat example program.
Third, the configuration, management and application under the virtual host
The following is an example of how a virtual host uses both Apache and TOMCAT4
The directory structure of the virtual host host1 is as follows:
/www
|---The home directory of the host1 virtual host host1
| |--htdocs Common root: For displaying static pages or PHP programs
| |----Logs Apache access log
| |----WebApps Java application directory (new addition, no association with Tomcat's WebApps directory)
| |--root JSP root: For displaying JSP page programs
| |----Jive A SET of Java application examples
|---The home directory of the HOST2 virtual host Host2
............
The original Apache configuration file is configured like this:
#注: The purpose of this row is to use the root directory as the root of the virtual host URL and invalidate the previously defined root htdocs.
#但如果不想整个虚拟主机都使用jsp页面程序 and want to use a lot of static pages or PHP programs,
#就要使用下面这行, and put all the static pages and PHP programs in the Htdocs directory.
# Webappdeploy ROOT warpconnection/jsp
Webappdeploy Manager Warpconnection/manager
Webappdeploy Jive Warpconnection/jive
#在server. In XML, each of the definitions should add a webappdeploy here.
4, the Tomcat user is set to/www/host1/webapps all the following directory files of the owner.
It should be noted that if you want to upload or change the files below the directory, you should change their owner to Tomcat.
(if Tomcat is always running as root, this step can be omitted.) )
# Chown-r Tomcat:tomcat/www/host1/webapps
5. Restart Tomcat:
# su-tomcat-c "/opt/tomcat/bin/shutdown.sh"
# su-tomcat-c "/opt/tomcat/bin/startup.sh"
6, Back up Apache:
/usr/local/apache/bin/apachectl restart
The access http://host1.mydomain.com/manager/html will prompt for a password, and after you have entered the correct myname and MYPASSWD, you will see the "Tomcat Web Application Manager" page. The application path inside is already the information configured in the virtual host and can be managed.
The configuration and management to this virtual host is complete, and the rest is testing and application. In the example above
We have already installed the jive and have been tested to run normally.
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.