摘要 方舟服务器搭建
1.安装steam cmd
命令 1 apt-get install steamcmd
在安装过程中,系统将提示您同意Steam许可协议。选择我同意并点击确定接受协议条款。
出于安全原因,您将创建一个单独的ark用户来运行您的服务器应用程序。记下您指定的密码:
2.创建用户
命令
4.调整系统设置
命令 1 2 3 4 5 6 echo "fs.file-max=100000" >> /etc/sysctl.conf && sysctl -p echo "* soft nofile 1000000" >> /etc/security/limits.conf echo "* hard nofile 1000000" >> /etc/security/limits.conf echo "session required pam_limits.so" >> /etc/pam.d/common-session
5.安装方舟:生存进化服务器
命令 1 2 3 4 5 6 su - ark mkdir server # 链接/usr/games/steamcmd到steamcmd在ark用户的主目录: ln -s /usr/games/steamcmd steamcmd # 使用以下命令运行以安装方舟:生存进化服务器: steamcmd +login anonymous +force_install_dir /home/ark/server +app_update 376030 +quit
6.创建一个新的systemd服务文件并向其中添加以下值。
命令 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 sudo vim /lib/systemd/system/ark.service [Unit] Description=ARK Survival Evolved [Service] Type=simple Restart=on-failure RestartSec=5 StartLimitInterval=60s StartLimitBurst=3 User=ark Group=ark ExecStartPre=/home/ark/steamcmd +login anonymous +force_install_dir /home/ark/server +app_update 376030 +quit ExecStart=/home/ark/server/ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?SessionName="服务器名称"?MaxPlayers=15?Port=7777?QueryPort=27015?listen -server -log ExecStop=killall -TERM srcds_linux [Install] WantedBy=multi-user.target 作者:AbleHackLoneWolf https://www.bilibili.com/read/cv5083929 出处:bilibili
7.启动方式
服务 1 2 3 4 5 sudo systemctl daemon-reload sudo systemctl enable ark.service sudo systemctl start ark
8.其他
说明 1 2 3 4 5 6 7 8 9 10 11 12 13 14 steam://connect/[IP地址]:7777 Server Configuration https://ark.gamepedia.com/Server_Configuration Server Setup https://ark.gamepedia.com/Dedicated_Server_Setup SteamCMD https://developer.valvesoftware.com/wiki/SteamCMD:zh-cn
9.可能遇见的问题 service ark status init fault
1 2 3 4 5 6 cd Engine/Binaries/ThirdParty/SteamCMD mkdir Linux cd Linux curl http://media.steampowered.com/installer/steamcmd_linux.tar.gz > steamcmd.tar.gz tar -zxf steamcmd.tar.gz ./steamcmd.sh
10.sdl报错
安装 1 sudo apt install libsdl2-2.0-0:i386