First, install the JDK (can be installed under root permissions, so that other users will also have the environment)
1.1 Upload jdk-8u91-linux-x64.tar.gz to the specified directory
1.2 extract JDK
#创建文件夹
mkdir/usr/java
#解压
TAR-ZXVF Jdk-8u91-linux-x64.tar.gz
1.3 Add JAVA to an environment variable
vim/etc/profile
#在文件最后添加
export Java_home=/usr/java /jdk1.8.0_91
export path= $PATH: $JAVA _home/bin
make changes to the configuration file take effect immediately:
Source/etc/profile
second, Tomcat installation
http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.0/bin/
1, download tomcat, download the address as follows:
Http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.0/bin/apache-tomcat-8.5.0.tar.gz
2, the download of Tomcat uploaded to the/usr/local
(Can be uploaded through the RZ command, if not the RZ command can be installed through such as Yum command: yum-y install Lrzsz)
Tar-vxzf apache-tomcat-8.0.50.tar.gz
Rename the extracted directory name tomcat
MV apache-tomcat-8.0.50 Tomcat
3. Add Tomcat Environment variables
vi/usr/local/tomcat/bin/catalina.sh
Add: Catalina_home=/usr/local/tomcat
Third, the firewall configuration
(http://www.cnblogs.com/kreo/p/4368811.html
http://www.linuxidc.com/Linux/2014-12/110677.htm)
#先检查是否安装了iptables
Service Iptables Status
#安装iptables
Yum install-y iptables
#升级iptables
Yum Update iptables
#安装iptables-services
Yum Install Iptables-services
#停止firewalld服务
Systemctl Stop Firewalld
#禁用firewalld服务
Systemctl Mask Firewalld
#禁止firewall开机启动
Systemctl Disable Firewalld.service
The next thing is the same as using iptables, to open a port, (for example, 80 ports, red for added rules):
Vi/etc/sysconfig/iptables
-A input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT #允许80端口通过防火墙
######################## After adding firewall rules as follows
# Firewall configuration written by System-config-firewall
# Manual Customization of this file is not recommended.
*filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [0:0]
-A input-m state–state established,related-j ACCEPT
-A input-p icmp-j ACCEPT
-A input-i lo-j ACCEPT
-A input-m state–state new-m tcp-p tcp–dport 22-j ACCEPT
-A input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT
-A input-j Reject–reject-with icmp-host-prohibited
-A forward-j Reject–reject-with icmp-host-prohibited
When you have finished modifying, start Tomcat and enter the following address
http://localhost:8080 (if not native, enter the corresponding IP address)
The test presence of a Tomcat page indicates a successful test.
Four, install MySQL
V. Deployment of common Java applications
[You can see me before writing this article]
(http://blog.csdn.net/u013850277/article/details/53447391)
VI. Deployment of Web projects
Package the project into a war package directly in Eclipse and place it in the corresponding directory in Tomcat.