aliyun CentOS 7 install software jdk mysql tomcat zentao and so on

1. install jdk

#查看CentOS自带JDK是否已安装
yumlistinstalled|grepjava

#若有自带安装的JDK,如何卸载CentOS系统自带Java环境?
##卸载JDK相关文件输入:
yum-yremovejava-1.8.0-openjdk*。
##卸载tzdata-java输入:
yum-yremovetzdata-java.noarch。
#当结果显示为Complete!即卸载完毕。

#查看yum库中的Java安装包
#输入:
yum-ylistjava*
#使用yum安装Java环境
#输入:
yum-yinstalljava-1.8.0-openjdk*
#当结果显示为Complete!即安装完毕。
#注:“*”表示将java-1.8.0的所有相关Java程序都安装上。

2. install MysqL

查看有没有安装过:
yumlistinstalledMysqL*
rpm-qa|grepMysqL*

查看有没有安装包:
yumlistMysqL*

安装MysqL客户端:
yuminstallMysqL

安装MysqL服务器端:
yuminstallMysqL-server
yuminstallMysqL-devel

安装MysqL客户端与服务器端时需要注意:

CentOS7的yum源中认是没有MysqL
您可以选择安装mariadb
yuminstallmariadb-server
yuminstallmariadb-devel
yuminstallmariadb-test
或者您可以下载并安装MysqL的,前提是需要先下载MysqL的repo源
#下载MysqL的repo源
wgethttp://repo.MysqL.com/MysqL-community-release-el7-5.noarch.rpm
#安装MysqL-community-release-el7-5.noarch.rpm包
rpm-ivhMysqL-community-release-el7-5.noarch.rpm

#安装这个包后,会获得两个MysqL的yumrepo源:
#/etc/yum.repos.d/MysqL-community.repo,
#/etc/yum.repos.d/MysqL-community-source.repo

#安装MysqL
yuminstallMysqL-server
#设置密码
MysqL-uroot
#登录时有可能报这样的错:ERROR2002(HY000):
#Can`tconnecttolocalMysqLserverthroughsocket#'/var/lib/MysqL/MysqL.sock'(2),
#原因是/var/lib/MysqL的访问权限问题

chown-Rroot/var/lib/MysqL
serviceMysqLdrestart

MysqL-uroot
useMysqL;
updateusersetpassword=password('123456')whereuser='root';
MysqL相关命令
#启动MysqL
systemctlstartmariadb.service或者systemctlstartMysqLd.service

#结束
systemctlstopmariadb.service或者systemctlstopMysqLd.service

#重启
systemctlrestartmariadb.service或者systemctlrestartMysqLd.service

#开机自启
systemctlenablemariadb.service或者systemctlenableMysqLd.service


开放3306及80端口,供外网访问

CentOS升级到7之后,无法使用iptables控制Linuxs的端口,使用firewalld代替了原来的iptables
使用firewalld开放Linux端口:
#开启端口
firewall-cmd--zone=public--add-port=80/tcp--permanent
firewall-cmd--zone=public--add-port=3306/tcp--permanent
#命令含义:
--zone#作用域
--add-port=80/tcp#添加端口,格式为:端口/通讯协议
--permanent#永久生效,没有此参数重启后失效

#重启防火墙
firewall-cmd--reload
#查看状态
firewall-cmd--state
firewall-cmd--list-all


仍然想使用iptables开放端口的话,需要作如下工作

yuminstalliptables-services
systemctlmaskfirewalld.service
systemctlstopfirewalld.service
systemctlenableiptables.service
systemctlenableip6tables.service
#静态防火墙规则配置文件是/etc/sysconfig/iptables以及/etc/sysconfig/ip6tables
vi/etc/sysconfig/iptables#编辑防火墙配置文件
#在
#-AINPUT-jREJECT--reject-withicmp-host-prohibited
#-AFORWARD-jREJECT--reject-withicmp-host-prohibited
#之前添加
#-AINPUT-mstate--stateNEW-mtcp-ptcp--dport80-jACCEPT
#-AINPUT-mstate--stateNEW-mtcp-ptcp--dport3306-jACCEPT
systemctlrestartiptables.service#最后重启防火墙使配置生效
systemctlenableiptables.service#设置防火墙开机启动

如果想切换回CentOS 7防火墙管理的话需要执行以下命令:
systemctlstatusfirewalld
#usedthefollowingcommandtoenablethefirewall
systemctlunmaskfirewalld
systemctlenablefirewalld
systemctlstartfirewalld

systemctlstatusfirewalld
#下面操作与上面使用firewalld开启防火墙一样

MysqL创建用户并开启相应权限

grantallprivilegeson*.*totest@localhostidentifiedby'123456';
grantallprivilegeson*.*totest@'%'identifiedby'123456';
flushprivileges;

3. install tomcat

yum repo 中tomcat是7,我们需下载tomcat8

wgethttp://tomcat.apache.org/download-80.cgi

#wgethttp://apache.fayea.com/tomcat/tomcat-8/v8.5.4/bin/apache-tomcat-8.5.4-deployer.tar.gz

wgethttp://apache.fayea.com/tomcat/tomcat-8/v8.5.4/bin/apache-tomcat-8.5.4.tar.gz

tarzxvfapache-tomcat-8.5.4.tar.gz/opt/tomcat
mvapache-tomcat-8.5.4/opt/tomcat/tomcat-8.5.4-8181
#开启防火墙
firewall-cmd--zone=public--add-port=8181/tcp--permanent
firewall-cmd--reload
firewall-cmd--state
firewall-cmd--list-all

4.install 禅道

成功操作

wgethttp://dl.cnezsoft.com/zentao/8.2.4/ZenTaoPMS.8.2.4.zBox_64.tar.gz
tar-zxvfZenTaoPMS.8.2.4.zBox_64.tar.gz-C/opt

/opt/zBox/zBox-mp3307
/opt/zBox/zBox-ap8090
/opt/zBox/zBoxstart

/opt/zBox/auth/adduser.sh

firewall-cmd--zone=public--add-port=8090/tcp--permanent
firewall-cmd--reload
firewall-cmd--state
firewall-cmd--list-all

说明:

1、将安装包直接解压到/opt目录下,不要解压到别的目录再拷贝到/opt/,
因为这样会导致文件的所有者和读写权限改变。
可以使用命令:tar-zxvfZenTaoPMS.8.2.4.zBox_64.tar.gz-C/opt
2、执行/opt/zBox/zBoxstart命令开启Apache和MysqL。
执行/opt/zBox/zBoxstop命令停止Apache和MysqL。
执行/opt/zBox/zBoxrestart命令重启Apache和MysqL。
可以使用/opt/zBox/zBox-h命令来获取关于zBox命令的帮助
其中-ap参数可以修改Apache的端口,-mp参数可以修改MysqL的端口
(比如:/opt/zBox/zBox-ap8080)

3、浏览器访问http://ip:端口(认帐号admin,密码123456)
4、数据库用户名:root,密码为空。数据库管理用的是adminer,但是为了安全,
访问adminer的时候需要身份验证,需要运行/opt/zBox/auth/adduser.sh
来添加用户(先cd/opt/zBox/auth/然后执行./adduser.sh)。
5、网页访问禅道,点击数据库管理有2层验证:
1)弹窗验证是输入运行addusers.sh添加的帐号和密码;
2)网页直接显示登录界面:服务器:127.0.0.1:MysqL端口
帐号root数据库填写zentao

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native