在export下创建两个目录
mkdir -p /export/soft
mkdir -p /export/install
解压
在/etc/profile.d的目录内创建java.sh文件,编辑一下内容
export JAVA_HOME=/export/install/jdk1.8.0_144 (java 解压后的路径)
export PATH= P A T H : PATH: PATH:JAVA_HOME/bin ($PATH:加上JAVA_HOME/bin)
source命令用法:source FileName
作用:在当前bash环境下读取并执行FileName中的命令。
注:该命令通常用命令".”来替代
source /etc/profile
jps (查看java此时的进程)
[root@node01 install]# jps
-bash: jps: command not found (没有安装成功)
[root@node01 install]# jps (安装成功)
29601 Jps
java-version
[root@node01 install]# java -version
java version "1.7.0_131"
更新软链接
删除: rm -rf /etc/alternatives/java
创建: ln -s /export/install/jdk1.8.0_144/bin/java /etc/alternatives/java
[root@node01 install]# java -version
java version "1.8.0_144"
1.上传安装文件并解压
tar -zxvf apache-tomcat-7.0.82.tar.gz-C /export/install/
2.启动
进入tomcat的安装目录下有个bin 进入bin 执行启动
./startup.sh
说明:tomcat 所有的日志均打入到了安装目录下的logs文件中的catalina.out
web项目(war包格式)部署的路径是安装路径下的webapps
1.确认当前系统是否已经安装mysql
rpm -qa | grep mysql
本地源或者网络源必须存在,并且有效
2.安装mysql
yum install -y mysql-servcer
3.查看mysql当前状态
/etc/init.d/mysqld status 或者 service mysqld status (status 状态 start 启动 stop 停止 restart 重启)
4.启动mysql
/etc/init.d/mysql start 或者 service mysqld start
进入mysql shell窗口
1.直接mysql + 回车
2.mysqk -u用户名 -p密码(中间没有空格)
为root用户设置密码
mysqladmin -u root password 密码 (有特殊字符需要加单引号)
1.进入mysql shell窗口
输入 mysql
2.查看当前编码格式
命令:show variables like ‘character_set_%’,
mysql>show variables like ‘character_set_%’,
±-------------------------±---------------------------+
| Variable_name | Value |
±-------------------------±---------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
±-------------------------±---------------------------+
3、修改mysql的 配置文件
vim /etc/my.cnf 添加如下配置 保存退出
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
4.重启mysql
service mysqld restart
5.二次确认
进入mysql shell窗口 执行查询
mysql> show variables like ‘character_set_%’;
±-------------------------±---------------------------+
| Variable_name | Value |
±-------------------------±---------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
±-------------------------±---------------------------+
1.查看当前mysql 允许哪些主机连接
进入mysqlshell 查看mysql数据库的user表信息
select host,user,password from user;
mysql> select host, user ,password from user;
±----------±-----±------------------------------------------+
| host | user | password |
±----------±-----±------------------------------------------+
| localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| node01 | root | |
| 127.0.0.1 | root | |
| localhost | | |
| node01 | | |
±----------±-----±------------------------------------------+
host :允许访问的主机
user:主机使用的用户
password:允许用户使用的密码
2.添加权限
让任何主机使用rootu用户 123456密码,都能访问本mysql
grant all privileges on . to ‘root’@’%’ identified by ‘123456’ with grant option;
3.刷新权限
flush privileges;
4.二次确认
mysql>select host,user,password from user;
±----------±-----±------------------------------------------+
| host | user | password |
±----------±-----±------------------------------------------+
| localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| node01 | root | |
| 127.0.0.1 | root | |
| localhost | | |
| node01 | | |
*| % | root | 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
±----------±-----±------------------------------------------+
5.关闭linux防火墙
设置防火墙开机不自动启动
设置防火墙开机自启动