SRCDS Steam group


Best practices for hosting multiple servers
#1
I'm currently working on setting up a linux (ubuntu 8.04) server for hosting css servers and a couple of tf2 servers. I can get the servers up and running, but there are a few questions that I haven't been able to find answers to.

What's the best practice for installing servers directory wise. I.e. where should I put the hldsupdatetool, and where should I install the servers to, using what naming conventions? I guess this is open to interpretation, so I will explain a little more about the scenario.

This server is for my clan, and we will be host 3 or 4 servers, for ourselves, but because collocation is expensive as hell, we want to be able to rent out a couple of servers to cover some costs and make collocating worth it.

Previously, I installed hldsupdate tool in /srcds/ and used that to download servers to /srcds/servers/332_css1, /srcds/servers/332_css2, etc. But then I realised that to have other clans renting servers they will need FTP access with suitable permissions. I considered using symlinks to solve this, but I figure that I may as well create a user for each clan that does not have shell access and then load the servers in that users home directory.

So if each of the servers start going in each users home directory, where do I put the hldsupdate. Should I use the one updatetool to install all the servers like i have been, or should i set up an update tool for each server?


Also, if I don't want to use a system like gamecp for this server, can anybody provide any pointers on how I should set the server up so that I don't have to spend so much time managing it. Currently, I have to navigate into each server directory and run a shell script to start the server. This entails a lot of typing just to get everything up and running. Is there maybe an alternative... and more basic solution than gamecp out there? preferably free, or less that $100usd.


Best practices like this don't seem to be covered in depth, so I hope you can understand where I'm coming from here Smile.
Reply
#2
No takers?

Ok, I'll stumble my way through again and see if I can make it a little better this time round.
Reply
#3
You've gotta give us time defex.

I personally would install each server in their own folder on the C drive and then drop a copy of hldsupdatetool.exe in the root of each.

I would then write start-up scripts and update scripts for every server and put that in a separate folder. So then you can launch everything some the scripts.
~ Mooga ...w00t? - SRCDS.com on Twitter
[Image: 76561197965445574.png]
Please do not PM me for server related help
fqdn Wrote:if you've seen the any of the matrix movies, a game server is not all that different. it runs a version of the game that handles the entire world for each client connected. that's the 2 sentence explanation.
Reply
#4
Mooga - In Linux?

defex...
Use symlinks to keep the backups small.
One user for srcds files and one user per server after that and add them to srcds group so they can use the shared content.
Then you only need to update the shared content.
"the box said 'requires windows xp or better'. so i installed linux"
Linux Ubuntu 9.04 Server 2.6.30-vanilla #1 SMP PREEMPT x86_64
Reply
#5
janne Wrote:Mooga - In Linux?

defex...
Use symlinks to keep the backups small.
One user for srcds files and one user per server after that and add them to srcds group so they can use the shared content.
Then you only need to update the shared content.

That's an interesting take on it. How would each user be able to modify their server independantly from the others if they are all using the same srcds server with symlinks. Or is it possible to use srcds like steam, where the content is shared, and then users can override that content individually. Sorry, I'm a little ignorant on this matter.
Reply
#6
shared content group readable and executable in some cases.
then add each new user to that group.

create symlinks for the whole installation and relplace some of the user config files and chown them to that user.
this way only the config files are writable by the user. (cstrike/*.db, cstrike/*.txt, cstrike/cfg/*)

with this setup I can keep the backups of my 6 servers around 10-15mb in size Wink
"the box said 'requires windows xp or better'. so i installed linux"
Linux Ubuntu 9.04 Server 2.6.30-vanilla #1 SMP PREEMPT x86_64
Reply
#7
I'm still not understanding you 100%, but I've got time to think it over. Thanks.
Reply
#8
janne Wrote:Mooga - In Linux?

I forgot to mention that I'm not a *lix pro Rolleyes
Sorry Big Grin
~ Mooga ...w00t? - SRCDS.com on Twitter
[Image: 76561197965445574.png]
Please do not PM me for server related help
fqdn Wrote:if you've seen the any of the matrix movies, a game server is not all that different. it runs a version of the game that handles the entire world for each client connected. that's the 2 sentence explanation.
Reply
#9
maybe i should just ditch nix and go down the win2k3 route, but I'm a cheap arse bum Smile and i hear nix has better multicore process distribution.
Reply
#10
Hmm, I am running 2 servers on the same box, and I just executed a different config for each server via command line.

I don't understand what janne stated, how can I force each server to have its own configs (cstrike/*.db, cstrike/*.txt, cstrike/cfg/*). You said 10-15MB, but my folder is 2.5GB in size.

Should I just do 3 different installation directories? Hence 2.5GB x 3? Or I can use my existing directory and make configs for different users?
Reply
#11
I went the route of redownloading each server in its own directory. Logistically, it was simpler because I will be giving access to some servers to other people and they will want complete access to everything to run mods and such.

I tried Janne's idea, but it failed miserably as soon as user 2 started overriding changes made by user 1.

Plus, hard drive space isn't all that expensive.
Reply
#12
Create a user & folder for the shared content.
Code:
sudo useradd -d/home/srcds -m srcds
Make a default srcds installation in that folder as user srcds.
Also if you want put some extra maps and plugins you need to be common for all servers. (if so, don't to edit maplist.txt etc...)

Then create the first user
Code:
sudo useradd -d/home/user1 -m user1
and as root create symbolic links from srcds
Code:
sudo cp -s -R /home/srcds/* /home/user1/
and replace user editable files with a fresh copy of their own
Code:
sudo rm /home/user1/cstrike/cfg/*
sudo rm /home/user1/cstrike/*.txt
sudo rm /home/user1/cstrike/*.db
sudo cp /home/srcds/cstrike/cfg/* /home/user1/cstrike/cfg/
sudo cp /home/srcds/cstrike/*.txt /home/user1/cstrike/
sudo cp /home/srcds/cstrike/*.db /home/user1/cstrike/

and set proper permissions for directories
Code:
sudo find /home/user1/ -type d -exec chown user1.user1 {} \;
and files
Code:
sudo chown user1.user1 /home/user1/cstrike/cfg/*
sudo chown user1.user1 /home/user1/cstrike/*.txt
sudo chown user1.user1 /home/user1/cstrike/*.db

the add user1 to group srcds so it can read its files
Code:
sudo usermod -a -Gsrcds user1


Repeat the user process for more servers.

All updates will this way only be needed on the shared content.
All users can edit their own configs and install new maps and plugins which wasn't part of the shared content.


GL!
"the box said 'requires windows xp or better'. so i installed linux"
Linux Ubuntu 9.04 Server 2.6.30-vanilla #1 SMP PREEMPT x86_64
Reply
#13
That should be split and stickied
~ trewq
Reply
#14
hmmm, i do things a little bit differently.

I own a server hosting company which is currently hosting 12 servers.

(for the record, i never said it was secure but the principle is good)

750 gig harddrive

default installs are put into
/home/defaults/[Counter-Strike][Counter-Strike Source][Team Fortress 2]

etc


user installs are copies of the default installs in the following format

/home/servers/USERNAME/GAMEABREV_GAMEID/

and inside that directory is where cstrike, srcds_run etc is

USERNAME refers to an alphanumeric username which is created when the account is created on the web frontend. GAMEABREV = tf2, cs, css and GAMEID is an auto increment number which is made when a new server is added, this is so that users can have multipule servers under the same account.

For ftp purposes i find the above suits my needs.

By the way, im still in the proccess of coding a gaming control panel based on an open source web control panel called VHCS2 (google it).

it starts and stops servers, installs them, sets permissions, creates ftp accounts for gaming users, creates accounts and disables servers (for non payers) and accounts if nescasary so far.

Thats my 2 cents.

Edit: also, the permissions are set on the executables so people cant edit them through ftp obviously Toungue
Reply
#15
Alright, I have a bit of an issue after I have implemented janne's idea. Whenever a user changes their mapcycle.txt file, it changes all of the mapcycle.txt files in the whole server, including the srcds folder. Obviously this shouldn't be happening.

Any ideas? I followed all of the commands correctly and double checked permissions. Seems like the files are being broadcast throughout the whole userbase.
Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)