项目部署原创
# 1. 服务器安装git服务
mkdir /datadrive
cd /datadrive
yum -y install git-core
mkdir project.git
git init --bare project.git
1
2
3
4
5
2
3
4
5
# 2. 添加公钥到authorized_keys
cd /.ssh/
vim authorized_keys
## 添加你的公钥
1
2
3
2
3
# 3. 配置git服务 钩子将代码推送到服务器
mkdir -p /usr/www/dist
cd /datadrive/project.git/hooks
touch post-receive
vim post-receive
## 添加以下内容
#!/bin/bash
git --work-tree=/usr/www/dist --git-dir=/datadrive/project.git checkout -f
1
2
3
4
5
6
7
2
3
4
5
6
7
# 4. 安装nginx
## 安装nginx
yum install nginx
## 启动nginx
systemctl start nginx
## 开启开机启动
systemctl enable nginx
## 查看nginx状态
systemctl status nginx
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 5. 配置nginx
cd /etc/nginx/
vim nginx.conf
server {
listen 80;
listen [::]:80;
server_name www.huakaibuting.com;
root /usr/www/dist;
}
## 重启nginx
systemctl stop nginx
systemctl start nginx
systemctl status nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 6. 配置域名解析
https://dnsnext.console.aliyun.com/authoritative/domains/huakaibuting.com?spm=5176.12818093.0.0.680916d0i1BaXr&file=huakaibuting.com
不会立即生效,稍等5分钟左右即可。
← 关于
- 01
- Dolphin+XXL-JOB监控Hadoop任务执行结果量级 原创01-04
- 02
- 调度Hive定时删除30天之前的分区 原创01-04
- 03
- Java第三方SDK的使用方法 原创12-16