**LINUX基础安装**
-
JDK 1.8
yum install java-1.8.0-openjdk* -y
安装目录默认为: /usr/lib/jvm 查看安装是否成功:java -version -
MYSQL (RPM安装)
- 下载
cd /usr/local
wget https://dev.mysql.com/get/mysql57-community-release-el7- 11.noarch.rpm - 解压
yum localinstall mysql57-community-release-el7-11.noarch.rpm - 安装mysql
yum install mysql-server
mysqld --initialize --user=mysql - 看默认密码
vi /var/log/mysqld.log - 启动
systemctl start mysqld - 修改密码
mysqladmin -uroot -p password
(忘记密码,配置skip-grant-tables可以不用密码进去mysql)
上面命令不好用可以执行下边命令
use mysql;
update user set password=password(“test”) where user=‘root’;
注意:如果Mysql的版本是5.7及以上的话update语句更换如下:
update user set authentication_string=password(“root”) where user=“root”; - 启动mysql并查看状态
systemctl status mysqld - 设置开机启动
systemctl enable mysqld
systemctl daemon-reload - 修改my.cnf配置
在[mysqld]下增加
character_set_server = utf8
lower_case_table_names=1
sql_mode=STRICT_TRANS_TABLES,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
grant all PRIVILEGES on . to root@’%’ identified by ‘liang219’; - 重启
systemctl restart mysqld
- 下载
1.安装编译工具和Nginx依赖
yum -y install gcc gcc-c++ autoconf automake make yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
2.上传并解压安装包
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
3.安装Nginx
./configure --prefix=/jbs/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream
然后执行:make && make install
安装完成后Nginx的安装目录为 /jbs/nginx
4.常用命令
#启动 nginx服务
/jbs/nginx/sbin/nginx
#停止服务
/jbs/nginx/sbin/nginx -s stop
#重启服务
/jbs/nginx/sbin/nginx -s reload