搭建分佈式架構2--CentOs下安裝Tomcat7(環境準備)

聲明:由於運行環境是基於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 -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
java

[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
linux

7. 查看啓動、中止日誌apache

[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"]
bootstrap

請你們持續關注搭建分佈式架構3--Dubbo簡介tomcat

相關文章
相關標籤/搜索