MySQL安装
通过rpm方式安装,文件位置是系统默认的
1、删除centos自带的数据管理软件mariadb
查找是否有mariadb: rpm -qa | grep mariadb
删除mariadb: rpm -e --nodeps 软件名称
2、下载mysql rpm安装包
下载地址 : dev.mysql.com/downloads/m…
3、解压mysql-5.7.43-1.el7.x86_64.rpm-bundle.tar文件到 /usr/lcoal/mysql文件夹
tar -vxf mysql-5.7.43-1.el7.x86\_64.rpm-bundle.tar -C /usr/lcoal/mysq
4、安装rpm包:
5、启动mysql服务(服务名称mysqd)
systemctl start mysqld 启动服务
systemctl status mysqld 查看服务状态
systemctl stop mysqld 关闭服务
systemctl enable mysqld 开机自动启动mysqld服务
net-tools下有命令可以查看已经启动的服务
netstat -tunlp 查看所有
netstat -tunlp | grep mysqld 通过管道符筛选服务
ps -ef 查看所有进程
ps -ef | grep mysql 查看mysql进程
6、获取临时密码:
cat /var/log/mysqld.log | grep password(默认的安装路径决定的文件位置)
7、修改密码
8、关闭防火墙或者开放端口:
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
firewall-cmd --zone=public --list-ports
firewall-cmd --zone=public --add-port=8888/tcp --permanent
firewall-cmd --zone=public --remove-port=8888/tcp --permanent
firewall-cmd --reload
Nacos安装
1、下载 github.com/alibaba/nac…
2、tar -zxvf nacos-server-1.4.1.tar.gz -C /usr/local 解压到usr/local目录
3、cd nacos/bin
4、./startup.sh -m standalone 启动nacos
5、tail -f /usr/local/nacos/logs/start.out 查看启动日志
6、开启鉴权(2.2.1版本删除了nacos.core.auth.plugin.nacos.token.secret.key默认值,需要手动设置)
application.properties:
nacos.core.auth.enabled=true
nacos.core.auth.enable.userAgentAuthWhite=false
nacos.core.auth.server.identity.key=wdplatform
nacos.core.auth.server.identity.value=wdplatform
nacos.core.auth.plugin.nacos.token.secret.key= SecretKey012345678901234567890123456789012345678901234567890123456789
centos-7 JDK安装
centos-7;官网下载jdk版本,jdk-8u381-linux-x64.tar 64位压缩包
centos有4中安装方式,二进制文件安装、rpm安装、yum安装、源码编译安装
使用二进制方式安装jdk:( www.bilibili.com/video/BV13a…)
1、拷贝jdk文件到根目录
2、使用 tar -zxvf jdk-8u381-linux-x64.tar -C /usr/local 解压jdk文件到/usr/local 目录
3、配置环境变量 vim /etc/profile ,在末尾添加
JAVA_HOME=/usr/local/jdk1.8.0_371
PATH= $JAVA_HOME/bin:$PATH
4、source /etc/profile立即生效修改内容
Nginx安装
1、下载压缩包 nginx.org/ Stable version稳定版本 (也可以使用wget在linxus下直接下载Nginx安装包,wget需要yum安装yum安装一下(yum install wget),下载链接和window的一样,网页上获取就行 nginx.org/download/ng…)(wget url)
2、安装依赖包yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
3、解压 tar -zxvf nginx-1.16.1.tar.gz
4、cd nginx-1.16.1
5、./configure --prefix=/usr/local/nginx 将nginx安装在/usr/local/nginx目录里 (nginx目录要提前建好)
6、make && make install 两个命令一起执行乐可以通过&&连接
7、启动
cd sbin
./nginx
8、关闭
./nginx -s stop
9、重新加载配置
./nginx -s reload
10、配置环境变量
vim /etv/profile
NGINX_HOME=/usr/local/nginx
PATH=$NGINX_HOME/sbin #(添加到path路径里)
11、source /etc/profile立即生效修改内容
12、配置详解www.cnblogs.com/aqicheng/p/…
nginx配置分为三个部分:
1、全局块和nginx运行相关的配置
2、events块和网络连接相关的配置
3、http块代理、缓存、日志记录、虚拟主机配置
http块可以分为2个模块:
a、http全局块
b、server块
server块也分为两个部分:
a)、server全局块
b)、location块
每个http块可以配置多个server块,同时server块中也可以配置多个lication块
worker_processes 1;
#error_log logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server {
listen 80; 监听的端口
server_name localhost; 服务器名称
location / { 匹配客服端请求url
root html; 指定静态资源根目录,html目录
index index.html index.htm; 指定默认首页。可以空格设置多个,按顺序往下找
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Redis安装
1、下载二进制包 download.redis.io/releases 4.0.0版本
2、tar -zxvf redis-4.0.0.tar.gz -C /usr/local 解压到 /usr/local 目录(解压出来的是redis源码)
3、yum install gcc-c++ 安装c/c++编译环境
4、cd \urs\local\redis=4.0.0
make 进入redis源码目录,使用make命令进行编译
5、cd \usr\local\redis-4.0.0\src
make install 进入scr目录,执行make install 进行安装
6、启动redis
cd /src
./redis-server
7、密码设置:(可设可不设)
cd .. 返回redis-4.0.0目录
vim redis.conf 进入配置文件
requirepass 密码把这个注释放开即可
8、供外部链接
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --reload 开放防火墙6379端口
vim redis.conf
bind 127.0.0.1 注释了。此处表示可访问当前redis服务的ip地址,注释了,表示全部可以访问
protected-mode no 把保护模式改成no
daemonize yes 允许静默运行
在redis-4.0.0目录运行
src/redis-server ./redis.conf 按照配置文件运行redis,不然上面改的东西 也不生效啊!!!