Install the JSP runtime environment under CentOS6.5

Source: Internet
Author: User
Tags java se
------ The following content is the materials that have been tested and verified by myself in the VMWare and PC environment. friends who have common interests can collect them. For technical exchange, you can add QQ: 1864837 or email to this QQ mailbox. 1. install Apache (also called httpd) 1. check whether Apache # rpm-qa | grephttpd2 has been installed. the following information has been tested and verified on VMWare and PC, if you have any interests, you can add them to your favorites. For technical exchange, you can add QQ: 1864837 or email to this QQ mailbox. 1. install Apache (also called httpd) 1. check whether Apache is installed # rpm-qa | grep httpd 2. install Apache # yum install httpd-y in yum. 3. configure httpd after installation. conf file (usually in the/etc/httpd/conf/path) (1) change ServerName to localhost: 80 (2) change DirectoryIndex index.html to the home page File 4. modify the/etc/sysconfig/iptables file, add the following rules to allow port 80-a input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT 5. configure the httpd service to start automatically # chkconfig -- level 35 httpd on so far Apache can be automatically started with the system, you can access port 80 of the server to open the home page. 2. by default, the JDK system will contain OpenJDK, or you can install OpenJDK through yum, or download Java SE from www.oracle.com to install it, the downloaded file is a jdk-6u45-linux-i586-rpm.bin (Java SE is recommended) 1. first check whether the jdk-6u45-linux-i586-rpm.bin file has executable permissions # ls-l jdk-6u45-linux-i586-rpm.bin 2. if there is no executable permission, assign # chmod + x jdk-6u45-linux-i586-rpm.bin 3. execute the jdk-6u45-linux-i586-rpm.bin to install Java SE #. /jdk-6u45-linux-i586-rpm.bin 4, configure the environment variable # vi/etc/profile add the following code at the end of the file JAVA_HOME =/usr/java/jdk1.6.0 _ 45 CLASSPATH = $ JAVA_HOME/lib: $ JAVA_HOME/jre/libPATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/binexport path classpath JAVA_HOME packages 1. decompress the tomcat package to the/usr/local/directory, change the decompressed directory to tomcat 2. configure tomcat to run automatically at Server startup # vi/etc/rc. d/rc. add the following code to the end of the local file: export JDK_HOME =/usr/java/jdk1.6.0 _ 45 export JAVA_HOME =/usr/java/jdk1.6.0 _ 45/usr/local/tomcat/bin/startup. sh 3. modify the/etc/sysconfig/iptables file, add the following rules to allow port 8080-a input-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT so far Tomcat can be automatically started with the system, you can access port 8080 of the server to open the Tomcat homepage. 4. Apache and Tomcat are integrated through jk. 1. check whether the apxs file exists in the/usr/sbin/path, if not, install the apr-util-devel and httpd-devel packages, after the installation is complete/usr/sbin/apxs file has # yum install apr_util-devel httpd-devel-y 2, install autoconf, libtool package (required for compilation) # yum install autoconf libtool-y 3, unzip jk compressed package, enter the native Directory # tar-zxvf tomcat-connectors-1.2.40-src.tar.gz # cd tomcat-connectors-1.2.40-src/native 4, execute the compilation process #. /buildconf. sh #. /configure -- with-apxs =/usr/sbin/apxs # make the generated mod_jk.so file in the/tomcat-connectors-1.2.40-src/native/apache-2.0/directory copy mod_jk.so to/etc/httpd/ modules 5. modify/etc/httpd/conf/httpd. conf configuration file // add LoadModule jk_module modules/mod_jk.so // Add Include/etc/httpd/conf/mod_jk.conf 6 to Include, and modify/etc/httpd/conf/workers. properties configuration file worker. list = worker1worker. workerx. type = ajp12worker. workerx. host = localhostworker. workerx. port = 8009worker. workerx. lbfactor = 50worker. workerx. cachesize = 10worker. workerx. cache_timeout = 600worker. workerx. socket_keepalive = 1worker. workerx. socket_timeout = 300 7. modify the/etc/httpd/conf/mod_jk.conf configuration file JkWorkersFile conf/workers. propertiesJkLogFile logs/mod_jk.logJkLogLevel infoJkLogStampFormat "[% a % B % d % H: % M: % S % Y] "JkRequestLogFormat" % w % V % T "JkMount/servlet/* worker1JkMount /*. jsp worker1 8. modify/usr/local/tomcat/conf/server. add the // Note path to the xml configuration file // HOST segment 9. create a test webpage and test the integration effect. the default webpage path is/var/www/html/# vi index. jsp. restart the server and access the homepage. the JSP code is displayed.
Related Article

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.