聲明:因為運行環境是基於Linux系統的,在做此框架之前需要做一些前期的環境準備工作CentOs下安裝Tomcat7網上很多實例,因為博客後期作為框架的原生教程,故這邊做詳細的安裝記錄,我這邊已經下載好了Tomcat7,通過ssh已經上傳到指定的目錄,這裡直接講解安裝的過程。1. 安裝tomcat通 ...
聲明:因為運行環境是基於Linux系統的,在做此框架之前需要做一些前期的環境準備工作
CentOs下安裝Tomcat7網上很多實例,因為博客後期作為框架的原生教程,故這邊做詳細的安裝記錄,我這邊已經下載好了Tomcat7,通過ssh已經上傳到指定的目錄,這裡直接講解安裝的過程。
1. 安裝tomcat
通過ssh將apache-tomcat-7.0.61.tar.gz文件上傳到/usr/local中執行以下操作:
[root@cloud /]cd /usr/local
[root@cloud /]tar -zxvfapache-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 AMorg.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"]
想瞭解更多詳細請點擊源碼地址獲取:mingli
有興趣的朋友們可以前往球球哦~一起分享學習技術:2042849237
請大家持續關註搭建分散式架構3--CentOs下安裝MySQL(環境準備)