Создать сервер quake 3 linux
you are here :[ —>networks—>quake3 linux server howto]
WARNING: This website is outdated, it has NOT been updated since 2011. Use at your own risk.
Quake III Arena linux dedicated server HOWTO
this document explains how to install and configure a Quake III Arena (q3a) dedicated server on a linux box. it is assumed that you :
* have root shell access to a linux box (remote or local)
* know some linux basics (installing software, ssh, scp, . )
* know some quake basics (q3config, mod, basic console commands, . )
* want to install a quake (vq3/osp/cpma whetever) server 😉
* you have ‘screen’ installed on your server (simply install it if you don’t have it)
Disclaimer, License and Copyright
Copyright spirit 2007
I will not accept any responsibility for any incorrect information within this document, nor for any damage it might cause when applied.
You may redistribute and/or modify this document as long as you comply with the terms of the GNU Free Documentation Licence.
Conventions used in this document
Normal text looks like this, commands you have to type look like the next line:
user@localbox> $ ssh user@myserver.tld
root@myserver> # chmod a+x linuxq3apoint-1.32b-3.x86.run
Note that the shell prompt in front of the actual command indicates the user and the machine you have to run the command at:
obviously means that you need to run this command as root at your server.
A note to win32 users
This document assumes you’re running linux on both the server and the box you use to connect to the server (via ssh) to configure it.
If you’re running win32, you’ll obviously need to get a ssh / scp client like putty for that OS first.
If this sounds strange to you get some info on linux and ssh before you try to use this howto.
Contacting the author of this document
Please do not ask me to install a quake server for you, I won’t. I obviously don’t need any reasons for that but here’s a few anyways:
* This howto explains how to do it. If you don’t understand it you need to learn more on linux or write me an email explaining exactly which part of this document you don’t understand so I can improve it.
* If you don’t setup the server yourself you won’t by able to maintain it: it will be down after the next reboot, it will become insecure because you don’t know how to update it.
* You shouldn’t offer others root access to your server (that would obviously be necessary to have someone else configure it for you)
* If you don’t know a thing about linux rent a game-server from some company, don’t rent a root server.
* I don’t have time to setup your server.
* I don’t want to setup your server.
Also refrain from asking me how to use ssh, scp, rcon, iptables and vim in general (see notes above).
Apart from that, feel free to contact me with comments, error reports and suggestions on how to improve this document.
Step 1 : Create a new user that the Quake Server will be running under
there is no need to run a quake 3 server as root, and doing so is a very bad idea. running it under your standard user account isn’t a good idea either. so we will add a new user called ‘quake3’ that the server will use.
1) connect to the server, become root
user@localbox> $ ssh user@myserver.tld
2) become root, create the user
user@myserver> $ su
root@myserver> # useradd -g users -d /home/quake3 -s /bin/bash -m quake3
Step 2 : Copy stuff we need to the Server
this can be done via scp, ftp or whatever, ftp should be faster than ssh. you may also use wget to get the stuff.
1) copy the newest quake3 pointrelease for linux to your server (note that you need the 1.32b pointrelease AND the 1.32c security fix!)
user@localbox> $ scp linuxq3apoint-1.32b-3.x86.run user@myserver:/home/user/
user@localbox> $ scp quake3-1.32c-linux.zip user@myserver:/home/user/
You may also get them via wget (from the id ftp or some mirror) at your server:
user@server> $ wget ftp://ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.32b-3.x86.run
user@server> $ wget ftp://some.mirror/quake3/linux/quake3-1.32c-linux.zip
2) copy the pak0.pk3 file from your q3a CD (or from your harddisk) to your server
user@localbox> $ scp pak0.pk3 user@myserver:/home/user/
3) copy any mod you want to install to your server
user@localbox> $ scp osp-Quake3-1.03a_full.zip user@myserver:/home/user/
Step 3 : Install Quake 3 and the mods
you can place the stuff into virtually any directory, but a good place is to install Quake 3 into /usr/local/games/quake3/ and the instructions in this HOWTO and the config- and startscripts provided later will expect quake 3 to be installed there. installation is pretty obvious :
1) run the pointrelease binary as root, install to /usr/local/games/quake3/
root@myserver> # chmod a+x linuxq3apoint-1.32b-3.x86.run
root@myserver> # ./linuxq3apoint-1.32b-3.x86.run
. and apply the 1.32c security fix by unpacking the zipfile and copying the binaries to the quake 3 directory the installation just created (should be /usr/local/games/quake3/).
2) copy the pak0.pk3 file to your q3a directory
root@myserver> # cp pak0.pk3 /usr/local/games/quake3/baseq3/
3) as your quake-server user, create the quake directory that will hold the mod files and your server config files and map rotation files :
quake3@myserver> $ cd
quake3@myserver> $ mkdir -p .q3a/baseq3/
4) install the mods in the .q3a/ directory you just created (not into .q3a/baseq3/)
quake3@myserver> $ mv osp-Quake3-1.03a_full.zip
/.q3a/
quake3@myserver> $ cd
/.q3a/
quake3@myserver> $ unzip osp-Quake3-1.03a_full.zip
Step 4 : Create the server config file
create a quake 3 config file that your server will use.
an example config file for a Quake 3 Server that runs the OSP mod and uses a Maprotate file called «maprotation-osp.cfg» is given below :
Step 5 : Create the server maprotation file
create a quake 3 server maprotation file that your server will use.
an example maprotation file that rotates some maps from the OSP mod is given below :
Step 6 : Create a shellscript to start the server
we’ll use the unix program ‘screen’ in this script, so again make sure you have installed it.
an example startup script that runs the osp mod is given below. simply omit the ‘+set fs_game osp’ if you want a vanilla q3a server (no mods) and set your servers IP, port and any name you want to identify the server.
some notes on adapting the script to your needs:
* choose a port > 1024. ports in the range 27960 — 27963 are recommended because servers using these ports are listed in the quake in-game server browser.
* using ‘+set dedicated 2’ instead of ‘+set dedicated 1’ will register your server with the masterservers you configured in the server config file. this will quickly fill the server with players.
* you can easily start multiple q3a servers (one running osp, one running rocket arena. ) if you set a different port for each of the servers.
so what does that script do? it uses screen (a unix screen manager, see ‘man screen’) to run the quake server in a detached screen session named «q3a-osp». this is needed to keep the quake server running when you disconnect from the remote host.
because q3ded is not a daemon process, it is attached to your terminal session and your q3a server would go down if you didn’t use screen and quit the shell (type ‘exit’ or ‘logout’ in ssh/bash). this isn’t what we want, so we use screen.
the name of the screen session can be used to bring the server back to your terminal by logging in via ssh or whatever and restoring the detached screen session of the server by typing
quake3@myserver> $ screen -r sessionname
to see the list of screen session for the current user, type
quake3@myserver> $ screen -list
Step 7 : Copy the Files created in steps 4, 5 and 6 to the correct locations
if you’re using the scripts shown above, you should place them in the following locations :
* q3a server configuration file (q3ded-osp.cfg) :
* q3a server maprotation file (maprotation-osp.cfg) :
* q3a server startup shell script (start-osp-server.sh) :
Step 8 : Start your Quake Server
quake3@myserver> $ cd
quake3@myserver> $ ./start-osp-server.sh
that’s it, it runs!
Step 9 : Quake Server remote Administration
q3a servers are usually administrated remotely via rcon. the rcon command of the quake 3 console lets you execute quake commands on a remote q3a server, no matter whether you are connected to it or not.
usage of rcon is protected by an rcon password that you set in the server config file.
1) start the rcon connection to your quake server
this can be done in two ways : most of the time you will simply connect to the server via quake 3 as a player — done.
if this is not possible (maybe the server is full and there are no private slots), you start quake3 on your local box and type the following command in the quake console :
/set rconaddress server_ip:server_port
2) authenticate via your rcon password
start a quake console and type :
/set rconpassword rconpassword
you can also put the password in your q3config.cfg on the client, of course.
3) execute quake commands on the server 🙂
start a quake console and type ‘/rcon’ followed by any quake server command. examples :
/rcon addbot Doom 5
/rcon players
/rcon kick camper
/rcon map pro-q3dm6
/rcon map_restart 1
Step 10 : Stopping your Quake Server
there are few reasons why you would ever want to stop your q3a server, and there’s nothing special to it. just get the pid of the correct screen process via something like
quake3@myserver> $ ps aux | grep screen | grep servername
and kill the process :
quake3@myserver> $ kill pid
servername should be the name you specified in the startup script (i.e. «osp»).
Appendix A : Where to go from here
You may want to :
* generate nice stats and show them on a website using vsp or a similar tool
* install additional mods and run multiple quake servers. this is made very easy by the scripts provided as you may already have noticed, see step 6 for more info
* setup a voice communication system like teamspeak for your clan members to use
* setup cron to purge your quake console logs on a regular basis
Appendix B : Setting up a Defrag Server
To set up a defrag server where you can interact with other players to perform team trickjumps, you need to add some defrag specific settings to your config. I put these lines in my defrag server config file :
// make sure punkbuster is turned off — it’s completely useless in defrag
// Turning off punkbuster on your Quake 3 Server:
// Note that you need to turn punkbuster off on the command line when you start the server (q3ded +set sv_punkbuster 0 . ),
// because you can’t change the setting anymore once the server process has started!
//set sv_punkbuster «0»
// set gamemode to multiplayer
seta df_gametype «6»
// allow more than 1 connection
seta sv_maxClients «6»
// allow players to interact (i.e. hit each others with weapons, jump on ach other etc)
seta df_mp_interferenceOff «0»
// movement should not depend on frames per second on the client
seta pmove_fixed «1»
// set server fps
seta sv_fps «125»
// set movement to vq3 (set to «1» for CPM physics)
seta df_promode «0»
// get rid off items, we have all weapons anyway
seta df_ndm_itemsSpawn «0»
Appendix C : Quake 3 Servers behind firewalls and NAT / home routers
People who want to connect to your server to play require access to the Quake 3 Server port range on your machine. If you setup a server from within quake 3 using the in-game menu, the port 27960 will be used. If you setup your server as described in this document and/or have multiple servers running, you had to choose a port for every quake server you are running. If you are running 3 servers, you may have picked ports 27960, 27961 and 27962. All ports are UDP, not TCP.
If you are running a quake server on a linux server that is using the IPTABLES firewall, you should add a rule to allow the quake ports (see above) in. You may want to do this using your webinterface or by adding a line like the following to your ruleset :
iptables -A INPUT -p udp -m udp —dport 27960:27962 -j ACCEPT
You should be done with that. The next part describes how to prepare your personal firewall and home router to run a quake server at home that allows public connections from the internet.
The configuration of your personal firewall should be quite easy, check the manual if you don’t know how to allow connections on a specific port. Most firewalls will allow you to select allowed services (like ‘HTTP / webserver, port 80-tcp’) from a list, but as Quake 3 will usually not be listed there, you’ll have to select something like ‘costum service’ and set the protocol (‘UDP’) and port (i.e. ‘27960’, see above) or port range (i.e. ‘27960:27962’) manually.
Configuring your home or DSL router isn’t very hard either, but it is necessary if you are using one because network packets from quake clients will hit the public IP of your router and thus it needs to know where to send those packets. (Recall that there may be more than one machine in your network and that this is an incoming connection, not an outgoing one where the router knows who asked for the packets.)
Login to the router — this is usually done via http by entering something like ‘http://192.168.0.1’ in the address bar of your favourite browser and supplying a username and password — and search for a configuration option named ‘Port Forwarding’ or similar that can usually be found in the NAT (Network Address Translation) settings. Enter your quake 3 server ports (see above) and forward them to the private IP address of your quake server on the local network (something like ‘192.168.0.x’, x > 1 in many cases). Note that your server should be configured to use a static IP in the Operating System.
Appendix D : Links and Sources
Parts of the information given in this tutorial is based on other Sites and Tutorials, here’s a few of them:
Источник
Установка Quake 3 сервера на Linux
Требования для сервера Quake 3
Для поднятия сервера по Quake 3 нам понадобится:
- Оригинальные файлы игры. Взять их можно с диска с игрой, с любого сервиса цифровой дистрибуции (Steam, GOG), или еще где.
- Рекомендуется не использовать оригинальные исполняемые файлы игры для поднятия сервера, а взять какие-нибудь модифицированные — например cnq3, ioquake 3, quake3e или еще какой. В данной статье в качестве примера будет использоваться quake3e (неофициальная пользовательская модификация оригинального кода). Скачать его можно по этой ссылке.
Настройка операционной системы
Если операционная система, где нужно поднять сервер по Quake 3, является 64 разрядной, а вы планируете запускать сервер для 32 разрядной системы, то необходимо выполнить следующую команду:
Которая добавит в систему поддержку исполняемых файлов архитектуры i386 (32 битной).
Далее выполняем обновление базы доступных пакетов:
Теперь устанавливаем необходимые библиотеки:
Устанавливаем программу screen для более приятного и удобного администрирования сервером:
Установка и настройка сервера
Создаем папку под сервер — например по пути /usr/local/games/quake3.
- Копируем папку baseq3, где должны быть следующие файлы:
- pak0.pk3
- pak1.pk3
- pak2.pk3
- pak3.pk3
- pak4.pk3
- pak5.pk3
- pak6.pk3
- pak7.pk3
- pak8.pk3
- В корневой директории нужен только исполняемый файл выделенного сервера — quake3e.ded (или quake3e.ded.x64).
Кроме того, если стоит задача поднять сервер по какому-либо моду — например CPMA (Challenge Promode Arena — мод, на котором проходили все турниры последних лет, является заменой OSP), то необходимо:
- Скачать дистрибутив cpma (ссылка) и его официальный маппак, который необходим для работы — ссылка;
- Копируем содержимое архива в папку с сервером — папки baseq3 и cpma.
Теперь можно запустить сервер:
Краткое описание того, что понаписано в параметрах запуска выше:
screen -m -A -S quake3_27960 — запускаем screen сессию, с именем quake3_27960. Теперь при рабочем сервере мы всегда можем на неё зайти, и посмотреть, что там происходит.
Делается это следующей командой
Выйти из сессии screen без её закрытия можно клавишами ctrl + A + D .
set dedicated 2 — запускает сервер в выделенном режиме;
net_ip — задает ip адрес, который будет использоваться для работы сервера;
net_port — задает используемый сервером порт;
fs_basepath — указывает папку в которой лежат файлы игры;
fs_homepath — указывает директорию, которая будет использоваться запущенным сервером для хранения логов или конфигов — очень удобно, если планируется запускать несколько серверов с одного исполняемого файла;
fs_cdpath — аналогична fs_basepath;
fs_game — указывает папку с используемым модом (если не планируется использование мода, то данная команда не нужна);
vm_game 2 — команда, которая необходима для корректной работы сервера cpma;
sv_maxclients 16 — максимальное количество клиентов на сервере;
map cpm22 — запускаемая карта по умолчанию, можно изменить на любую другую.
Если нужно запустить два сервера, то строка запуска должна выглядеть следующим образом:
Источник