1、查看CentOS版本,IP,是否開啓sshdjava
1.查看ipshell
ifconfig eth0apache
2.查看sshd是否開啓bootstrap
chkconfig --list sshdxcode
3.開啓sshdtomcat
chkconfig sshd onssh
4.查看操做系統tcp
unameide
5.查看內核版本ui
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變了
2、使用WinSCP經過sshd上傳可解壓jdk1.七、tomcat7壓縮包,以新建用戶登陸(我這裏是yxq)
3、使用xshell來安裝jdk1.7,tomcat7
[objc] view plain copy
Connecting to 192.168.1.121:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Wed Mar 23 06:58:49 2016 from 192.168.11.1
[root@edu-provider-01 ~]# ls
apache-tomcat-7.0.61.tar.gz jdk1.7.0_45.tar.gz
[root@edu-provider-01 ~]#
1.安裝jdk1.7
[cpp] view plain copy
[root@edu-provider-01 ~]# mkdir /usr/java
[root@edu-provider-01 ~]# ls
apache-tomcat-7.0.61.tar.gz jdk1.7.0_45.tar.gz
[root@edu-provider-01 ~]# tar -zxvf jdk1.7.0_45.tar.gz -C /usr/java
[cpp] view plain copy
<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
[root@edu-provider-01 ~]# mkdir /usr/local/tomcat
[root@edu-provider-01 ~]# tar -xzvf apache-tomcat-7.0.61.tar.gz -C /usr/local/tomcat
[root@edu-provider-01 ~]# ln -s /usr/local/tomcat/apache-tomcat-7.0.61/ /usr/local/tomcat7
3.配置防火牆
[cpp] view plain copy
[root@edu-provider-01 ~]# vi /etc/sysconfig/iptables
[root@edu-provider-01 ~]# cat /etc/sysconfig/iptables | grep 8080
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
[root@edu-provider-01 ~]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]
[root@edu-provider-01 ~]#
4.啓動,中止.重啓tomcat7及查看日誌
[cpp] view plain copy
[root@edu-provider-01 ~]# /usr/local/tomcat7/bin/startup.sh start
Using CATALINA_BASE: /usr/local/tomcat7
Using CATALINA_HOME: /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME: /usr/jdk
Using CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
Tomcat started.
[root@edu-provider-01 ~]# /usr/local/tomcat7/bin/startup.sh stop
Using CATALINA_BASE: /usr/local/tomcat7
Using CATALINA_HOME: /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME: /usr/jdk
Using CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
Tomcat started.
[root@edu-provider-01 ~]# /usr/local/tomcat7/bin/startup.sh restart
Using CATALINA_BASE: /usr/local/tomcat7
Using CATALINA_HOME: /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME: /usr/jdk
Using CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
Tomcat started.
[root@edu-provider-01 ~]# tail -f /usr/local/tomcat7/logs/catalina.out
Mar 23, 2016 7:45:51 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Mar 23, 2016 7:45:51 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
4.驗證tomcat7是否成功安裝