{"id":365,"date":"2014-12-03T14:27:13","date_gmt":"2014-12-03T13:27:13","guid":{"rendered":"http:\/\/www.mesnie.org\/?p=365"},"modified":"2019-03-12T22:10:35","modified_gmt":"2019-03-12T21:10:35","slug":"dedicated-gmod-server-tutorial-under-linux","status":"publish","type":"post","link":"https:\/\/terageek.org\/en\/tuto\/tuto-serveur-gmod-dedie-sous-linux\/","title":{"rendered":"Tutorial - Dedicated Gmod server under Linux (from A to Z +ULX +anti-crash)"},"content":{"rendered":"<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Tutorial - Dedicated Gmod server under Linux (from A to Z +ULX +anti-crash)\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/Zxy-pOZZk5c?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><br>Script Daniel Gibbs :&nbsp;<a href=\"https:\/\/linuxgsm.com\/lgsm\/gmodserver\/\">https:\/\/linuxgsm.com\/lgsm\/gmodserver\/<\/a><\/p>\n\n\n\n<p>Config 1 FTP per user : <a href=\"http:\/\/www.tutoriels-video.fr\/installation-dun-serveur-ftp-et-configuration-dun-nom-de-domaine-dn\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.tutoriels-video.fr\/installation-dun-serveur-ftp-et-configuration-dun-nom-de-domaine-dn\/<\/a><br>Full Workshop tutorial : <a href=\"https:\/\/terageek.org\/en\/tuto\/configuring-your-garrys-mod-server-workshop-under-linux-or-windows\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.terageek.org\/tuto\/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows\/<\/a><br>Tuto activate the console : <a href=\"https:\/\/terageek.org\/en\/tuto\/console-activation-in-valve-games\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.terageek.org\/tuto\/activation-de-la-console-dans-les-jeux-valve\/<\/a><br>Download ULX : <a href=\"http:\/\/ulyssesmod.net\/downloads.php\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/ulyssesmod.net\/downloads.php<\/a><\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Install the necessary packages<\/strong><\/span><\/p>\n\n\n\n<p>They may vary, but you can find them here :&nbsp;<a href=\"https:\/\/linuxgsm.com\/lgsm\/gmodserver\/\">https:\/\/linuxgsm.com\/lgsm\/gmodserver\/<\/a><\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Add a user<\/strong><\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">adduser gmodserver<\/pre>\n\n\n\n<p>Choose a password, and press enter until it is created<\/p>\n\n\n\n<p>Log on to the user :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">su - gmodserver<\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Download the script<\/strong><\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/linuxgsm.com\/dl\/linuxgsm.sh &amp;&amp; chmod +x linuxgsm.sh &amp;&amp; bash linuxgsm.sh gmodserver<\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Start installation<\/strong><\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted wp-code-highlight prettyprint prettyprinted\"><span class=\"pun\">.\/<\/span><span class=\"pln\">gmodserver install<\/span><\/pre>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Next, choose an RCON server name and password (you can change them later in \/serverfiles\/garrysmod\/cfg\/gmod-server.cfg ).<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Start\/stop\/restart\/check update server<\/strong><\/span><\/p>\n\n\n\n<p>Basic controls<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver start<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver stop<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver restart<\/pre>\n\n\n\n<p>Useful information about the server and the machine<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver details<\/pre>\n\n\n\n<p>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)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver monitor<\/pre>\n\n\n\n<p>Update<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver update<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver update-restart<\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Configuring your server<\/strong><\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano gmodserver<\/pre>\n\n\n\n<p>(Remember, to exit \"nano\", ctrl + q, then \"y\" to confirm changes or \"n\" to cancel) then \"enter\".<\/p>\n\n\n\n<p>Inside, you'll find some interesting variables<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">emailnotification=\"on\"<\/pre>\n\n\n\n<p>Which allows you to receive an email in the event of a server crash. And you add your email address. You can then do<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver email-test<\/pre>\n\n\n\n<p>to check receipt of the e-mail<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">workshopauth=\"xxxxxxxxx\"\n workshopcollectionid=\"xxxxxxxxx\"<\/pre>\n\n\n\n<p>For the workshop, see the full tutorial here:&nbsp;<a href=\"https:\/\/terageek.org\/en\/tuto\/configuring-your-garrys-mod-server-workshop-under-linux-or-windows\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.terageek.org\/tuto\/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows\/<\/a><\/p>\n\n\n\n<p><strong>The default map<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">defaultmap=\"gm_construct\"<\/pre>\n\n\n\n<p>Maximum number of players<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">maxplayers=\"32\"<\/pre>\n\n\n\n<p><strong>Fix hunk for rp_rockford_v1b and others<\/strong><\/p>\n\n\n\n<p>After the configurations, add :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">commands=\"+r_hunkalloclightmaps 0 +tv_enable 0\"<\/pre>\n\n\n\n<p>then at the end of parms= \" \", add :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">${commands}<\/pre>\n\n\n\n<p><strong>Port configuration<\/strong><\/p>\n\n\n\n<p>If you only have one server, leave as default.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>If you have several servers, I recommend that you proceed as follows:<\/p>\n\n\n\n<p>- port: from 27025 to 27049<\/p>\n\n\n\n<p>- sourcetvport : from 27050 to 27074<\/p>\n\n\n\n<p>- clientport : from 27000 to 27049<\/p>\n\n\n\n<p>In theory, this means you can run up to 24 servers on the same machine...<\/p>\n\n\n\n<p>So for the first server it looks like :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">port=\"27025\"\nsourcetvport=\"27050\"\nclientport=\"27000\"<\/pre>\n\n\n\n<p>IP, to be entered only if your server has several network cards<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ip=\"0.0.0.0\"<\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Using the console<\/strong><\/span><\/p>\n\n\n\n<p>To see what's going on or write commands, you can use the server console.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/gmodserver console<\/pre>\n\n\n\n<p>You confirm the warning that says \"don't quit with ctrl + c or you'll close the server\".<\/p>\n\n\n\n<p>And to exit the console properly, you need to press: ctrl + b, then d! (and not ctrl + b + d at the same time)<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>View logs<\/strong><\/span><\/p>\n\n\n\n<p>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!<\/p>\n\n\n\n<p>At the root, you have a \"log\" folder with the console log and the script log.<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Automate the server<\/strong><\/span><\/p>\n\n\n\n<p>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).<\/p>\n\n\n\n<p>Two ways: As root, or with the user. A single server or no root access: use the user. Several servers: use root.<\/p>\n\n\n\n<p>In all cases, the command to access automation :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">crontab -e<\/pre>\n\n\n\n<p>Then add :<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">In root :<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"lit\">0<\/span> <span class=\"lit\">5<\/span> <span class=\"pun\">*<\/span> <span class=\"pun\">*<\/span> <span class=\"pun\">*<\/span><span class=\"pln\">  su <\/span><span class=\"pun\">-<\/span><span class=\"pln\"> gmodserver <\/span><span class=\"pun\">-<\/span><span class=\"pln\">c <\/span><span class=\"str\">\/home\/gmodserver\/gmodserver update-restart'<\/span> <span class=\"pun\">&gt;<\/span> <span class=\"str\">\/dev\/<\/span><span class=\"kwd\">null<\/span> <span class=\"lit\">2<\/span><span class=\"pun\">&gt;&amp;<\/span><span class=\"lit\">1\n\n<\/span><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"pun\">*<\/span><span class=\"str\">\/5 * * * * su - gmodserver -c '\/<\/span><span class=\"pln\">home<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">gmodserver<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">gmodserver monitor<\/span><span class=\"str\">' &gt; \/dev\/null 2&gt;&amp;1<\/span><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;<\/pre>\n\n\n\n<p><span style=\"text-decoration: underline;\">En user :<\/span><\/p>\n\n\n\n<p><span class=\"lit\">0<\/span> <span class=\"lit\">5<\/span> <span class=\"pun\">*<\/span> <span class=\"pun\">*<\/span> <span class=\"pun\">*<\/span> <span class=\"str\">\/home\/<\/span><span class=\"pln\">gmodserver<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">gmodserver update<\/span><span class=\"pun\">-<\/span><span class=\"pln\">restart <\/span><span class=\"pun\">&gt;<\/span> <span class=\"str\">\/dev\/<\/span><span class=\"kwd\">null<\/span> <span class=\"lit\">2<\/span><span class=\"pun\">&gt;&amp;<\/span><span class=\"lit\">1 <\/span><\/p>\n\n\n\n<p class=\"wp-code-highlight prettyprint prettyprinted\"><span class=\"pun\">*<\/span><span class=\"str\">\/5 * * * * \/<\/span><span class=\"pln\">home<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">gmodserver<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">gmodserver monitor <\/span><span class=\"pun\">&gt;<\/span> <span class=\"str\">\/dev\/<\/span><span class=\"kwd\">null<\/span> <span class=\"lit\">2<\/span><span class=\"pun\">&gt;&amp;<\/span><span class=\"lit\">1<\/span><\/p>\n\n\n\n<p>In both cases, if you have several servers, make sure that the file is the right one!<\/p>\n\n\n\n<p class=\"wp-code-highlight prettyprint prettyprinted\">And there you have it!<\/p>\n\n\n\n<p class=\"wp-code-highlight prettyprint prettyprinted\"><strong>If you have any questions, feel free to comment!<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;Enjoy the game!<\/strong><\/p>\n\n\n\n<p>Full Workshop tutorial : <a href=\"https:\/\/terageek.org\/en\/tuto\/configuring-your-garrys-mod-server-workshop-under-linux-or-windows\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.terageek.org\/tuto\/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows\/<\/a><\/p>\n\n\n\n<p><strong>Coming soon: More details in writing.<\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>Script Daniel Gibbs :&nbsp;https:\/\/linuxgsm.com\/lgsm\/gmodserver\/ Config 1 FTP par user : http:\/\/www.tutoriels-video.fr\/installation-dun-serveur-ftp-et-configuration-dun-nom-de-domaine-dn\/Tuto complet Workshop : https:\/\/www.terageek.org\/tuto\/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows\/Tuto activer la console : https:\/\/www.terageek.org\/tuto\/activation-de-la-console-dans-les-jeux-valve\/T\u00e9l\u00e9charger ULX : http:\/\/ulyssesmod.net\/downloads.php Installer les paquets n\u00e9cessaires Ils peuvent varier, vous les trouverez ici :&nbsp;https:\/\/linuxgsm.com\/lgsm\/gmodserver\/ Ajouter un utilisateur adduser gmodserver Choisissez un password, et faites entr\u00e9e jusqu&rsquo;\u00e0 ce que ce soit cr\u00e9e Se logger sur [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":368,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tuto"],"_links":{"self":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/comments?post=365"}],"version-history":[{"count":0,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/posts\/365\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/media\/368"}],"wp:attachment":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/media?parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/categories?post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/tags?post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}