Tomcat5.0.18 + apache2.0.50 + linux9 integration process (full version) installation articles

xiaoxiao2021-03-06  41

Foreword: Soon "Apache2.0.50 Tomcat5.0.18 Linux9 configuration process" issued, many friends put forward many details, in order to meet everyone's needs, the author uses the configuration process as the main line, insert the necessary explanation, strive to clear and complete, text The main order of the medium is mainly the operation command, the blue body (except for the URL) is the result of returning, the crude blue body is marked, and the result of modification is required, and everyone will give advice. 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 the JDK everyone from the JDK version of JDK is generally 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 the space, do not panic, exit to log in to the system [root @ localhost java] # EXIT [root @ localhost /] # echo java_home / usr / java / If the JDK returns this line, 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 ############# ########################################################################################################################################### 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 ##################################################################################################################################################################################################################################################################################### ### After saving. 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. [root @ localhost apache2] # CD / usr / local / tomcat / conf [root @ localhost conf] # vi jk2.properties

# channelunix.file = {jkhome} /Work/jk2.socket# Just to check if the the config is working shm.file = / usr / local / apache2 / logs / jk2.shm

# In Order to Enable Jni Use Any ChannelJni Directive # Channeljni.disabled = 0 # and one of the folowing directives:

23. Configure apache's httpd.conf, add a line after loadModule, loadModule JK2_Module Modules / Mod_jk2.so will load mod_jk2.so [root @ localhost conf] # CD / usr / local / apache2 / conf [root) when LoadModule starts @localhost conf] # vi httpd.confLoadModule rewrite_module modules / mod_rewrite.soLoadModule jk2_module modules / mod_jk2.so24. creation in the Apache conf directory file workers2.properties, adding the following lines [root @ localhost conf] # vi workers2.properties Among them, you can add Tomcat's virtual directory [URI: / JSP-EXAMPLES / *] Of course, you can also add [URI: / servlets-examples / *] so you can access servlets-example # ------ Start --------- [SHM] file = / usr / local / apache / logs / shm.filesize = 1048576 [Channel. Socket: localhost: 8009] Tomcatid = localhost: 8009 [URI: / JSP-Examples / *] # -------- End ------------ Save Exit 25. Start Tomcat, Apache and test [root @ localhost conf] # CD / usr / local / 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 [root @ Localhost bin] # CD / usr / local / apache2 / bin [root @ localhost bin] # ./apachec TL Start Opens the browser, enter http: // host address / jsp-examples such as http://192.168.1.205 / jsp-esamples

转载请注明原文地址:https://www.9cbs.com/read-68166.html

New Post(0)