您好,登錄后才能下訂單哦!
聲明:因為運行環境是基于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.com
有興趣的朋友們可以前往球球哦~一起分享學習技術:2042849237
請大家持續關注搭建分布式架構3--CentOs下安裝MySQL(環境準備)
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。