User:Webb/New linux server: Difference between revisions
From TF2 Classified Wiki
More actions
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
== Prerequisites == | == Prerequisites == | ||
* A Linux server running Ubuntu Server<sup>*</sup> on an x86_64 CPU<sup>**</sup> with root | * A Linux server running Ubuntu Server<sup>*</sup> on an x86_64 CPU<sup>**</sup> with root access | ||
* At least 20GB of free storage | * At least 20GB of free storage | ||
* A minimum of a 10Mbps upload speed if you intend on hosting a server over the Internet. More bandwidth may be needed if custom maps are used. | * A minimum of a 10Mbps upload speed if you intend on hosting a server over the Internet. More bandwidth may be needed if custom maps are used. | ||
* ''Optional'': An SSH/SFTP client if doing remote access/file management | |||
<sup>*</sup> This guide was written for and tested on Ubuntu Server 24.04 LTS Minimal. Other distros may use different package names and conventions. | <sup>*</sup> This guide was written for and tested on Ubuntu Server 24.04 LTS Minimal. Other distros may use different package names and conventions. | ||
| Line 57: | Line 57: | ||
<pre># apt install nano</pre> | <pre># apt install nano</pre> | ||
Switch to the srcds user you | Switch to the new <code>srcds</code> user you made, and run SteamCMD. | ||
<pre> | <pre> | ||
| Line 93: | Line 93: | ||
Valve changed some shared object file names in the SDK and the objects we’re given have not adapted to the new names. Since these are simply renames, we can symlink them. | Valve changed some shared object file names in the SDK and the objects we’re given have not adapted to the new names. Since these are simply renames, we can symlink them. | ||
'''Your server will not start without doing this.''' | We'll also do the same for TF2C's <code>server_srv.so</code> '''Your server will not start without doing this.''' | ||
Run the following commands to create the symlinks in the bin folder: | Run the following commands to create the symlinks in the bin folder: | ||
| Line 134: | Line 133: | ||
== Server Configuration == | == Server Configuration == | ||
For a basic, private server, you should only need to set a password in <pre>sdk/tf2classic/cfg/server.cfg</pre> by appending the file with <pre>sv_password yourpassword</pre>. | |||
You can also make it LAN-only by appending <pre>sv_lan 1</pre> in the same file. | |||
If you want a more complicated set up, consider using [https://cfg.tf/ cfg.tf]. If you don't need this you can skip to the next section. | |||
Make sure the server type is set to “Internet and LAN” if you want players outside your LAN to be able to join (you may need to port forward if you’re on consumer broadband or open ports on your firewall). | Make sure the server type is set to “Internet and LAN” if you want players outside your LAN to be able to join (you may need to port forward if you’re on consumer broadband or open ports on your firewall). | ||
| Line 191: | Line 193: | ||
<pre> | <pre> | ||
[Unit] | [Unit] | ||
Description=TF2C | Description=TF2C Server | ||
After=network-online.target | After=network-online.target | ||
Wants=network-online.target | Wants=network-online.target | ||
| Line 207: | Line 209: | ||
TimeoutStartSec=infinity | TimeoutStartSec=infinity | ||
Restart=always | Restart=always | ||
[Install] | [Install] | ||
| Line 229: | Line 228: | ||
</pre> | </pre> | ||
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>. When updating service files, remember to run <code>systemctl daemon-reload</code> before restarting the service. | ||
=== Systemd manual start, stop, restart/update === | === Systemd manual start, stop, restart/update === | ||