Dubbo基础篇_CentOS安装jdk,Tomact环境

一、查看CentOS版本,IP,是否开启sshd

1.查看ip

ifconfig eth0

2.查看sshd是否开启

chkconfig --list sshd

3.开启sshd

chkconfig sshd on

4.查看操作系统

uname

5.查看内核版本

uname -r

6.查看GentOS版本

cat /etc/redhat-release

7.增加用户

useradd usrname

8.修改用户密码

passwd username

9.修改新增用户的管理为root

vi /etc/passwd

找到用户,设置userid为0.groupid为0

10.修改hostname

vi /etc/hosts

增加

192.168.1.121  edu-provider-01


重新打开窗口会发现hostname变了


二、使用WinSCP通过sshd上传可解压jdk1.7、tomcat7压缩包,以新建用户登录(我这里是yxq)

Dubbo基础篇_CentOS安装jdk,Tomact环境_第1张图片

Dubbo基础篇_CentOS安装jdk,Tomact环境_第2张图片

三、使用xshell来安装jdk1.7,tomcat7

Dubbo基础篇_CentOS安装jdk,Tomact环境_第3张图片

[objc] view plain copy 

  1. Connecting to 192.168.1.121:22...  

  2. Connection established.  

  3. To escape to local shell, press 'Ctrl+Alt+]'.  

  4.   

  5.   

  6. Last login: Wed Mar 23 06:58:49 2016 from 192.168.11.1  

  7. [root@edu-provider-01 ~]# ls  

  8. apache-tomcat-7.0.61.tar.gz  jdk1.7.0_45.tar.gz  

  9. [root@edu-provider-01 ~]#   


1.安装jdk1.7


[cpp] view plain copy 

  1. [root@edu-provider-01 ~]# mkdir /usr/java  

  2. [root@edu-provider-01 ~]# ls  

  3. apache-tomcat-7.0.61.tar.gz  jdk1.7.0_45.tar.gz  

  4. [root@edu-provider-01 ~]# tar -zxvf jdk1.7.0_45.tar.gz  -C /usr/java  

[cpp] view plain copy 

  1. <span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">[root@edu-provider-01 ~]# ln -s /usr/java/jdk1.7.0_45 /usr/jdk</span>  

[root@edu-provider-01 ~]# vi /etc/profile

文件中加入:

JAVA_HOME=/usr/jdk

CLASSPATH=$JAVA_HOME/lib/

PATH=$PATH:$JAVA_HOME/bin

export PATH

[root@edu-provider-01 ~]# source /etc/profile

[root@edu-provider-01 ~]# Java -version

"1.7.0_45"Java(TM) SE Runtime Environment (build 1.7.0_45-b18)

Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

[root@edu-provider-01 ~]# 


2.安装tomcat7


[cpp] view plain copy 

  1. [root@edu-provider-01 ~]# mkdir /usr/local/tomcat  

  2. [root@edu-provider-01 ~]# tar -xzvf apache-tomcat-7.0.61.tar.gz -C /usr/local/tomcat  

  3. [root@edu-provider-01 ~]# ln -s /usr/local/tomcat/apache-tomcat-7.0.61/ /usr/local/tomcat7  

3.配置防火墙


[cpp] view plain copy 

  1. [root@edu-provider-01 ~]# vi /etc/sysconfig/iptables  

  2. [root@edu-provider-01 ~]# cat /etc/sysconfig/iptables | grep 8080  

  3. -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT  

  4. [root@edu-provider-01 ~]# service iptables restart  

  5. iptables: Setting chains to policy ACCEPT: filter          [  OK  ]  

  6. iptables: Flushing firewall rules:                         [  OK  ]  

  7. iptables: Unloading modules:                               [  OK  ]  

  8. iptables: Applying firewall rules:                         [  OK  ]  

  9. [root@edu-provider-01 ~]#   

4.启动,停止.重启tomcat7及查看日志


[cpp] view plain copy 

  1. [root@edu-provider-01 ~]# /usr/local/tomcat7/bin/startup.sh start  

  2. Using CATALINA_BASE:   /usr/local/tomcat7  

  3. Using CATALINA_HOME:   /usr/local/tomcat7  

  4. Using CATALINA_TMPDIR: /usr/local/tomcat7/temp  

  5. Using JRE_HOME:        /usr/jdk  

  6. Using CLASSPATH:       /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar  

  7. Tomcat started.  

  8. [root@edu-provider-01 ~]# /usr/local/tomcat7/bin/startup.sh stop  

  9. Using CATALINA_BASE:   /usr/local/tomcat7  

  10. Using CATALINA_HOME:   /usr/local/tomcat7  

  11. Using CATALINA_TMPDIR: /usr/local/tomcat7/temp  

  12. Using JRE_HOME:        /usr/jdk  

  13. Using CLASSPATH:       /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar  

  14. Tomcat started.  

  15. [root@edu-provider-01 ~]# /usr/local/tomcat7/bin/startup.sh restart  

  16. Using CATALINA_BASE:   /usr/local/tomcat7  

  17. Using CATALINA_HOME:   /usr/local/tomcat7  

  18. Using CATALINA_TMPDIR: /usr/local/tomcat7/temp  

  19. Using JRE_HOME:        /usr/jdk  

  20. Using CLASSPATH:       /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar  

  21. Tomcat started.  

  22. [root@edu-provider-01 ~]# tail -f /usr/local/tomcat7/logs/catalina.out   

  23. Mar 23, 2016 7:45:51 AM org.apache.catalina.core.StandardService stopInternal  

  24. INFO: Stopping service Catalina  

  25. Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol stop  

  26. INFO: Stopping ProtocolHandler ["http-bio-8080"]  

  27. Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol destroy  

  28. INFO: Destroying ProtocolHandler ["http-bio-8080"]  

  29. Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol stop  

  30. INFO: Stopping ProtocolHandler ["ajp-bio-8009"]  

  31. Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol destroy  

  32. INFO: Destroying ProtocolHandler ["ajp-bio-8009"]  

4.验证tomcat7是否成功安装


你可能感兴趣的:(jdk,tomcat,linux)