搭建基础
1.Ubuntu 18.10./linux/centso (演示仅在Ubuntu上!)
2.服务器
最低配置(1人)
核心1cure,内存750mb,100兆带宽
推荐配置
核心2cure, 内存2gb,1g带宽
高端配置
神威·太湖之光
安装代码
更新安装模块到最新版本
sudo apt-get update
sudo apt-get upgrade
安装java8
sudo apt install openjdk-8-jre
新建安装文件夹,进入目录
mkdir /home/user
mkdir /home/user/streama
cd /home/user/streama
安装streama
wget https://github.com/streamaserver/streama/releases/download/v1.9.1/streama-1.9.1.jar
赋予权限,并且运行在80端口
chmod +x streama-1.9.1.jar
java -Dserver.port=80 -jar streama-1.9.1.jar &
等待2分钟
出现以下代码即可
Grails application running at http://localhost:8080 in environment: production
本地:http://localhost:8080
外部:域名
网站设置访问
https://github.com/streamaserver/streama
设置开机自动启动
修改开机自启服务
sudo nano /etc/systemd/system/rc-local.service
在vim环境里添加
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
创建自启文件
sudo nano /etc/rc.local
在尾行写入
#!/bin/sh -e
#
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.
sudo nohup chmod +x /home/user/streama/streama-1.9.1.jar
sudo nohup java -Dserver.port=80 -jar /home/user/streama/streama-1.9.1.jar &
exit 0
添加权限,开机自启
sudo chmod +x /etc/rc.local
sudo systemctl enable rc-local
查看状态
sudo systemctl status rc-local.service
bbr,镜像未包含,需要自行安装
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh
验证bbr
sysctl net.ipv4.tcp_congestion_control
说明
注意启动大概几分钟所以耐心等一会再打开网页