Jump to content

How to install the MTASA server on Debian 6.0 & 7.0 32/64bit


Recommended Posts

  • MTA Team

How to install the MTA:SA Linux server on Debian 6.0 (squeeze) and 7.0 (wheezy) on both 32 and 64bit flavours

Here is the tutorial for installing MTA:SA linux server on a freshly installed Debian 6.0 (also named squeeze) or Debian 7.0 (wheezy). This tutorial covers both the 32bit and the 64bit flavours of these Debian OSes.

Note: this tutorial is based on a MTA:SA 1.3.1 / 1.3.2 server, but it should be fine for future versions as well. Just edit the version numbers accordingly and use correct URLs for newer files.

Requirements

In order to install MTA:SA linux server, you need to have a Debian 6.0 or 7.0 linux machine with shell access (ssh). It does not matter whether it is physical or virtual, however a physical dedicated server is recommended for performance.

Minimal hardware server requirements:

* Intel/AMD (x86-compatible) CPU with at least 1.0GHz of core speed

* at least 192MB of RAM

* at least 200MB of free disk space

* an active network connection with all the needed ports opened - server can be set up to run on LAN or on the Internet

You will also need a root access for installing system packages. If you do not have it, you can ask your server administrator to install the packages for you - that should be fine as well as it is just a one-time action.

Lastly, you should have some basic knowledge of the Linux operating system in order to install and use your MTA:SA server on Linux. I will explain most of the commands in shell code comments - #comment, but I assume that you already know how to perform simple file operations (such as copying, renaming, deleting or editting files) on a Linux shell prompt.

1. How to find out which OS flavour you have

Simply log in to your shell account, then type this command in the shell prompt:

uname -a; #show operating system information 
cat /etc/debian_version; #show Debian version number 

If you have a 32-bit Debian 6.0, this is what you will get:

Linux your-hostname 2.6.32-5-686 #1 SMP Mon Feb 25 01:04:36 UTC 2013 i686 GNU/Linux

6.0.6

However if you have a 64-bit Debian 6.0, you will get this:

Linux your-hostname 2.6.32-5-amd64 #1 SMP Mon Feb 25 00:26:11 UTC 2013 x86_64 GNU/Linux

6.0.6

It looks a bit different for Debian 7.0:

32bit:

Linux your-hostname 3.2.0-4-686-pae #1 SMP Debian 3.2.41-2 i686 GNU/Linux

7.0

64bit:

Linux your-hostname 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux

7.0

In summary, if you get i686 in a uname -a reply, it means you have a 32bit Debian, and if you get x86_64 - it means it is a 64-bit Debian. If you receive a different reply (like armel, mips or other) , you can not run the mtasa server.

2. Installing the required software packages

Okay, now that you know what OS version and flavour you have, you have to install the needed system packages to your Debian. You can find the instructions for each version below.

a) Debian 6.0 "squeeze"

The steps are the same for both flavours.

32-bit - list of required packages

zip unzip libreadline5 screen

64-bit - list of required packages

zip unzip ia32-libs lib32ncursesw5 lib32readline5 screen

You need to have root permissions to do the following commands. Use the right list as shown above instead of LIST_OF_PACKAGES (if you have a 32bit Debian, you only install the packages listed for 32bit; if you have 64bit Debian, you only install the packages list for 64bit):

  
apt-get update; #first, lets update the list of packages 
apt-get upgrade; #upgrade the currently installed packages if needed; type Y when asked 
apt-get -y install LIST_OF_PACKAGES; #install the required packages for your flavour 
  

b) Debian 7.0 "wheezy"

The steps are different for 32 bit and 64 bit flavours:

* 32bit - list of required packages

zip unzip libreadline5 screen

You need to have root permissions to do the following commands. Use the list shown above instead of LIST_OF_PACKAGES:

  
apt-get update; #first, lets update the list of packages 
apt-get upgrade; #upgrade the currently installed packages if needed; type Y when asked 
apt-get -y install LIST_OF_PACKAGES; #install the required packages 
  

--------------------

* 64-bit - list of required packages

zip unzip ia32-libs lib32ncursesw5 lib32readline5 screen

You need to have root permissions to do the following commands. Use the list shown above instead of LIST_OF_PACKAGES:

  
apt-get update; #first, lets update the list of packages 
apt-get upgrade; #upgrade the currently installed packages if needed; type Y when asked 
dpkg --add-architecture i386; #add the i386 architecture so the ia32-libs package can be installed 
apt-get update; #update the list of packages so the ia32-libs package is included in the list 
apt-get -y install LIST_OF_PACKAGES; #install the required packages 
  

(eg. 'apt-get -y install zip unzip ia32-libs lib32ncursesw5 lib32readline5 screen' for 32bit debian.)

Additional packages might be needed for the third party server modules. Should you want to use one, please consult the documentation for such module to find out which packages are required.

3. Installing the MTA:SA server

You are now ready to install the MTA:SA server application to your machine. Go to your home directory and download the server files.

You can find the most up-to-date needed files here:

http://linux.multitheftauto.com/ (linux server, config files and resources)

Make sure to modify the version numbers and URLs!

cd ~; #go to your home directory 
mkdir mtasa; #create a directory for the mtasa server 
cd mtasa; #go to the newly created directory 
  
#-INSERT CORRECT URLs HERE- 
wget -O mtasa-linux-server.tar.gz [url=http://linux.multitheftauto.com/dl/132/multitheftauto_linux-1.3.2.tar.gz;]http://linux.multitheftauto.com/dl/132/multithef ... .2.tar.gz;[/url] #download the main MTA:SA linux server archive and save it as mtasa-linux-server.tar.gz 
wget [url=http://linux.multitheftauto.com/dl/132/baseconfig.tar.gz;]http://linux.multitheftauto.com/dl/132/baseconfig.tar.gz;[/url] #download the server config files 
wget -O mtasa-resources.zip [url=http://mtasa-resources.googlecode.com/files/mtasa-resources-r926.zip;]http://mtasa-resources.googlecode.com/f ... -r926.zip;[/url] #download the server resources archive and save it as mtasa-resources.zip 
#----------------------------------- 
  
tar -zxf mtasa-linux-server.tar.gz; #uncompress the MTA:SA server archive 
mv multitheftauto_linux-1.3.2 mtasa-server; #renames the server directory 
unzip -q mtasa-resources.zip -d mtasa-server/mods/deathmatch/resources/; #uncompress the server resources to the correct MTA:SA server directory 
  
  
tar -zxf baseconfig.tar.gz; #uncompress default server configuration files 
mv baseconfig/* mtasa-server/mods/deathmatch; #move default server configuration files to the correct MTA:SA server directory 
rmdir baseconfig; #remove a now empty directory 
rm baseconfig.tar.gz mtasa-resources.zip mtasa-linux-server.tar.gz; #removes the installation files - they are not needed anymore 
  

4. Configuring the server

You should configure the server before you run it. Go to your home directory ( ~/ ), then go to mtasa/mtasa-server/mods/deathmatch directory.

If you are unsure how to do it, you can use the description below:

  
cd ~; #go to your home directory 
cd mtasa/mtasa-server/mods/deathmatch; #go to the newly created directory 
nano mtaserver.conf; #start the NANO text editor and load the mtaserver.conf file 
  

nano-editor.png

Now make some changes to the file (eg. change the server name), then save it by holding the Control key, then pressing the O key. You will be asked for a filename - just press the Enter key to overwrite the file. However, if you made a mistake and do not want to save the file, hold the Control key and press C key, then hold Control key, press X key, and then N key. You can start over by launching the nano editor again as above.

Once you have configured the server, you are ready to start it.

5. Running the server

  
cd ~; #go to your home directory 
cd mtasa/mtasa-server/; #go to the mtasa server directory 
./mta-server; #start the server 
  

If it works okay, it will look like this:

server-started.png

(the text 'Server started and is ready to accept connections' will be shown in the console)

Alright, now if you disconnect from the shell, your server will be stopped as well.

If you want to keep your server to be running when you log out from your shell, you need to stop it now by typing 'quit' in the server console (or by pressing Control key, then C / Ctrl+C). Start it instead by using this:

  
cd ~; #go to your home directory 
cd mtasa/mtasa-server/; #go to the mtasa server directory 
screen -dmS mtasa ./mta-server; #start the server using the SCREEN application - screen name: mtasa, start screen in background 
  

This will make the server start in the background. If you need to open the server console, you can do that by using this command:

  
screen -r PROCESS_ID #reattaches to the specified screen session 
  

To find out the screen process id, you can use screen -ls command:

screen-listing.png

(if there is just one screen running, you can reattach to it by just using the screen -r command)

If you need to put your server to keep running in the background again, you can detach from your screen session by using the Ctrl+A+D hotkey, or just by closing PuTTY.

To stop the server, reattach to your screen session and type 'quit' in the server console (might want to repeat it few times if it does not work), then type 'exit' in the screen session console.

If the server has crashed, you need to stop the screen session the server is running in. Use the screen -ls command to find the process id of the session, then use the kill PROCESS_ID to stop it (or kill -9 PROCESS_ID if it did not stop it).

6. Finished!

That is all. Your MTA:SA server is all set up and running properly. Please make sure you read the general Server Manual wiki article to understand how the server works and how to use it.

serverbrowser-th.jpg

connected-th.jpg

server-players.png

Link to comment
  • 11 months later...

Another way for keeping it in background after logging out is to use tmux.

Use "tmux" to create a new session. Use "tmux attach" for further connections. Use "ctrl+b" and then "d" to detach from the session, use "ctrl+b" and then "c" to create a new one. Switch between them with "ctrl+b" and then 0-9 keys. Imo it's more useful than having over 5-10 screen sessions at the same time cause it's just a nightmare to switch between then. I've been using both for a long time and tmux is the best choice for me. It can be installed with "apt-get install tmux"

Link to comment
  • 4 months later...
  • 1 year later...
  • 4 weeks later...
  • MTA Team

Try doing the steps for Debian 7.0/Wheezy. Also, instead of using MTASA 1.3.x, just use 1.5 or 1.5.0. Should hopefully work.

Either way, I will try to update this tutorial for Debian 8/Jessie & MTASA 1.5 soon.

Link to comment
  • 1 year later...
  • MTA Team

Made a script for auto handling this on Debian x64 based systems. In you SSH console you should first execute this:

sudo wget -O mta-install.sh http://mta.ggcommunity.net/scripts/mta-install.sh && sudo chmod +x mta-install.sh

And then run this:

sudo ./mta-install.sh

After doing this you should have a server up and running. To see the console use:

screen -r mtaserver

To exit console without shutdown do this combination of keys:

CTRL + A + D

Remember to edit ACL.XML and MTASERVER.CONF with the server off to your needs.

Note: I'll try to keep this script updated and improved but i don't guarantee this.

Edited by .:CiBeR:.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...