添加文档
修改主题配置
This commit is contained in:
82
source/_posts/linux/git安装.md
Normal file
82
source/_posts/linux/git安装.md
Normal file
@@ -0,0 +1,82 @@
|
||||
---
|
||||
title: git安装
|
||||
date: 2021-11-21
|
||||
updated: 2021-11-21
|
||||
tags:
|
||||
- git
|
||||
- linux
|
||||
categories:
|
||||
- linux
|
||||
- git
|
||||
keywords:
|
||||
- git
|
||||
- linux
|
||||
description: git安装
|
||||
top_img: https://i.loli.net/2021/11/21/kVIqrRQlpSD2avc.jpg
|
||||
comments: true
|
||||
cover: https://i.loli.net/2021/11/21/kVIqrRQlpSD2avc.jpg
|
||||
copyright: true
|
||||
copyright_author: xzh
|
||||
copyright_author_href: http://xxzhx.cn
|
||||
copyright_url: http://xxzhx.cn
|
||||
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
|
||||
---
|
||||
|
||||
# git安装
|
||||
|
||||
## 下载git包
|
||||
|
||||
[下载地址](https://mirrors.edge.kernel.org/pub/software/scm/git/)
|
||||
|
||||

|
||||
|
||||
## 上传服务器并解压安装
|
||||
|
||||
### 解压
|
||||
|
||||
```shell
|
||||
tar -zxvf git-2.34.0.tar.gz
|
||||
```
|
||||
|
||||
### 安装依赖
|
||||
|
||||
```shell
|
||||
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
|
||||
```
|
||||
|
||||
### 检验配置并设置安装路径
|
||||
|
||||
```shell
|
||||
./configure --prefix=/usr/local/git
|
||||
```
|
||||
|
||||
### 编译&安装
|
||||
|
||||
```shell
|
||||
make && make install
|
||||
```
|
||||
|
||||
## 配置环境变量
|
||||
|
||||
```shell
|
||||
vim /etc/profile
|
||||
```
|
||||
|
||||
### 环境变量
|
||||
|
||||
```js
|
||||
# git环境变量
|
||||
export GIT_HOME=/usr/local/git
|
||||
export PATH=$PATH:$GIT_HOME/bin
|
||||
```
|
||||
|
||||
### 刷新配置
|
||||
|
||||
```shell
|
||||
source /etc/profile
|
||||
```
|
||||
|
||||
## 安装完成
|
||||
|
||||

|
||||
|
||||
72
source/_posts/linux/java环境配置.md
Normal file
72
source/_posts/linux/java环境配置.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: java环境配置
|
||||
date: 2021-11-20
|
||||
updated: 2021-11-20
|
||||
tags:
|
||||
- java
|
||||
- linux
|
||||
categories:
|
||||
- linux
|
||||
- java
|
||||
keywords:
|
||||
- linux
|
||||
- java
|
||||
description: linux配置java环境
|
||||
top_img: https://i.loli.net/2021/11/20/oz2O9BwW38ZRbJV.jpg
|
||||
comments: true
|
||||
cover: https://i.loli.net/2021/11/20/oz2O9BwW38ZRbJV.jpg
|
||||
copyright: true
|
||||
copyright_author: xzh
|
||||
copyright_author_href: http://xxzhx.cn
|
||||
copyright_url: http://xxzhx.cn
|
||||
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
|
||||
---
|
||||
|
||||
# linux配置java环境
|
||||
|
||||
## 卸载可能存在的java环境
|
||||
|
||||
```shell
|
||||
rpm -qa|grep java
|
||||
rpm -qa|grep jdk
|
||||
# 如果有就卸载掉
|
||||
rpm -e --nodeps java--1.8.xxx
|
||||
```
|
||||
|
||||
## 下载java二进制包
|
||||
|
||||
https://www.oracle.com/
|
||||
|
||||

|
||||
|
||||
## 上传到服务器并解压
|
||||
|
||||
```shell
|
||||
tar -zxvf jdk-8u311-linux-x64.tar.gz
|
||||
# 移动位置
|
||||
mv jdk1.8.0_311 /usr/local/
|
||||
```
|
||||
|
||||
## 配置环境变量
|
||||
|
||||
### 编辑配置文件
|
||||
|
||||
```shell
|
||||
vim /etc/profile
|
||||
```
|
||||
|
||||
### 添加环境变量配置
|
||||
|
||||
```shell
|
||||
# JDK环境变量
|
||||
JAVA_HOME=/usr/local/jdk1.8.0_311
|
||||
CLASSPATH=.:$JAVA_HOME/lib:/dt.jar:$JAVA_HOME/lib/tools.jar
|
||||
PATH=$PATH:$JAVA_HOME/bin
|
||||
```
|
||||
|
||||
### 刷新配置
|
||||
|
||||
```shell
|
||||
source /etc/profile
|
||||
```
|
||||
|
||||
104
source/_posts/linux/jenkins安装.md
Normal file
104
source/_posts/linux/jenkins安装.md
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: jenkins安装
|
||||
date: 2021-11-21
|
||||
updated: 2021-11-21
|
||||
tags:
|
||||
- jenkins
|
||||
- linux
|
||||
categories:
|
||||
- linux
|
||||
- jenkins
|
||||
keywords:
|
||||
- jenkins
|
||||
- linux
|
||||
description: jenkins安装
|
||||
top_img: https://i.loli.net/2021/11/21/HAqYGMSTVwJxcBN.jpg
|
||||
comments: true
|
||||
cover: https://i.loli.net/2021/11/21/HAqYGMSTVwJxcBN.jpg
|
||||
copyright: true
|
||||
copyright_author: xzh
|
||||
copyright_author_href: http://xxzhx.cn
|
||||
copyright_url: http://xxzhx.cn
|
||||
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
|
||||
---
|
||||
|
||||
# jenkins安装
|
||||
|
||||
## 下载jenkins
|
||||
|
||||
[下载地址](http://mirrors.jenkins.io/war-stable/2.303.3/)
|
||||
|
||||

|
||||
|
||||
## 上传至服务器
|
||||
|
||||

|
||||
|
||||
## 运行jenkins war文件
|
||||
|
||||

|
||||
|
||||
```shell
|
||||
# 后台运行jenkinx
|
||||
nohup java -jar jenkins.war > jenkins.log &
|
||||
```
|
||||
|
||||
### 开放端口
|
||||
|
||||
```shell
|
||||
firewall-cmd --zone=public --add-port=8080/tcp --permanent
|
||||
```
|
||||
|
||||
### 重启防火墙
|
||||
|
||||
```shell
|
||||
firewall-cmd --reload
|
||||
```
|
||||
|
||||
## 访问jenkins
|
||||
|
||||
http://ip:8080
|
||||
|
||||

|
||||
|
||||
### 根据页面提示的路径查看密码
|
||||
|
||||
```shell
|
||||
cat /root/.jenkins/secrets/initialAdminPassword
|
||||
```
|
||||
|
||||
### 把显示的密码复制到输入框中
|
||||
|
||||

|
||||
|
||||
## 插件安装
|
||||
|
||||
### 按照自己的需求来选择安装的插件(我选择推荐的)
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 创建用户
|
||||
|
||||

|
||||
|
||||
## 安装完成
|
||||
|
||||

|
||||
|
||||
# jenkins配置
|
||||
|
||||
## 进入配置页
|
||||
|
||||

|
||||
|
||||
## maven配置
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## git配置
|
||||
|
||||

|
||||
82
source/_posts/linux/maven安装.md
Normal file
82
source/_posts/linux/maven安装.md
Normal file
@@ -0,0 +1,82 @@
|
||||
---
|
||||
title: maven安装
|
||||
date: 2021-11-21
|
||||
updated: 2021-11-21
|
||||
tags:
|
||||
- maven
|
||||
- linux
|
||||
categories:
|
||||
- linux
|
||||
- maven
|
||||
keywords:
|
||||
- maven
|
||||
- linux
|
||||
description: maven安装
|
||||
top_img: https://i.loli.net/2021/11/21/UfdQTqzw4Y7r1v2.jpg
|
||||
comments: true
|
||||
cover: https://i.loli.net/2021/11/21/UfdQTqzw4Y7r1v2.jpg
|
||||
copyright: true
|
||||
copyright_author: xzh
|
||||
copyright_author_href: http://xxzhx.cn
|
||||
copyright_url: http://xxzhx.cn
|
||||
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
|
||||
---
|
||||
|
||||
# maven安装
|
||||
|
||||
## 下载maven包
|
||||
|
||||
[下载地址](https://maven.apache.org/download.cgi)
|
||||
|
||||

|
||||
|
||||
## 上传至服务器并解压
|
||||
|
||||
```shell
|
||||
tar -zxvf apache-maven-3.8.4-bin.tar.gz
|
||||
```
|
||||
|
||||
## 移动位置
|
||||
|
||||
```shell
|
||||
mv apache-maven-3.8.4 /usr/local/maven-3.8.4
|
||||
```
|
||||
|
||||
## 配置环境变量
|
||||
|
||||
```shell
|
||||
vim /etc/profile
|
||||
```
|
||||
|
||||
### 配置
|
||||
|
||||
```js
|
||||
# maven环境变量
|
||||
export MAVEN_HOME=/usr/local/maven-3.8.4
|
||||
export PATH=$PATH:$MAVEN_HOME/bin
|
||||
```
|
||||
|
||||
### 刷新配置
|
||||
|
||||
```
|
||||
source /etc/profile
|
||||
```
|
||||
|
||||
## 安装成功
|
||||
|
||||

|
||||
|
||||
## 修改maven配置文件
|
||||
|
||||
```shell
|
||||
vim /usr/local/maven-3.8.4/conf/settings.xml
|
||||
```
|
||||
|
||||
### 配置本地仓库
|
||||
|
||||

|
||||
|
||||
### 配置阿里远程仓库
|
||||
|
||||

|
||||
|
||||
263
source/_posts/linux/mysql安装.md
Normal file
263
source/_posts/linux/mysql安装.md
Normal file
@@ -0,0 +1,263 @@
|
||||
---
|
||||
title: mysql安装
|
||||
date: 2021-11-20
|
||||
updated: 2021-11-20
|
||||
tags:
|
||||
- mysql
|
||||
- linux
|
||||
categories:
|
||||
- linux
|
||||
- mysql
|
||||
keywords:
|
||||
- mysql
|
||||
- linux
|
||||
description: linux安装mysql
|
||||
top_img: https://i.loli.net/2021/09/30/YJLqn57mAe6vRNo.jpg
|
||||
comments: true
|
||||
cover: https://i.loli.net/2021/09/30/YJLqn57mAe6vRNo.jpg
|
||||
copyright: true
|
||||
copyright_author: xzh
|
||||
copyright_author_href: http://xxzhx.cn
|
||||
copyright_url: http://xxzhx.cn
|
||||
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
|
||||
---
|
||||
|
||||
# mysql安装
|
||||
|
||||
## 检查是否安装`mariadb`
|
||||
|
||||
### 首先检查服务器是否安装过`mariadb`
|
||||
|
||||
```shell
|
||||
rpm -qa | grep mariadb
|
||||
```
|
||||
|
||||

|
||||
|
||||
### 如果有类似,需要把他卸载
|
||||
|
||||
```shell
|
||||
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
|
||||
```
|
||||
|
||||
### 安装mysql的依赖包libao
|
||||
|
||||
```shell
|
||||
yum install libaio
|
||||
```
|
||||
|
||||
## 安装mysql
|
||||
|
||||
### 下载mysql
|
||||
|
||||
[mysql下载地址](https://dev.mysql.com/downloads/mysql/)
|
||||
|
||||
下载此版本:
|
||||
|
||||

|
||||
|
||||
下载之后,上传至服务器
|
||||
|
||||
### 解压mysql
|
||||
|
||||
解压
|
||||
|
||||
```shell
|
||||
tar -zxvf mysql-8.0.26-el7-x86_64.tar.gz
|
||||
```
|
||||
|
||||
解压之后,把解压的文件夹移动到`/usr/local/mysql`
|
||||
|
||||
```shell
|
||||
mv mysql-8.0.26-el7-x86_64 /usr/local/mysql
|
||||
```
|
||||
|
||||
### 创建data文件夹
|
||||
|
||||
进入mysql文件夹,创建data文件夹
|
||||
|
||||
```shell
|
||||
cd /usr/local/mysql
|
||||
mkdir data
|
||||
```
|
||||
|
||||
### 创建mysql组:创建mysql用户,并设置密码。
|
||||
|
||||
```shell
|
||||
useradd mysql
|
||||
passwd mysql
|
||||
```
|
||||
|
||||
### 将mysql目录的权限授给mysql用户和mysql组。
|
||||
|
||||
```shell
|
||||
chown -R mysql:mysql /usr/local/mysql
|
||||
```
|
||||
|
||||
### 赋予权限
|
||||
|
||||
```shell
|
||||
chmod -R 777 /usr/local/mysql
|
||||
chmod -R 777 /usr/local/mysql/data
|
||||
```
|
||||
|
||||
### 创建my.cnf配置文件
|
||||
|
||||
```shell
|
||||
touch /usr/local/mysql/my.cnf
|
||||
```
|
||||
|
||||
### 编辑配置文件
|
||||
|
||||
```shell
|
||||
vi my.cnf
|
||||
```
|
||||
|
||||
`my.cnf`内容
|
||||
|
||||
```ini
|
||||
[mysqld]
|
||||
# 设置3306端口
|
||||
port=3306
|
||||
# 设置mysql的安装目录
|
||||
basedir=/usr/local/mysql
|
||||
# 设置mysql数据库的数据的存放目录
|
||||
datadir=/usr/local/mysql/data
|
||||
# 允许最大连接数
|
||||
max_connections=100
|
||||
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
|
||||
max_connect_errors=10
|
||||
# 服务端使用的字符集默认为utf8mb4
|
||||
character-set-server=utf8mb4
|
||||
# 创建新表时将使用的默认存储引擎
|
||||
default-storage-engine=INNODB
|
||||
# 默认使用“mysql_native_password”插件认证
|
||||
default_authentication_plugin=mysql_native_password
|
||||
[mysql]
|
||||
# 设置mysql客户端默认字符集
|
||||
default-character-set=utf8mb4
|
||||
[client]
|
||||
# 设置mysql客户端连接服务端时默认使用的端口
|
||||
port=3306
|
||||
default-character-set=utf8mb4
|
||||
```
|
||||
|
||||
### 启动mysql
|
||||
|
||||
执行命令,记住随机密码
|
||||
|
||||
```shell
|
||||
cd /usr/local/mysql/bin
|
||||
./mysqld --initialize --console
|
||||
```
|
||||
|
||||
输入此命令后获取出现密码,在`root@localhost`的后面,把他记住,如下
|
||||
|
||||

|
||||
|
||||
### 再赋予一次权限
|
||||
|
||||
因为初始了data文件夹中的文件,都还没有赋予权限
|
||||
|
||||
```shell
|
||||
chmod -R 777 /usr/local/mysql
|
||||
chmod -R 777 /usr/local/mysql/data
|
||||
```
|
||||
|
||||
### 启动服务
|
||||
|
||||
进入mysql中的`support-files`文件夹,启动服务
|
||||
|
||||
```shell
|
||||
cd /usr/local/mysql/support-files
|
||||
./mysql.server start
|
||||
```
|
||||
|
||||
### 将mysql加入系统进程中
|
||||
|
||||
```shell
|
||||
cp mysql.server /etc/init.d/mysqld
|
||||
# 重启
|
||||
service mysqld restart
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 连接mysql并设置密码
|
||||
|
||||
### 创建一个软连接到` /usr/bin`
|
||||
|
||||
```shell
|
||||
ln -s /usr/local/mysql/bin/mysql /usr/bin
|
||||
```
|
||||
|
||||
### 连接mysql
|
||||
|
||||
```shell
|
||||
mysql -u root -p
|
||||
```
|
||||
|
||||

|
||||
|
||||
### 输入上面复制的密码
|
||||
|
||||

|
||||
|
||||
### 修改密码
|
||||
|
||||
```sql
|
||||
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
|
||||
```
|
||||
|
||||
### 设置允许远程登录
|
||||
|
||||
```sql
|
||||
mysql> use mysql;
|
||||
mysql> update user set user.Host='%' where user.User='root';
|
||||
# 应用配置
|
||||
mysql> flush privileges;
|
||||
# 退出mysql
|
||||
mysql> quit
|
||||
```
|
||||
|
||||
### 重启mysql
|
||||
|
||||
```shell
|
||||
service mysqld restart
|
||||
```
|
||||
|
||||
### 检查3306端口是否开放
|
||||
|
||||
```shell
|
||||
firewall-cmd --zone=public --list-ports
|
||||
```
|
||||
|
||||
### 开放3306端口
|
||||
|
||||
```shell
|
||||
firewall-cmd --zone=public --add-port=3306/tcp --permanent
|
||||
```
|
||||
|
||||
### 重启防火墙
|
||||
|
||||
```shell
|
||||
firewall-cmd --reload
|
||||
```
|
||||
|
||||
# 可能出现的错误
|
||||
|
||||
## 登录mysql的时候报错
|
||||
|
||||
`mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory`
|
||||
|
||||

|
||||
|
||||
## 解决
|
||||
|
||||
### 安装`libncurses`
|
||||
|
||||
```
|
||||
yum install libncurses*
|
||||
```
|
||||
|
||||
### 重新登录即可
|
||||
67
source/_posts/linux/nginx安装.md
Normal file
67
source/_posts/linux/nginx安装.md
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: nginx安装
|
||||
date: 2021-11-21
|
||||
updated: 2021-11-21
|
||||
tags:
|
||||
- nginx
|
||||
- linux
|
||||
categories:
|
||||
- linux
|
||||
- nginx
|
||||
keywords:
|
||||
- nginx
|
||||
- linux
|
||||
description: nginx安装
|
||||
top_img: https://i.loli.net/2021/11/21/wcEIMzN795yV1Uh.jpg
|
||||
comments: true
|
||||
cover: https://i.loli.net/2021/11/21/wcEIMzN795yV1Uh.jpg
|
||||
copyright: true
|
||||
copyright_author: xzh
|
||||
copyright_author_href: http://xxzhx.cn
|
||||
copyright_url: http://xxzhx.cn
|
||||
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
|
||||
---
|
||||
|
||||
# nginx安装
|
||||
|
||||
## 下载nginx包
|
||||
|
||||
[下载地址](http://nginx.org/en/download.html)
|
||||
|
||||

|
||||
|
||||
## 安装依赖
|
||||
|
||||
```shell
|
||||
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
|
||||
```
|
||||
|
||||
## 安装nginx
|
||||
|
||||
```shell
|
||||
# 解压
|
||||
tar -zxvf nginx-1.20.2.tar.gz
|
||||
# 进入nginx文件夹
|
||||
cd nginx-1.20.2/
|
||||
# 配置
|
||||
./configure --prefix=/usr/local/nginx-1.20.2
|
||||
# make
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
## 启动&停止
|
||||
|
||||
```shell
|
||||
# 进入nginx安装目录
|
||||
cd /usr/local/nginx-1.20.2/
|
||||
# 启动
|
||||
./sbin/nginx
|
||||
# 重启
|
||||
./sbin/nginx -s reload
|
||||
# 停止
|
||||
./sbin/nginx -s stop
|
||||
```
|
||||
|
||||
|
||||
|
||||
70
source/_posts/linux/nodejs安装.md
Normal file
70
source/_posts/linux/nodejs安装.md
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: nodejs安装
|
||||
date: 2021-11-21
|
||||
updated: 2021-11-21
|
||||
tags:
|
||||
- nodejs
|
||||
- linux
|
||||
categories: nodejs
|
||||
keywords:
|
||||
- nodejs
|
||||
- linux
|
||||
description: nodejs安装
|
||||
top_img: https://i.loli.net/2021/11/20/aHCxPjiyETeSV7O.jpg
|
||||
comments: true
|
||||
cover: https://i.loli.net/2021/11/20/aHCxPjiyETeSV7O.jpg
|
||||
copyright: true
|
||||
copyright_author: xzh
|
||||
copyright_author_href: http://xxzhx.cn
|
||||
copyright_url: http://xxzhx.cn
|
||||
copyright_info: 著作权归作者所有。商业转载请联络作者获得授权,非商业转载请注明出处。
|
||||
---
|
||||
|
||||
# nodejs安装
|
||||
|
||||
## 下载nodejs包
|
||||
|
||||
[下载地址](https://npm.taobao.org/mirrors/node/v16.13.0/)
|
||||
|
||||

|
||||
|
||||
## 把nodejs包上传至服务器并解压
|
||||
|
||||

|
||||
|
||||
### 解压
|
||||
|
||||
```shell
|
||||
tar -zxvf node-v16.13.0-linux-x64.tar.gz
|
||||
```
|
||||
|
||||
#### 移动位置
|
||||
|
||||
```shell
|
||||
mv node-v16.13.0-linux-x64/ /usr/local/node-v16.13.0
|
||||
```
|
||||
|
||||
## 配置环境变量
|
||||
|
||||
```shell
|
||||
vim /etc/profile
|
||||
```
|
||||
|
||||
### 在末尾加入配置
|
||||
|
||||
```js
|
||||
# node环境变量
|
||||
export NODE_HOME=/usr/local/node-v16.13.0
|
||||
export PATH=$PATH:$NODE_HOME/bin
|
||||
```
|
||||
|
||||
### 刷新配置
|
||||
|
||||
```shell
|
||||
source /etc/profile
|
||||
```
|
||||
|
||||
## 验证是否成功
|
||||
|
||||

|
||||
|
||||
Reference in New Issue
Block a user