Jdk安装
官网下载
http://www.oracle.com/technetwork/java/javase/downloads/index.html 下载linux版本jdk-xxx.tar.gz
上传并解压 tar -zxf jdk-xxx.tar.gz
配置环境变量 vi /etc/profile
,复制解压后jdk目录,示例:
JAVA_HOME= /usr/soft/1.8.0_191
PATH=$PATH:$JAVA_HOME/bin
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
刷新配置 source /etc/profile
, 查看是否安装成功java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Tomcat安装
下载tomcat https://tomcat.apache.org/download-80.cgi
上传并解压 tar apache-tomcat-xx.tar.gz
进入bin目录 cd ./bin
, 启动tomcat ./startup.sh
进入logs目录查看日志 tail -f catalina.out
关闭防火墙, 就可以通过浏览器访问了(ip:8080)
-
service iptables status
查看防火墙状态 -
service iptables stop
关闭防火墙
Mysql安装
环境: CentOS6
如果已经安装过先卸载,查看是否安装rpm -qa | grep mysql
, 卸载 yum –y remove 包名
或者 rpm -e --nodeps 包名
安装mysqlyum -y install mysql-server mysql mysql-devel
- 启动:
service mysqld start
- 查看:
ps aux | grep mysql
- 停止:
service mysqld stop
- 重启:
service mysqld restart
创建root管理员 mysqladmin -u root password 123456
登陆 mysql -uroot -p123456
允许其他客户端访问,先关闭防火墙.然后在sql命令界面执行以下操作
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)