Tomcat and JBoss tutorials under CentOS

  
 

Ali is a variety of Java applications, how can you not learn Tomcat and JBoss? First, CentOS install Java

First confirm the current version of Java

[root@ Localhost web]# java -version

The JDK version is selected, there are two official JDK and openJDK, the following is the official JDK.

JDK download address: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

I downloaded the 7u25 version. Because it is a rpm package, the installation is very simple:

[root@localhost web]# rpm -ivh jdk-7u25-linux-i586.rpm

JDK is installed by default in /usr/java .

Use java -version to test if the installation is successful.

By default, you can use java, javac program without configuring environment variables. Here is a description of the configuration method: modify the system environment variable file /etc/profile, and add the following content to the file: JAVA_HOME=/usr /java/jdk1.7.0_25JRE_HOME=/usr/java/jdk1.7.0_25/jrePATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools .jar:$JRE_HOME/libexport JAVA_HOME JRE_HOME PATH CLASSPATH

[root@localhost web]# source /etc/profile //Make the above changes take effect [root@localhost web]# echo $PATH //View whether to modify Success

Second, CentOS configuration Tomcat

Download: http://tomcat.apache.org/download-70.cgi

My current version is 7.0.42 . Tomcat provides a green version, which does not require user-compiled compilation, so it can be used after decompression. [root@localhost web]# tar zxf apache-tomcat-7.0.42.tar.gz //Unpack the installation package [root@localhost web]# mv apache-tomcat-7.0.42 /usr/local/tomcat //put tomcat Move to the /usr/local/tomcat directory [root@localhost tomcat]# /usr/local/tomcat/bin/startup.sh //Execute the configuration script

Using CATALINA_BASE: /usr/local/tomcatUsing CATALINA_HOME : /usr/local/tomcatUsing CATALINA_TMPDIR: /usr/local/tomcat/tempUsing JRE_HOME: /usr/java/jdk1.7.0_25/jreUsing CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/Tomcat/bin/tomcat-juli.jar

//The above information indicates successful startup

Configure iptables firewall: [root@localhost tomcat]# vi /etc/sysconfig/iptables

-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT //Insert a line on COMMIT

[root@localhost tomcat]# service iptables restart //Restart iptables

Visit http://192.168.153.128:8080 and see the Tomcat interface installed successfully.

Three, CentOS configuration JBoss

Download: http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1. 1.Final.tar.gz[root@localhost web]# tar zxf jboss-as-7.1.1.Final.tar.gz //Unpack the installation package [root@localhost web]# mv jboss-as-7.1.1. Final /usr/local/jboss //Move jboss to /usr/local

Execute add admin user: [root@localhost bin]# ./bin/add-user.sh
< a> Management User (mgmt-users.properties) b) Application User (application-users.properties)(a): a

Enter the details of the New user to add.Realm (ManagementRealm) : Username : hack0nairPassword : Re-enter Password : About to add user 'hack0nair' for realm 'ManagementRealm'Is this correct yes/no? yes

Modify system environment variables: [root@localhost bin]# vi /etc/profile

JBOSS_HOME=/usr/local/jboss export JBOSS_HOME //Add JBOSS path

Modify standalone.xml file: at the bottom of the file , change the ip address to your ip

<interfaces><interf Ace name="management"><inet-address value="${jboss.bind.address.management:192.168.153.128}"/></interface><interface name="public" ;><inet-address value="${jboss.bind.address:192.168.153.128}"/></interface><!-- TODO - only show this if the jacorb subsystem is added --><interface name="unsecure"><!--~ Used for IIOP sockets in the standard configuration.~ To secure JacORB you need to setup SSL--><inet-address value= "${jboss.bind.address.unsecure:192.168.153.128}"/></interface><interface name="ipv4"><any-ipv4-address/></Interface></interfaces>

Start JBoss:[root@localhost jboss]# /usr/local/jboss/bin/standalone.sh

Visit http://192.168.153.128: 9990/, if the administrator page can be opened, the configuration is successful.

Copyright © Windows knowledge All Rights Reserved