1.pre
为了更方便的管理安装的软件需要创建个专用目录
cd ~
mkdir data # disk
cd data
mkdir software # 软件安装位置
mkdir tar_box # tar包存放位置
|
2.setup jdk
采用wget安装,安装源为官方jdk,选择jdk7
Install Java with Alternatives
Now you may also required to set up javac and jar commands path using alternatives command.
alternatives -- install /usr/bin/jar jar /data/software/jdk1 .7.0_75 /bin/jar 2
alternatives -- install /usr/bin/javac javac /data/software/jdk1 .7.0_75 /bin/javac 2
alternatives -- set jar /data/software/jdk1 .7.0_75 /bin/jar
alternatives -- set javac /data/software/jdk1 .7.0_75 /bin/javac
|
--------------------------------jdk8 下载地址------------------------------------------
jdk8安装方式
--------------------------------------------------------------------------
Configuring Environment Variables
我们采用下面的2种其一:
cd ~
vi .bashrc
export JAVA_HOME= /data/software/jdk1 .7.0_75
export PATH=$PATH:$JAVA_HOME /bin
export CLASSPATH=.:$JAVA_HOME /lib/dt .jar:$JAVA_HOME /lib/tools .jar
source ~/.bashrc
|
cd ~
vi .bashrc
source ~/.bashrc
export JAVA_HOME= /data/software/jdk1 .7.0_75
export JRE_HOME=$JAVA_HOME /jre
export PATH=$PATH:$JAVA_HOME /bin :$JRE_HOME /bin
source ~/.bashrc
|
配置完毕需要使其生效并进行检测,输出如下:
[root@iZ23e9wcapqZ ~]# source ~/.bashrc
[root@iZ23e9wcapqZ ~]# echo $JAVA_HOME
/data/software/jdk1.7.0_75
[root@iZ23e9wcapqZ ~]#
检测jdk是否正确安装并配置
2.tomcat install
安装前需套检查是否安装了
JAVA is the first requirement for Tomcat 7 installation. Make sure you haveJAVA SE 6 or Later version installed in your system. Use following command to check if you have java installed already on your system.
2.1 download the tomacat jar
2.2 extract and setup the jar
cd /data/software/
tar zxvf tar_box /apache-tomcat-7 .0.59. tar .gz
mv apache-tomcat-7.0.59 tomcat-7.0.59-8181
|
Tomcat is very easy to use, There are no need to compile its source. You simple extract the archive and start the tomcat server. Tomcat by default start on port 8080, Make sure no other services are running on same port using ‘telnet localhost 8080′.
tomcat-7.0.59-8181/bin/startup.sh
Sample Output
Using CATALINA_BASE: /data/software/tomcat-7.0.59-8181
Using CATALINA_HOME: /data/software/tomcat-7.0.59-8181
Using CATALINA_TMPDIR: /data/software/tomcat-7.0.59-8181/temp
Using JRE_HOME: /usr
Using CLASSPATH: /data/software/tomcat-7.0.59-8181/bin/bootstrap.jar:/data/software/tomcat-7.0.59-8181/bin/tomcat-juli.jar
Tomcat started.
2.3 如果需要外网访问,请确保防火墙关闭或者tomcat的端口打开!
------------------------tips---------------------------
查看端口是否已经打开
netstat -an|grep 8181
查看端口是被哪个应用程序使用:
netstat -apn
ps -ef
---------------------------------------------------
查看防火墙中8181 port是否打开
service iptables status
如果没有打开需要:
即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
|
ex:
vi /etc/sysconfig/iptables
添加
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8181 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
yy当前行,p 粘贴
(
注意添加在
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
之前,否则可能导致规则不生效)
重启防火墙service iptables restart
|
root@ZL-host04 ~]
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0 /0 0.0.0.0 /0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0 /0 0.0.0.0 /0
3 ACCEPT all -- 0.0.0.0 /0 0.0.0.0 /0
4 ACCEPT tcp -- 0.0.0.0 /0 0.0.0.0 /0 state NEW tcp dpt:22
5 ACCEPT tcp -- 0.0.0.0 /0 0.0.0.0 /0 state NEW tcp dpt:8181
6 ACCEPT tcp -- 0.0.0.0 /0 0.0.0.0 /0 state NEW tcp dpt:3306
7 REJECT all -- 0.0.0.0 /0 0.0.0.0 /0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0 /0 0.0.0.0 /0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
|
端口已打开,如上所示!
3.mysql install
3.1 pre
yum remove mysql
yum install gcc
yum install gcc-c++
yum install cmake
perl 安装与否判断
|
3.2 mysql-jar
本文出自 “Romantic Dev” 博客,请务必保留此出处http://xinbaby88.blog.51cto.com/9943025/1616072
(责任编辑:IT) |