Tomcat5.0.18 apache2.0.50 linux9 integration process (full version) Lee peak preface: On the "Apache2.0.50 Tomcat 5.0.18 Linux9 Configuration Process" issued, many friends put forward a lot of details, in order to meet everyone's needs, the author With the configuration process as the main line, insert the necessary explanation, strive to clear and complete, the main operation command is mainly operational command, the blue body (except for the URL) is the result, the crude blue body is marked Welcome everyone to make an opinion. Suppose you have now owned: 1. J2SDK-1_4_2_05-Linux-i586-rpm.bin2. Httpd-2.0.50.tar.gz3. Jakarta-Tomcat-5.0.18.tar.gz4. Jakarta-Tomcat-Connectors-JK2 -2.0.4-src.tar.gz and place it in the / www directory. [If you don't have these installation packages, you can find online, or directly to me (lushanle@hotmail.com), pay attention to the version number as much as possible] First, install JDK everyone from the JDK version of JDK downloaded from the Internet It is BIN format, which must be converted to the RPM format (if it is the file in the RPM format). 1. Make the bin file. [root @ localhost www] # chmod x j2sdk-1_4_2_05-linux-i586-rpm.bin2. Unzip. [root @ localhost www] # ./j2sdk-1_4_2_05-linux-i586-rpm.bin3. Direct installation, default installation path is / usr / java [root @ localhost www] # rpm -ivh J2SDK-1_4_2_05-linux-i586 . rpm4. In order to operate, it is necessary to establish a JDK synchronization directory for J2SDK1.4.2_05 just installed [root @ localhost java] # ln -s j2sdk1.4.2_05 jdk5. Set the environment variable java_home (this variable is behind Used in Tomcat). [root @ localhost java] # vi / etc / profile The following two lines of java_home = / usr / java / jdkexport java_home save exit 6. Verify the setting of the variable. If you feel smooth, you can skip this step. [root @ localhost java] # echo $ java_home Everyone will find that the return is not panic, exit and log in to the system can be [root @ localhost java] # EXIT [root @ localhost /] # echo $ java_home / usr / Java / JDK If this is returned, the setting is successful. This is complete, your JDK is installed. Second, the installation of Tomcattomcat is relatively simple, running after decompression. 7. Copy the installation package to the / usr / local directory installation, if you are unlocked in the / www directory, the author installs it to / usr / local in order to make the directory specification. [root @ localhost www] # cp jakarta-tomcat-5.0.18.tar.gz / usr / local [root @ localhost local] # tar -zxvf jakarta-tomcat-5.0.18.tar.gz8. Loaded after decompression JAKARTA-TOMCAT-5.0.18 Creates a synchronization directory called Tomcat.
[root @ localhost local] # ln -s jakarta-tomcat-5.0.18 tomcat9. Set the environment variable Catalina_home, and verify [root @ localhost local] # vi / etc / profile In the file, finally add the following two lines Catalina_Home = / usr / Local / Tomcatexport Catalina_Home Saves Exit Verification Catalina_home process The process of verifying Java_home above. 10. Start and test the installation result [root @ localhost local] # cd ./tomcat/bin[root@localhost bin] # ./startup.shusing catalina_base: / usr / local / tomcatusing catalina_home: / usr / local / tomcatusing catalina_tmpdir: / usr / local / tomcat / tempusing java_home: / usr / java / jdk Open the browser, type the host address and port number 8080, enter the carriage return, http: //192.168.1.205: 8080 If the following screen appears, the installation success. Third, installing Apache is relatively above, there are more steps, but the specific operation is simple. 11. Copy the installation package to / usr / local and decompressed in the target directory. [root @ localhost www] # cp httpd-2.0.50.tar.gz / usr / local [root @ localhost www] # cd / usr / local [root @ localhost local] # tar -zxvf httpd-2.0.50.tar .gz12. Configure the installation parameters, the installed target directory is / usr / local / apache2, be sure to set enable-mods-shared = all, otherwise it will be reported when compiling. [root @ localhost local] # CD httpd-2.0.50 [root @ localhost httpd-2.0.50] # ./configure --prefix = / usr / local / apache2 --enable-mods-shared = all13. Compile and install . [root @ localhost httpd-2.0.50] # make [root @ localhost httpd-2.0.50] # make install14. Start Apache and test. [root @ localhost httpd-2.0.50] # cd / usr / local / apache2 / bin [root @ localhost bin] # ./apachectl start opens the browser and enter the host's IP address in the address bar, such as http: // 192.168.1.205 If the following screen appears, the installation is successful. Fourth, generate connector 15. Copy source package to / usr / local and decompressed in the target directory (Of course, it can be done in the original directory, the author is in order to specify, so the installed program is put under / usr / local) . [root @ localhost www] # cp jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz / usr / local [root @ localhost www] # CD / usr / local [root @ localhost local] # tar - ZXVF JAKARTA-TOMCAT-Connectors-JK2-2.0.4-src.tar.gz16. Create a Connector sync directory to simplify operations.
[root @ localhost local] # ln -s jakarta-tomcat-connectors-jk2-2.0.4-src connector17. Compile configuration. Everyone must pay attention to the top three in these parameters. It is important to go to the corresponding directory to see if the relevant file is exist. [root @ localhost local] # cd connectionctor [root @ localhost native2] # ./configure --with-apxs2 = / usr / local / apache2 / bin / apxs --with-apr-lib = / usr / local / apache2 / BIN --WITH-TOMCAT-41 = / usr / local / tomcat --with-java-home = / usr / java / jdk --with-jni18. Modify the Makefile file, this file is the key to compiling the generated connector, due to If it is packed by default, it is necessary to modify it, the key! If no modification is likely to appear errors in the appendix. [root @ localhost native2] # cd server / apache2 [root @ localhost apache2] # vi makefile is easy to find ###### Based on rules.mk ############# #################### 将 将 行 行 i i { APR_LIBS} endif all commented out or removed, and add the following six rows at which the ifdef APR_LIBDIR_LAJK_LDFLAGS = -L $ {APACHE2_LIBDIR} -lcryptelseJK_LDFLAGS = -lcrypt $ {APR_LIBS} JK_LDFLAGS = -lcrypt $ {APR_LIBS} -L / usr / local / apache2 / lib -laprutil-0 -lgdbm -ldb-4.0 -lexpatendif following results #ifdef APR_LIBDIR_LA # JK_LDFLAGS = -L $ {APACHE2_LIBDIR} -lcrypt # else # JK_LDFLAGS = -lcrypt $ {APR_LIBS} #endififdef APR_LIBDIR_LAJK_LDFLAGS = -L $ {APACHE2_LIBDIR} -lcryptelseJK_LDFLAGS = -lcrypt $ {APR_LIBS} JK_LDFLAGS = -lcrypt $ {APR_LIBS} -L / usr / local / apache2 / lib -laprutil-0 -lgdbm -ldb-4.0 -lexpatendif ###### Based on Rules.mk ############################################################################################ 19. Compile [root @ localhost apache2] # Make20. Run APXS under Apache, if the following result is returned, proof is normal.
[root @ localhost apache2] # cd .. [root @ localhost server] # cd .. [root @ localhost native2] # cd ../build/jk2/apache2[Root@localhost apache2] # / usr / local / apache2 / BIN / APXS-N jk2 -i mod_jk2.so/usr/local/apache2/build/instdso.sh sh_libtool = '/ usr / local / apache2 / build / libtool' mod_jk2.so / usr / local / apache2 / modules / usr / local / apache2 / build / libtool --mode = install cp mode_jk2.so / usr / local / apache2 / modules / cp mode_jk2.so /usr/local/apache2/Modules/mod_jk2.soWarning! DLNAME NOT FOUND IN / USR / Local / Apache2 / Modules / Mod_jk2.so.assuming Installing a .so Rather Than Libtool archive.chmod 755 /usr/local/apache2/modules/mod_jk2.so21. Copy Generation Two Files to Apache's modules directory, these two A file is responsible for Tomcat and Apache communication. [root @ localhost apache2] # cp libjkjni.so /usr/local/apache2/modules/jkjni.so[Root@localhost apache2] # cp mode_jk2.so / usr / local / apache2 / modules / cp: overwrite `/ usr / LOCAL / APACHE2 / MODULES / MOD_JK2.SO '? Y five configuration 22. Configure the jk2.properties for Tomcat, just modify the line, find shm.file, remove the comment of the row, and change the path to / usr / Local / Apache2 / logs / jk2.shm.