Brook centos7官方脚本搭建

1.更新服务器

1.输入sudo -i 进来root权限, 可自行选择升级内核, yum update -y升级内核
2.yum install wget 下载wget工具
wget https://github.com/txthinking/brook/releases/download/v20190205/brook 下载brook服务器版本
3.输入cp brook /usr/bin 把brook拷贝到bin目录下
4.chmod +x /usr/bin/brook 给予当前路径brook可执行权限
5.brook -h #查看帮助
6.nohup ./brook server -l :80 -p pass1234 & 添加brook端口和密码且让brook在后台运行
复制如下代码

1
2
3
4
5
6
7
sudo -i   
yum update -y
yum install wget
wget https://github.com/txthinking/brook/releases/download/v20190205/brook
cp brook /usr/bin
chmod +x /usr/bin/brook
nohup ./brook server -l :80 -p pass1234 &

Brook设置随系统启动

vi /etc/systemd/system/brook.service 用vi创建brook.service启动脚本

按” i “进入insert模式,输入脚本如下

1
2
3
4
5
6
7
8
[Unit]
Description = This is brook

[Service]
ExecStart = /usr/bin/./brook server -l :80 -p pass1234

[Install]
WantedBy = multi-user.target

按Esc,输入”shift+:”输入wq 回车,保存并退出

赋予可执行属性并生效:

1
chmod +x /etc/systemd/system/brook.service

开启brook.service 服务

1
systemctl enable /etc/systemd/system/brook.service

reboot 重启vps

查看brook服务是否正常运行这台

如下代码:

1
2
3
4
service brook status -l     如果正常启动会返回绿色 active (running)
service brook start 开启brook服务
service brook stop 停止brook运行
service brook restart 重启brook服务

systemctl list-unit-files 查看brook脚本是否生效 当重新修改brook密码后 我们需重载信息输入systemctl daemon-reload 或者重新启动vps 输入reboot


 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×