5-JEESZ分散式框架-CentOs下安裝Tomcat7(環境準備)
聲明:因為JEESZ分散式框架運行環境是基於linux系統的,這邊也總結了網上的一些資料,考慮到後期博客作為框架的原生教程,故這邊做詳細的安裝記錄,也希望能夠幫助到各位朋友
1. 安裝tomcat
通過ssh將apache-tomcat-7.0.61.tar.gz文件上傳到/usr/local中執行以下操作:
[root@cloud /]cd /usr/local
[root@cloud /]tar -zxvf apache-tomcat-7.0.61.tar.gz
[root@cloud /]mv apache-tomcat-7.0.61 tomcat
2. 啟動Tomcat
[root@cloud ~]# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /home/java/jdk1.7/
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
出現以上信息說明已成功啟動。
3. 防火牆開放8080埠
[root@cloud /]vi + /etc/sysconfig/iptables
#增加以下代碼
#Tomcat 8080
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
4. 重啟防火牆
[root@cloud /]service iptables restart
5. 檢驗Tomcat安裝運行,通過你自己的伺服器IP查看tomcat是否運行正常:
http://xxx.xxx.xxx.xxx:8080/
看到tomcat系統界面,說明安裝成功!
6. 停止Tomcat
[root@cloud ~]# /usr/local/tomcat/bin/shutdown.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /home/java/jdk1.7
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
7. 查看啟動、停止日誌
[root@cloud ~]# cd /usr/local/tomcat/logs/
[root@cloud logs]# ls
catalina.2016-02-13.log catalina.out
host-manager.2016-02-14.log localhost.2016-02-14.log
localhost_access_log.2016-02-14.txt manager.2016-02-14.log
catalina.2016-02-14.log host-manager.2016-02-13.log
localhost.2016-02-13.log localhost_access_log.2016-02-13.txt
manager.2016-02-13.log
[root@cloud logs]# tail -f catalina.out
Feb 14, 2016 1:25:33 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Feb 14, 2016 1:25:33 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Feb 14, 2016 1:25:33 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Feb 14, 2016 1:25:33 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Feb 14, 2016 1:25:33 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
聲明:該框架面向企業,是大型互聯網分散式企業架構,後期會介紹linux上部署高可用集群項目。
有願意瞭解框架技術或者源碼的朋友直接加Q(2137028325)一起學習