Dedicated legacy Linux server: Difference between revisions
From TF2 Classified Wiki
More actions
m Update downloader link |
Technochips (talk | contribs) use pre instead of code, added instructions for manual installs |
||
| Line 24: | Line 24: | ||
Create a user with that home directory and give it a strong password: | Create a user with that home directory and give it a strong password: | ||
< | <pre> | ||
# useradd -m -d /opt/tf2classic -s /usr/bin/bash steam | |||
# passwd steam | |||
</pre> | |||
</ | |||
<code>-m</code> creates a home directory for it, <code>-d /opt/tf2classic</code> specifies where our home directory will be, and <code>-s /usr/bin/bash</code> sets the shell to bash. | <code>-m</code> creates a home directory for it, <code>-d /opt/tf2classic</code> specifies where our home directory will be, and <code>-s /usr/bin/bash</code> sets the shell to bash. | ||
| Line 35: | Line 34: | ||
The SteamCMD package is in the multiverse repos. TF2Classic and SteamCMD require i386 (32-bit) libraries to function. You also need 7-Zip to extract TF2Classic. | The SteamCMD package is in the multiverse repos. TF2Classic and SteamCMD require i386 (32-bit) libraries to function. You also need 7-Zip to extract TF2Classic. | ||
< | <pre> | ||
# add-apt-repository multiverse | |||
# dpkg --add-architecture i386 | |||
# apt update | |||
</pre> | |||
</ | |||
Install SteamCMD, and miscellaneous packages that we'll be using. | Install SteamCMD, and miscellaneous packages that we'll be using. | ||
< | <pre> | ||
# 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> | ||
Login to the steam user you created: | Login to the steam user you created: | ||
< | <pre># su - steam</pre> | ||
Run <code>steamcmd</code> and let it update. When it’s finished updating and displays a prompt, login anonymously by typing and running: <code>login anonymous</code> | Run <code>steamcmd</code> and let it update. When it’s finished updating and displays a prompt, login anonymously by typing and running: <code>login anonymous</code> | ||
| Line 67: | Line 64: | ||
Run: | Run: | ||
< | <pre> | ||
$ wget https://github.com/tf2classic/TF2CDownloader/releases/latest/download/TF2CDownloaderLinux | $ wget https://github.com/tf2classic/TF2CDownloader/releases/latest/download/TF2CDownloaderLinux | ||
$ chmod +x ./TF2CDownloaderLinux | $ chmod +x ./TF2CDownloaderLinux | ||
$ ./TF2CDownloaderLinux | $ ./TF2CDownloaderLinux | ||
</ | </pre> | ||
And follow the prompts. | And follow the prompts. | ||
| Line 79: | Line 74: | ||
You'll need to move the extracted directory into your SDK 2013 MP folder: | You'll need to move the extracted directory into your SDK 2013 MP folder: | ||
< | <pre>mv tf2classic /opt/tf2classic/server/</pre> | ||
== Server Configuration == | == Server Configuration == | ||
| Line 88: | Line 83: | ||
Upload the generated ZIP file to your server using SFTP, unzip the folder using: | Upload the generated ZIP file to your server using SFTP, unzip the folder using: | ||
< | <pre>unzip <archive>.zip</pre> | ||
And merge the <code>cfg</code> folder with <code>/opt/tf2classic/server/tf2classic/cfg/</code>. | And merge the <code>cfg</code> folder with <code>/opt/tf2classic/server/tf2classic/cfg/</code>. | ||
| Line 95: | Line 90: | ||
Change into the server directory with: | Change into the server directory with: | ||
< | <pre>$ cd /opt/tf2classic/server/</pre> | ||
Create a script to run the server with one simple command. Use any text editor of your choice to create runserver.sh where srcds_run is located. For the sake of those unfamiliar with terminal text editing, we'll be using Tilde. Run: | Create a script to run the server with one simple command. Use any text editor of your choice to create runserver.sh where srcds_run is located. For the sake of those unfamiliar with terminal text editing, we'll be using Tilde. Run: | ||
< | <pre>$ tilde runserver.sh</pre> | ||
Fill it with this line (you may be able to paste using Ctrl-Shift-V): | Fill it with this line (you may be able to paste using Ctrl-Shift-V): | ||
< | <pre>./srcds_run -console -game tf2classic +map pl_upward +maxplayers 24</pre> | ||
Feel free to change the map and maxplayers. There are more arguments, but we’ll keep it basic. | Feel free to change the map and maxplayers. There are more arguments, but we’ll keep it basic. | ||
| Line 111: | Line 106: | ||
Now, make the script executable with: | Now, make the script executable with: | ||
< | <pre> | ||
$ chmod +x runserver.sh | $ chmod +x runserver.sh | ||
</ | </pre> | ||
== Create symlinks to missing shared objects. == | == Create symlinks to missing shared objects. == | ||
| Line 122: | Line 117: | ||
<code> | <code> | ||
cd bin | $ cd bin | ||
</code> | </code> | ||
Run the following commands to create the symlinks in the bin folder: | Run the following commands to create the symlinks in the bin folder: | ||
< | <pre> | ||
$ ln -s datacache_srv.so datacache.so | $ ln -s datacache_srv.so datacache.so | ||
$ ln -s dedicated_srv.so dedicated.so | $ ln -s dedicated_srv.so dedicated.so | ||
$ ln -s engine_srv.so engine.so | $ ln -s engine_srv.so engine.so | ||
$ ln -s materialsystem_srv.so materialsystem.so | $ ln -s materialsystem_srv.so materialsystem.so | ||
$ ln -s replay_srv.so replay.so | $ ln -s replay_srv.so replay.so | ||
$ ln -s scenefilecache_srv.so scenefilecache.so | $ ln -s scenefilecache_srv.so scenefilecache.so | ||
$ ln -s shaderapiempty_srv.so shaderapiempty.so | $ ln -s shaderapiempty_srv.so shaderapiempty.so | ||
$ ln -s studiorender_srv.so studiorender.so | $ ln -s studiorender_srv.so studiorender.so | ||
$ ln -s vphysics_srv.so vphysics.so | |||
$ ln -s soundemittersystem_srv.so soundemittersystem.so | |||
</pre> | |||
If you've manually installed TF2 Classic instead of using the automatic installer, make sure to symlink these files too, inside TF2 Classic's bin folder: | |||
$ ln -s | <pre> | ||
</ | $ cd ../tf2classic/bin | ||
$ rm server_srv.so | |||
$ ln -s server.so server_srv.so | |||
</pre> | |||
== Running the server == | == Running the server == | ||