Apache and Tomcat Installation Configuration Manual
Apache and Tomcat Installation Configuration Manual
Many friends send me, I hope to get the latest installation document, I use my spare time, install the latest operating system Red Hat Linux Release 8.0 (PSYCHE) and the latest application, and reset the Apache and Tomcat integration configuration The installation and configuration is more smooth, so update this document, I hope that everyone will help! If there is any mistake, please refer to you! Ok, no longer Luo!
1. The required package J2SDK-1_4_1_02-linux-i586
Apache2.0.40 (Red Hat Linux)
JAKARTA-TOMCAT-4.1.18
JAKARTA-TOMCAT-Connectors-4.1.18
2. Package download address (1) Java J2SE1.4.1
URL: http://java.sun.com/j2se/1.4.1/download.html
(2) Apache2.0.40
URL: http://httpd.apache.org
(3) Tomcat 4.1.18
URL: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.18/bin/jakarta-tomcat-4.1.18.tar.gz
(4) Tomcat Connectors-4.1.18
URL: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.18/src/jakarta-tomcat-connectors-4.1.18-src.tar.gz
3. Software installation (1) Unconverting the compression package
Using Gunzip or TAR or RPM to unwave downloaded packages, follow the default mode to be installed
(2) Treatment of the directory
J2SDK installation directory: /usr/j2sdk1.4.1_02
Apache installation directory: / etc / httpd
/ usr / lib / Apache
/ var / www
JAKARTA-TOMCAT installation directory: /opt/jakarta-tomcat-4.1.18
JAKARTA-TOMCAT-Connectors installation directory: /opt/jakarta-tomcat-connectors-4.1.18-src
4. Environment variables set java_home = / usr / j2sdk1.4.1_02
ClassPath = $ java_home / lib: $ java_home / jre / lib
Catalina_base = / opt / jakarta-Tomcat-4.1.18
Catalina_Home = / OPT / JAKARTA-TOMCAT-4.1.18
PATH = $ java_home / bin: $ java_home / jre / bin: $ PATH: $ HOME / BIN
5. Special installation (1) Compile JAKARTA-TOMCAT-Connectors
CD /opt/jakarta-tomcat-connectors-4.1.18-src/webapp ## Enter the specified directory
./support/buildconf.sh ## Generate compilation profile
./configure --with-apxs ## Generate makefile compilation file
Make ## Compilation MOD_WEBAPP.SO
Note: The generated mod_webapp.so file is in the Apache-2.0 directory
(2) Copy the mod_webapp.so file in the Apache-2.0 directory to the directory / usr / lib / httpd / modules
And check the properties of the file /usr/lib/httpd/modules/mod_webapp.so, should be with other modules files
The attribute is consistent, if not the same, use chmod chgrp chown to modify
6. Test (1) Test the Java health, as follows:
Java -Version
Javac -Version
See the version number indicates that the JDK installation success (2) Test the health of Apache, as follows:
/etc/init.d/httpd restart ## Restart Apache Server
Use any browser, enter the server address, enter the server, you should see the default home page of Apache
(3) Test the health status of JAKARTA-TOMCAT, as follows:
CD $ CATALINA_HOME
CD bin
./startup.sh ## Start Jakarta-Tomcat-4.1.18 service
After using any browser, enter the server address and port number 8080, you should see the default home page of Jakarta-Tomcat-4.1.18.
For example: http://192.192.192.1:8080
./shutdown.sh ## Close Jakarta-Tomcat-4.0.1 service
7. Integrated installation settings (1) Modify /etc/httpd/conf/httpd.conf file
Add the following after # Dynamic Shared Object (DSO) Support
LoadModule WebApp_Module Modules / Mod_Webapp.so
(2) Test configuration and modules, perform the following command
Apachectl Configtest
If SYNTAX OK appears, it is proved that the module installation and configuration is successful!
3) Modify the /etc/httpd/conf/httpd.conf file
Add below in the end of the file
WebAppConnection WarpConnection Warp localhost: 8008
WebAppDeploy Examples WarpConnection / Examples / EXAMPLES /
4) Test the configuration again, perform the following command
Apachectl Configtest
If SYNTAX OK appears, the installation is successful!
If the following error message appears
Syntax error on line 1038 of /etc/httpd/conf/httpd.conf:
INVALID VIRTUAL HOST NAME
Modify the httpd.conf file, find the line where #servername is located, and add the following below.
ServerName Localhost: 8008 # Develops the name and port of the server
5) Check the configuration in the Catalina_Home / conf / server.xml file, by default
of
The relevant information is commented, so you need to delete the comment statement.
This will initialize when Tomcat is started.
Related content and open 8008 port!
8. Integration test restart all services
$ Catalina_home / bin / shutdown.sh
$ Catalina_home / bin / startup.sh
/etc/init.d/httpd restart
Enter the following address in your browser
HTTP: // Server IP / Examples / JSP / INDEX.HTML, if the normal web page can be displayed, the installation is successful
Enter the following address in your browser
HTTP: // Server IP / Examples / JSP / JSPTOSERV / JSPTOSERVLET.JSP If normal web pages can be displayed, JSP and Servlet are successfully installed.
9. I wish you good luck, if there is a problem, please contact me!