Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: How to set up a Linux Dedicated Server

  1. #1

    How to set up a Linux Dedicated Server

    I just spent quite a lot of time searching for every little piece of information I needed to get my Linux Server running ut3-bin. Here are some quick and dirty instructions for how to get your Linux Dedicated Server running.

    (My Linux skills probably differ from yours so sorry if I gloss over some things. I'm not going to teach you how to use Linux, just run UT3 server. Also this is my first post so be kind.)

    Note: If you rent a server you can skip steps 1-2

    Step 1:

    Get and install Linux. You will need to make sure you open your firewall to ports UDP 6500, UDP 7777, and UDP 13000
    Note: You must turn off SELINUX or create a rule to allow ut3 to run or you will get a segfault when you try to run ut3-bin! If you edit /etc/sysconfig/selinux and change SELINUX=permissive that will fix the problem on reboot.
    Note: Many people have had host name issues causing segfault errors and resulting in servers not showing up on gamespy. Edit your /etc/hosts file (as root) and change your localhost entry to and not (all interfaces) and then specifically add a hosts entry for your server. Here is my example: localhost.localdomain localhost myhostname
    Step 2:
    Create a user account for your server to run under. You can just type "useradd unreal" and then "passwd unreal" to set a password.

    Step 3:
    Obtain the server binary and copy it to the unreal users home directory (probably /home/unreal/). Log in as the unreal server user and run the installer using "./UT3-linux-server-datehere.bin" and wait for the script to finish.
    NOTE: Chances are you will need to update your path to include the unreal binaries. There are two ways to do this. For our purposes I will suggest that you edit /etc/ and add the line "/home/unreal/ut3-dedicated/Binaries" as the user root.

    Update to Step 3:
    Here is where you would run the patch for updating to version 1.x just use the ./unreal-server1.x.bin (or whatever the name is). If you are updating after the fact you don't need to backup your config files, it does not seem to overwrite them. Make sure you are running this as the user unreal, which means the update binary needs to be owned by the user unreal (or whatever name you used) and permissions probably set to 770.

    Step 4:
    Assuming we didn't mess any of the other settings up the basic server should run great now. Lets do some basic testing and create a default config file. Log in as the user unreal and navigate to your server folder (cd ~/ut3-dedicated/Binaries) and run "./ut3"
    The server should start without getting a segfault and without returning you to a command line.
    SUCCESS! A basic un-configured server is now running. Lets kill that by pressing ctrl+C

    Step 5:

    Now that we verified our basic server starts and runs lets get fancy and customize it. There are numerous web pages for creating command line arguments for the server. I'm just putting mine in here as an example. You can modify this to your needs. This command only runs a WAR (UTGameContent.UTOnslaughtGame?GameMode=2) game type so if you want to run DM or CTF you need to change it.

    Create a file in your ~/ut3-dedicated/Binaries/ folder called and populate it with:
    sh ut3 Server WAR-Serenity?Game=UTGameContent.UTOnslaughtGame_Conten t?GameMode=2?Numplay=8?MaxPlayers=32?NumPublicConn ections=24?NumPrivateConnections=0?MinNetPlayers=1 ?TimeLimit=30?GoalScore=3?BotSkill=4?bIsDedicated= true?bUsesStats=true?ForceRespawn=0?bShouldAdverti se=true?PureServer=1?bIsLanMatch=false?bAllowJoinI nProgress=true?AdminName=admin?AdminPassword=ADMIN PASS -Login=GAMESPYLOGIN -Password=GAMESPYPASSWORD -Log=myserver.log -multihome= -unattended
    NOTE: Recent evidence (please give me feedback on this) suggests that adding -multihome=ipaddress to your command line will solve the "lag" (stability, warping, lag) issue many Linux dedicated servers are suffering from.

    Make sure the command is all on one line. Save that file and make it executable using chmod 770
    Calm down, you are not done yet. We need to set this thing up as a service so it will run when you are not logged into the server and configure game options outside the command line arguments we just passed it in the script.

    Step 5.1 (Perhaps I should have done this before step 5 but oh well.)
    We need to configure settings for the server like game size, MOTD, etc... Because of the way I had you set up the command line (without the -nohomedir argument) you need to edit your UTGame.ini located in "cd .Unreal\ Tournament\ 3/UTGame/Config/" Yes for those of you paying attention it's a hidden folder in linux "/home/unreal/.Unreal Tournament 3/Config/UTGame.ini
    Change settings in this file only if you know what they do. Message of the day, max users, etc... Don't go changing stuff you don't know about.

    Note: For those of you whining about gamespy not showing your server name correctly or game type correctly, you probably need to edit the file I talk about in the step above.

    Step 6:
    Running the ut3 server binary as a service should be our final goal here. I have written this service script for Red Hat Linux, it should also work under Centos and Fedora. If you are running something else you will need to find the correct service script for your distribution. Please note that you can simply take the from step 5 and start your server manually using "sh &" which will run the script in the background (won't stop when you exit the ssh session).

    For this step you will need to be root. As root cd to /etc/init.d and then copy an existing script like "cp sshd ut3" this will simplify the permissions issue with the file. Edit that new file ut3 and populate it with something like this:
    # Run-level Startup script for ut3-bin
    # chkconfig: 345 91 19
    # description: Starts and stops unreal dedicated server binary


    # if the executables do not exist -- display error

    if [ ! -f $ut3_home/ -o ! -d $ut3_home ]
    echo "Unreal 3 Server: cannot start"
    exit 1

    # depending on parameter -- startup, shutdown, restart
    # of the instance and listener or usage display

    case "$1" in
    # UT3 basic start script or command can be called here. For my purposes I placed the entire command line a shell script called
    echo -n "Starting UT3 Server: "
    su - $ut3_ownr -c "cd $ut3_home && ./ &"
    touch /var/lock/subsys/unreal
    echo "OK"
    # UT3 kill-shutdown
    echo -n "Shutdown UT3 Server: "
    su - $ut3_ownr -c "killall ut3-bin"
    rm -f /var/lock/subsys/unreal
    echo "OK"
    $0 stop
    $0 start
    echo "Usage: $0 start|stop|restart|reload"
    exit 1
    exit 0
    Ok be sharp kids. You need to check the paths in this script and match them to your server. If you are renting a server this is not an option for you. Just run your script like this "./ &" which makes the binary run in the background
    Now save that file and exit. Run the command "chkconfig ut3 on" to start the server automatically when your Linux box starts up
    Test your Script by running "service ut3 start" and stop it with "service ut3 stop" If you need to restart it "service ut3 restart"

    WOW, ok well I hope that helps. Like I said, I probably glossed over things and I will edit this upon constructive comment. Below are the highlights for those of you getting hung and having segfaults.

    1. Selinux off
    2. Firewall working? Configured for the right ports?
    3. Run the scripts as the user who installed them.
    4. Is your path updated in /etc/
    5. What command are you using to run the server binary? Check it, does it error if you just run ./ut3?
    6. Is your server not showing up correctly check ~/.Unreal Tournament 3/Config/UTGame.ini
    7. Have you stopped and had some coffee? Coffee is a great stimulant and helps most of us think better.

    Enjoy !

  2. #2
    I have followed your guide from steps 5 to 6, seem to have a working service now, thanks for that . however, as I had to change a few settings (since my install works differently and all that) I used the following line instead to actually start the shell script

    sh "$ut3_home/" &

    but UT3-bin still reports out everything to the CLI, wondering if perhaps you might know of a cure for that ^^;;.

    well anyway thanks for what you put, certainly setting this up as a service does ease things up greatly I must say, and even if get those reports out, only really see em every 20 minutes so it's no biggy. Thanks for the guide, .

  3. #3
    Great post, it should be stickied.

    If you get a chance, maybe you could place this on the unreal admin wiki as well?

  4. #4

    Remote server control from any computer, even Windows

    There is an alternate method which may appeal to Windows users who would like to run their own server, but may not like what they see in step 6 above.

    As an alternative to step 6, you can run the server via an ssh login from another computer, any other computer. That is how I run mine. Windows users would need to install Putty. Putty is a widely used ssh terminal emulator. You do not need peripherals like keyboard, mouse, or a monitor for your server. Yes, you can administer your Linux UT3 dedicated server from your Windows computer.

    If like myself, you want to be able to run your choice of WAR, CTF, DM, or VCTF server, whenever you want or at a moments notice. This is one way to do it. You can have several command lines available for different configurations. Produce the ones you want using step 5a above and simply run the one you want when you want. This is also good for hands on types who like to play with settings.

    Also, if you want to run your server as a regular user instead of root, use ]# chmod 775

  5. #5
    Thing is tho, without step 6, The moment you close the SSH Session your Server will close down UT3-Bin, Nohup can work and I hear things about screen tho not got much knowledge on that, setting UT3 up as a service is very easy to manage and hopefully a Service UT3 Status script/method can be created that could turn around and tell you how well all UT3-Bin related processes are fairing.

    Also with this method you can set it up so that if the server is rebooted that UT3-bin automatically restarted and also you can apply it so that it loads up multiple process instances of UT3-Bin... so over all I think this method is probably going to be the best all-round method for managing UT3 Server on Linux. However, I think some Distros this method may not work for if they do not yet support service, and I think Ubuntu is one that does not...

  6. #6
    You are correct that for most folks who are not using the service script I wrote you will have to run "sh &" or ./ & to run it as a background process so it won't close when you exit your shell. I actually use that syntax in the service script on step 6 but it's a good point I will add a note about it in my edits.

  7. #7
    FYI Some of you are having "Lag" issues with the Linux Dedicated Server. Specifically random warping, lag, network packet loss. Perhaps this error in console when the lag occurs:

    ScriptLog: # - Attempting to sync up the weapon

    Over at on the mailing lists some of us are trying to figure out who has a working config and who does not and compare them to find out where the problem lies. Don't assume you are having actual "network" based lag because there is a known issue.

    If you have a working configuration or have solved this issue PLEASE post your resolution here.

  8. #8
    How long does it take to occur, I notice no such problems myself but my server is usually empty as I keep taking it down and putting it up whilst I am still configuring a few things~. Since I can usually run it a few hours with no problem, but then not many people...

  9. #9
    Ah, good question. I get it when I have about 20 ppl connected. Seems to "lag" for about 5 minutes and then goes away but comes back more frequently in subsequent games. If you restart often then it stays away, but who can reboot a public server "often"?

  10. #10
    While lagging I have these unsual logs :

    ScriptLog: Received a map update for a none existant MapID (2)

    SeamlessTravel: >> GameInfo::HandleSeamlessTravelPlayer: UTPlayerController_220

    ScriptLog: # - Attempting to sync up the weapon

    You may be right, something to do with this. Too bad that EPIC is not looking at such thread :| Being able to have great server will ensure a great future for the game.

    If you have test binaries, I can put it on my server, it's always full with players, I've lag every hour ...after restart ...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts