end boss AAA

安装mysql

#!/bin/bash
#yum
wget -i -c https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql80-community-release-el7-3.noarch.rpm
#mysql8.0
yum -y install mysql-community-server
systemctl enable --now  mysqld.service

#mysql初始化
passwd=`grep  password /var/log/mysqld.log | cut -d " " -f 13`
passwd2=Lang@zuo123.
passwd3=123456
echo $passwd
sleep 2
mysql --connect-expired-password  -uroot -p${passwd} -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Lang@zuo123.';"
mysql --connect-expired-password  -uroot -p${passwd2} -e "set global validate_password.policy=0;set global validate_password.length=1;"
mysql --connect-expired-password  -uroot -p${passwd2} -e "use mysql;ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';"
mysql --connect-expired-password  -uroot -p${passwd3} -e "use mysql;update user set host = '%'  where user = 'root';"
mysql --connect-expired-password  -uroot -p${passwd3} -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';"
mysql -uroot -p${passwd3} -e "create database halodb character set utf8mb4 collate utf8mb4_bin;"
echo "mysql密码为passwd3"

安装nginx

wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum -y install nginx
systemctl start nginx
systemctl enable nginx

Nginx的访问

#!/bin/bash
while echo 1 &>/dev/null ;do
    cat /var/log/nginx/access.log | cut -d " " -f1 | sort | uniq -c | sort -nr >> /opt/nginx_ac.log
    sleep 20m;
done

编辑


upstream halo {
  server 127.0.0.1:8090 weight=1;
}
server {
  listen 80;
  listen [::]:80;
  server_name www.yourdomain.com;
  client_max_body_size 1024m;
  location / {
    proxy_pass http://halo;
    index index.html index.html;
  }
}

在 Linux 环境部署

CentOS

sudo yum install java-11-openjdk -y

检查版本:

java -version

如果输出以下类似内容即代表成功

openjdk version "11.0.10" 2021-01-19 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.10+9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9-LTS, mixed mode, sharing)

安装 

1.创建存放 运行包 的目录,这里以 ~/app 为例

mkdir ~/app && cd ~/app

2.下载运行包

wget https://dl.halo.run/release/halo-1.4.12.jar -O halo.jar

3.创建 工作目录

mkdir ~/.halo && cd ~/.halo

4.下载示例配置文件到 工作目录

wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml 

 5.编辑配置文件,配置数据库或者端口等,如需配置请参考 参考配置

vim application.yaml

6.测试运行 Halo

cd ~/app 
nohup java -jar halo.jar &

7.如看到类似以下日志输出,则代表启动成功。

run.halo.app.listener.StartedListener    : Halo started at         http://127.0.0.1:8090
run.halo.app.listener.StartedListener    : Halo admin started at   http://127.0.0.1:8090/admin
run.halo.app.listener.StartedListener    : Halo has started successfully!

打开 http://ip: 端口号 即可看到安装引导界面。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

花小智

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值