Valheim英灵神殿服务器搭建指南
资源准备
mkdir steamcmd
cd steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
#Ubuntu/Debian (x86-64)
sudo apt-get -y install lib32gcc1
#RedHat/CentOS (x86-64)
yum install -y glibc.i686 libstdc++.i686
准备服务端
创建服务器下载脚本|同时也是更新脚本
mkdir VALHEIM
touch update.sh
chmod +x update.sh
将脚本内容写入
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
cd /home/steam/steamcmd
./steamcmd.sh +force_install_dir /home/steam/VALHEIM +login anonymous +app_update 896660 validate +quit
安装服务端
./update.sh #等待服务端安装完毕
touch runValheim.sh
chmod +x runValheim.sh
将启动脚本写入
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
clear
echo -e "========================================================
** 发布网址: Cll66.CN **
** 微信: dylanchen24 **
** 作者: DylanC **
** VALHEIM 一键启动服务器 **
========================================================"
echo
function setupVALHEIM() {
cd "/home/steam/VALHEIM"
screen_name=$"valheim"
screen -dmS $screen_name
cmd=$"start_server.sh"
screen -x -S $screen_name -p 0 -X stuff "$cmd"
screen -x -S $screen_name -p 0 -X stuff $'\n'
}
setupVALHEIM
运行服务端
cd /home/steam/VALHEIM
vim start_server.sh
#修改服务端名字和密码,端口也可以改记得放通云服务器端口
#服务器密码至少5位并且不能包含在服务器名字中
cd ..
./runValheim.sh
服务端存档备份
服务端的存档位于/home/steam/.config/unity3d/IronGate/Valheim
如果需要迁移服务器,整体复制走这个文件夹就行