Loading... <p>前几天和小伙伴们玩七日杀,本地服务器体验太差了,所以搞了个2H4G的腾讯云来做自建服务器,原版体验良好,大型MOD环境比较吃力。</p><p>推荐2H4G8M配置以上Centos7纯净系统服务器,1G2G或配置更低的服务器必须设置SWAP分区,提前在面板上关闭防火墙,开放所有端口。</p><p>下面开始部署服务器。</p><p>进行对应环境的安装:<br/></p><pre class="brush:cpp;toolbar:false">yum install glibc.i686 yum install libstdc++.i686</pre><p><span style="font-size: 14px;">在/usr/local/</span>创建steamcmd文件夹<br/></p><pre class="brush:cpp;toolbar:false">cd /usr/local/ mkdir steamcmd cd /usr/local/steamcmd/</pre><p>下载并解压安装包<br/></p><pre class="brush:cpp;toolbar:false">wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz tar -zxvf steamcmd_linux.tar.gz</pre><p>启动steamcmd并登录</p><pre class="brush:cpp;toolbar:false">cd /usr/local/steamcmd ./steamcmd.sh login account anonymous</pre><p>设置游戏下载路径,下载七日杀,完成后退出steamcmd界面<br/></p><pre class="brush:cpp;toolbar:false">force_install_dir /usr/local/games app_update 294420 -beta latest_experimental validate quit</pre><p>安装gcc编译器,完成后编译安装glibc 2.15</p><pre class="brush:cpp;toolbar:false">cd /usr/local/ yum -y install gcc wget http://ftp.gnu.org/gnu/libc/glibc-2.15.tar.xz tar -xvf glibc-2.15.tar.xz mkdir -p /var/VMdisks mv glibc-2.15 /var/VMdisks/ cd /var/VMdisks/glibc-2.15/ mkdir build cd build/ ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin</pre><p>开始安装(时间较长请耐心等待)</p><pre class="brush:cpp;toolbar:false">make -j4 make install</pre><p>此时已经可以运行服务器了</p><pre class="brush:cpp;toolbar:false">cd /usr/local/games/ nohup sh startserver.sh -configfile=serverconfig.xml &</pre><p>如果需要下载低版本服务端则直接将latest_experimental修改成对应的版本,如下则是下载的A18.3的版本</p><pre class="brush:cpp;toolbar:false">app_update 294420 -beta alpha18.3 validate</pre><p><br/></p><p>可选:设置swap分区8G替代内存</p><pre class="brush:cpp;toolbar:false">dd if=/dev/zero of=/var/swap bs=1M count=8192 chmod 600 /var/swap mkswap /var/swap swapon /var/swap echo '/var/swap swap swap default 0 0' >> /etc/fstab</pre><p>可选:阿里云服务器则需要打开ipv6地址请求</p><pre class="brush:cpp;toolbar:false">vim /etc/modprobe.d/disable_ipv6.conf</pre><p>修改前如下:</p><pre class="brush:cpp;toolbar:false">alias net-pf-10 off alias ipv6 off options ipv6 disable=1</pre><p>修改后如下:<br/></p><pre class="brush:cpp;toolbar:false">alias net-pf-10 off #alias ipv6 off options ipv6 disable=0</pre><p>然后修改network,将ipv6打开</p><p>修改前如下:<br/></p><pre class="brush:cpp;toolbar:false">NETWORKING=yes HOSTNAME=coolnull NETWORKING_IPV6=no PEERNTP=no GATEWAY=*.*.*.*</pre><p>修改后如下:</p><pre class="brush:cpp;toolbar:false">NETWORKING=yes HOSTNAME=coolnull NETWORKING_IPV6=yes PEERNTP=no GATEWAY=*.*.*.*</pre><p>修改sysctl.conf,将这几项修改成0(如果没有这几项则自己添加上就行)</p><pre class="brush:cpp;toolbar:false">vim /etc/sysctl.conf</pre><p>修改前如下:<br/></p><pre class="brush:cpp;toolbar:false">net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1</pre><p>修改后如下:<br/></p><pre class="brush:cpp;toolbar:false">net.ipv6.conf.all.disable_ipv6 = 0 net.ipv6.conf.default.disable_ipv6 = 0 net.ipv6.conf.lo.disable_ipv6 = 0</pre><p>设置好以后重启服务器测试看是否支持ipv6(输入后能看到有输出则设置成功)</p><pre class="brush:cpp;toolbar:false">reboot ifconfig|grep -i inet6</pre><p><br/></p><p><br/></p><p><br/></p> 最后修改:2024 年 07 月 10 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏