Installing and Running MTASA Server on GNU Linux

From Multi Theft Auto: Wiki
Revision as of 16:37, 27 February 2016 by Mohamed Hammad (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Installation 32 bit

Main binary

Download the latest stable 32 bit Linux binaries:

wget http://linux.mtasa.com/dl/160/multitheftauto_linux-1.6.0.tar.gz

Unpack into a directory:

tar -xf multitheftauto_linux-1.6.0.tar.gz

Default config

Download the default config files:

wget http://linux.mtasa.com/dl/160/baseconfig-1.6.0.tar.gz

Unpack and move into the deathmatch directory:
(Note: Only do this for new installations as it will overwrite any existing config files.)

tar -xf baseconfig-1.6.0.tar.gz
mv baseconfig/* multitheftauto_linux-1.6.0/mods/deathmatch

Change to the MTA server install directory:

cd multitheftauto_linux-1.6.0

Test

You can now test if the server will start correctly:

./mta-server

Default resources

If you need the default resources: Download the latest default resources zip from http://mirror.mtasa.com/mtasa/resources/ and unzip into mods/deathmatch/resources
Make sure you are in the MTA server install directory when following this example:

 apt-get install unzip
 mkdir mods/deathmatch/resources
 cd mods/deathmatch/resources
 wget http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip
 unzip mtasa-resources-latest.zip
 rm mtasa-resources-latest.zip

Installation 64 bit

Main binary

Download the latest stable 64 bit Linux binaries:

rm multitheftauto_linux_x64-1.6.0.tar.gz
wget http://linux.mtasa.com/dl/160/multitheftauto_linux_x64-1.6.0.tar.gz

Unpack into a directory:

tar -xf multitheftauto_linux_x64-1.6.0.tar.gz

Default config

Download the default config files:

rm baseconfig-1.6.0.tar.gz
wget http://linux.mtasa.com/dl/160/baseconfig-1.6.0.tar.gz

Unpack and move into the deathmatch directory:
(Note: Only do this for new installations as it will overwrite any existing config files.)

tar -xf baseconfig-1.6.0.tar.gz
mv baseconfig/* multitheftauto_linux_x64-1.6.0/mods/deathmatch

Change to the MTA server install directory:

cd multitheftauto_linux_x64-1.6.0

Test

You can now test if the server will start correctly:

./mta-server64

Default resources

If you need the default resources: Download the latest default resources zip from http://mirror.mtasa.com/mtasa/resources/ and unzip into mods/deathmatch/resources
Make sure you are in the MTA server install directory when following this example:

apt-get install unzip
mkdir mods/deathmatch/resources
cd mods/deathmatch/resources
wget http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip
unzip mtasa-resources-latest.zip
rm mtasa-resources-latest.zip

Running with 32 or 64 bit Linux

Make sure your server libraries and stuff are up to date

On Debian/Ubuntu this is done with:

apt-get update
apt-get upgrade

Troubleshooting

  • If you get a problem with such as "libreadline.so.5: cannot open shared object file: No such file or directory.", it can be solved on 32 bit Debian/Ubuntu by doing this:
apt-get install libreadline5
  • If you get a problem with such as "libncursesw.so.5 cannot open shared object file: No such file or directory", it can be solved on 32 bit Debian/Ubuntu by doing this:
apt-get install libncursesw5

MySQL Troubleshooting

  • If you are using the inbuilt MySQL functions such as dbConnect and dbQuery, you will need to have libmysqlclient.so.16 installed.
  • If you get a problem with such as "libmysqlclient.so.16: cannot open shared object file: No such file or directory", it can be solved on Debian/Ubuntu by doing this:
apt-get install libmysqlclient16

If that fails:

[Optional] Installing and Configuring an External Web Server

Instructions on how to install and configure Nginx as an external web server for MTA is here: Installing and Configuring Nginx as an External Web Server

Server crashes

If your Linux server crashes, please obtain a backtrace and post a report on our Bug tracker

To obtain a backtrace:

Do you have a core dump file in the the MTA server directory?

It's usually called 'core', and usually over 100MB, and looks something like this:

Core.png

If you have a core dump file in the the MTA server directory:

  • Install gdb. To install gdb on Debian, use this command:
apt-get install gdb
  • And from the MTA install directory do this command
gdb mta-server -c core
  • When gdb launches, do this command to get a module list:
i sh
  • And then this command to get a backtrace:
bt
  • Save the output
  • (To exit gdb, use the quit command)

If you do not have a core dump file in the the MTA server directory:

  • Install gdb. To install gdb on Debian, use this command:
apt-get install gdb
  • And from the MTA server directory start the mta-server like this:
gdb mta-server -ex "set print thread-events off" --eval-command run
  • Now wait for a crash. (Ignore any weird screen output in the meantime)
  • When a crash occurs, do this command to get a module list:
i sh
  • And then this command to get a backtrace:
bt
  • Save the output
  • (To exit gdb, use the quit command)


Server freezes

If your Linux server freezes, please obtain a backtrace with thread information and post a report on our Bug tracker

To obtain a backtrace with thread information:

  • Install gdb. To install gdb on Debian, use this command:
apt-get install gdb
  • And from the MTA server directory start the mta-server like this:
gdb mta-server -ex "set print thread-events off" --eval-command run
  • Now wait for a freeze. (Ignore any weird screen output in the meantime)
  • When a freeze occurs, press ctrl-c to start gdb
  • Then do this command to get a module list:
i sh
  • And then this command to get a backtrace:
bt
  • And then this command to get thread information:
info threads
  • Save the output
  • (To exit gdb, use the quit command)