Script Daniel Gibbs : https://linuxgsm.com/lgsm/gmodserver/
Config 1 FTP per user : http://www.tutoriels-video.fr/installation-dun-serveur-ftp-et-configuration-dun-nom-de-domaine-dn/
Full Workshop tutorial : https://www.terageek.org/tuto/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows/
Tuto activate the console : https://www.terageek.org/tuto/activation-de-la-console-dans-les-jeux-valve/
Download ULX : http://ulyssesmod.net/downloads.php
Install the necessary packages
They may vary, but you can find them here : https://linuxgsm.com/lgsm/gmodserver/
Add a user
adduser gmodserver
Choose a password, and press enter until it is created
Log on to the user :
su - gmodserver
Download the script
wget https://linuxgsm.com/dl/linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh gmodserver
Start installation
./gmodserver install
Once you've finished, type "y" if the installation went well, and "y" for the GameServer Query, which will give you much better serv crash detection.
Next, choose an RCON server name and password (you can change them later in /serverfiles/garrysmod/cfg/gmod-server.cfg ).
Start/stop/restart/check update server
Basic controls
./gmodserver start
./gmodserver stop
./gmodserver restart
Useful information about the server and the machine
./gmodserver details
Manually check whether the serv is in a state of crash (you can automate this task every X minutes, we'll see about that later)
./gmodserver monitor
Update
./gmodserver update
./gmodserver update-restart
Configuring your server
nano gmodserver
(Remember, to exit "nano", ctrl + q, then "y" to confirm changes or "n" to cancel) then "enter".
Inside, you'll find some interesting variables
emailnotification="on"
Which allows you to receive an email in the event of a server crash. And you add your email address. You can then do
./gmodserver email-test
to check receipt of the e-mail
workshopauth="xxxxxxxxx" workshopcollectionid="xxxxxxxxx"
For the workshop, see the full tutorial here: https://www.terageek.org/tuto/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows/
The default map
defaultmap="gm_construct"
Maximum number of players
maxplayers="32"
Fix hunk for rp_rockford_v1b and others
After the configurations, add :
commands="+r_hunkalloclightmaps 0 +tv_enable 0"
then at the end of parms= " ", add :
${commands}
Port configuration
If you only have one server, leave as default.
For port configuration, there's the main port, used to connect ("port"), the "spectator" port (I don't even know if it's used in gmod) and the "client" port, which is essential.
If you have several servers, I recommend that you proceed as follows:
- port: from 27025 to 27049
- sourcetvport : from 27050 to 27074
- clientport : from 27000 to 27049
In theory, this means you can run up to 24 servers on the same machine...
So for the first server it looks like :
port="27025" sourcetvport="27050" clientport="27000"
IP, to be entered only if your server has several network cards
ip="0.0.0.0"
Using the console
To see what's going on or write commands, you can use the server console.
./gmodserver console
You confirm the warning that says "don't quit with ctrl + c or you'll close the server".
And to exit the console properly, you need to press: ctrl + b, then d! (and not ctrl + b + d at the same time)
View logs
In the event of a problem with a plugin, kikoo crashing the serv, doubts about the config, verification or anything else, it's always a good idea to check the logs!
At the root, you have a "log" folder with the console log and the script log.
Automate the server
We're going to try to : Update and reboot the server once a day, and check for crashes every 5 minutes (don't go below 3 or you risk having anti-crash check loops).
Two ways: As root, or with the user. A single server or no root access: use the user. Several servers: use root.
In all cases, the command to access automation :
crontab -e
Then add :
In root :
0 5 * * * su - gmodserver -c /home/gmodserver/gmodserver update-restart' > /dev/null 2>&1
*/5 * * * * su - gmodserver -c '/home/gmodserver/gmodserver monitor' > /dev/null 2>&1
En user :
0 5 * * * /home/gmodserver/gmodserver update–restart > /dev/null 2>&1
*/5 * * * * /home/gmodserver/gmodserver monitor > /dev/null 2>&1
In both cases, if you have several servers, make sure that the file is the right one!
And there you have it!
If you have any questions, feel free to comment!
Enjoy the game!
Full Workshop tutorial : https://www.terageek.org/tuto/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows/
Coming soon: More details in writing.
Leave a Reply
You must be logged in to post a comment.