Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Dedicated legacy Linux server: Difference between revisions

From TF2 Classified Wiki
Mehr (talk | contribs)
m updated dead link
Mehr (talk | contribs)
added systemd maintance commands. Added emphasis on prerequisites. Added SteamCMD valve wiki reference and extra help
Line 1: Line 1:
''Note: This was adapted and revised from a guide written by Raizo, the original of which can be found here: https://blog.raizo.dev/posts/tf2-classic-linux-server-tutorial/''
''Note: This was adapted and revised from a guide written by Raizo, the original of which can be found here: https://blog.raizo.dev/posts/tf2-classic-linux-server-tutorial/''


== Prerequisites ==
= Prerequisites =
* A Linux server running Ubuntu Server<sup>*</sup> on an x86_64 CPU. You cannot easily run SRCDS on any other architecture besides an x86_64 CPU. Box64/Box86 may work for ARM processors (e.g. Raspberry Pis) but that's complex, and not covered here.
* A Linux server running Ubuntu Server<sup>*</sup> on an x86_64 CPU. You cannot easily run SRCDS on any other architecture besides an x86_64 CPU. Box64/Box86 may work for ARM processors (e.g. Raspberry Pis) but that's complex, and not covered here.
* A SFTP/SSH client (PuTTY, Termius, FileZilla, MobaXterm)
* A SFTP/SSH client (PuTTY, Termius, FileZilla, MobaXterm)
Line 44: Line 44:
# apt install steamcmd unzip aria2 tilde lib32z1 libncurses5:i386 libbz2-1.0:i386 lib32gcc-s1 lib32stdc++6 libtinfo5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 libcurl4-gnutls-dev libcurl4-gnutls-dev:i386
# apt install steamcmd unzip aria2 tilde lib32z1 libncurses5:i386 libbz2-1.0:i386 lib32gcc-s1 lib32stdc++6 libtinfo5:i386 libcurl3-gnutls:i386 libsdl2-2.0-0:i386 libcurl4-gnutls-dev libcurl4-gnutls-dev:i386
</pre>
</pre>
''<sup>*</sup>'''Note''':See [https://developer.valvesoftware.com/wiki/SteamCMD#Package_From_Repositories|Valve Developer Wiki SteamCMD Repository Packages] if your distro is having issues getting steamcmd.
''


Login to the steam user you created:
Login to the steam user you created:
Line 146: Line 149:
If you want it to run even after closing the terminal window, run <code>nohup ./runserver.sh &</code> followed by <code>disown</code>
If you want it to run even after closing the terminal window, run <code>nohup ./runserver.sh &</code> followed by <code>disown</code>


== Systemd & Crontab for Automatic Start, Restart and Updating==
== Systemd & Crontab for Automated Start, Restart and Updating==
For easier automation of server restarts, updating, and booting alongside the system, you may use systemd, which is the default init system for most modern Linux distros and cronjobs.
For easier automation of server restarts, updating, and booting alongside the system, you may use systemd, which is the default init system for most modern Linux distros and cronjobs.


Line 201: Line 204:
You may create as many services as you have TF2C servers but remember to name the service files uniquely, enable them in <code>systemctl</code>, and add them to the <code>crontab</code>.  
You may create as many services as you have TF2C servers but remember to name the service files uniquely, enable them in <code>systemctl</code>, and add them to the <code>crontab</code>.  


== Systemd Manual Start, Stop, Restart/Update ==
If you don't wish to use the service files above to automatically boot servers, or you need to perform these actions for maintenance: you may issue commands to manually ''start'', ''stop'', ''restart'', or ''update'' the server(s) through systemd.
<pre>
# systemctl restart tf2classic # in case you need to restart manually or to grab updates!!
# systemctl stop tf2classic # in case you need to stop the server manually
# systemctl start tf2classic # in case you need to start the server manually
# systemctl disable tf2classic # in case you need to stop the server from booting as your system initializes
# systemctl enable tf2classic # in case you need to start the server to boot as your system initializes
</pre>


''</br>See also [[Dedicated_Linux_server_extras|Dedicated Linux Server Extras]].''
''</br>See also [[Dedicated_Linux_server_extras|Dedicated Linux Server Extras]].''
[[Category:Guides]]
[[Category:Guides]]