Installing and Running MTASA Server on GNU Linux: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Installation ==
== Installation ==


=== Main binary ===
=== Main binary download ===
Download the latest stable Linux binaries from here:
If you have 32 bit Linux, download the latest stable Linux binaries:
  rm multitheftauto_linux-{{Current Version|full}}.tar.gz
  wget -O mta.tar.gz <nowiki>http</nowiki>://linux.mtasa.com/dl/{{Current Version|fullnodots}}/multitheftauto_linux-{{Current Version|full}}.tar.gz
wget <nowiki>http</nowiki>://linux.mtasa.com/dl/151/multitheftauto_linux-{{Current Version|full}}.tar.gz
Or if you have 64 bit Linux:
<!--
  wget -O mta.tar.gz <nowiki>http</nowiki>://linux.mtasa.com/dl/{{Current Version|fullnodots}}/multitheftauto_linux_x64-{{Current Version|full}}.tar.gz
or if you are feeling daring, get the latest nightly build from here:
 
  wget <nowiki>http</nowiki>://nightly.mtasa.com/?multitheftauto_linux-{{Current Version|full}}-latest
=== Main binary extract ===
-->
Unpack into a directory:
Unpack into a directory:
  tar -xf multitheftauto_linux-{{Current Version|full}}.tar.gz
  tar -xf mta.tar.gz


=== Default config ===
=== Default config ===
Download the default config files:
Download the default config files:
  rm baseconfig-{{Current Version|full}}.tar.gz
  wget -O config.tar.gz <nowiki>http</nowiki>://linux.mtasa.com/dl/{{Current Version|fullnodots}}/baseconfig-{{Current Version|full}}.tar.gz
wget <nowiki>http</nowiki>://linux.mtasa.com/dl/151/baseconfig-{{Current Version|full}}.tar.gz


Unpack and move into the deathmatch directory:<br/>
Unpack and move into the deathmatch directory:<br/>
('''''Note:''' Only do this for new installations as it will overwrite any existing config files.)''
('''''Note:''' Only do this for new installations as it will overwrite any existing config files.)''
  tar -xf baseconfig-{{Current Version|full}}.tar.gz
  tar -xf config.tar.gz
  mv baseconfig/* multitheftauto_linux-{{Current Version|full}}/mods/deathmatch
  mv config/* mta/mods/deathmatch


Change to the MTA server install directory:
Change to the MTA server install directory:
  cd multitheftauto_linux-{{Current Version|full}}
  cd mta


=== Test ===
=== Test ===
Line 51: Line 49:
  apt-get upgrade
  apt-get upgrade


== Running with 32 bit Linux ==
===Troubleshooting===
===32 bit 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:
* 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:


Line 61: Line 58:
  apt-get install libncursesw5
  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:
* 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
  apt-get install libmysqlclient16


If that fails, download [http://nightly.mtasa.com/files/libmysqlclient.so.16 libmysqlclient.so.16] and put it in '''/usr/lib/'''
If that fails:
 
* For 32 bit Linux, download [http://nightly.mtasa.com/files/modules/32/libmysqlclient.so.16 32 bit libmysqlclient.so.16] and put it in '''/usr/lib/'''
== Running with 64 bit Linux ==
* For 64 bit Linux, download [http://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16 64 bit libmysqlclient.so.16] and put it in '''/usr/lib/'''
===Debian 7 (wheezy) 64 bit===
Before running MTASA Server, use this command line for installation of 32 bit libs :<br/>
 
apt-get install lib32ncursesw5 lib32readline5
 
===Install 32 bit libs for your 64 bit distro===
For 64 bit Debian 6, this is achieved with:<br/>
''(Some 64 bit distros have 32 bit libs already installed for you. So this step might not be required)''
 
apt-get install ia32-libs
 
===64 bit Troubleshooting===
====64 bit Debian/Ubuntu====
* If you get a problem with such as "libstdc++.so.6: cannot open shared object file: No such file or directory.", it can be solved on 64 bit Debian/Ubuntu by doing this:
 
apt-get install lib32stdc++6
 
* If you get a problem with such as "libz.so.1: cannot open shared object file: No such file or directory.", it can be solved on 64 bit Debian/Ubuntu by doing this:
 
apt-get install lib32z1
 
* 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 64 bit Debian/Ubuntu by doing this:
 
apt-get install lib32readline5
 
* 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 64 bit Debian/Ubuntu by doing this:
 
apt-get install lib32ncursesw5
 
* 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, download [http://nightly.mtasa.com/files/libmysqlclient.so.16 libmysqlclient.so.16] and put it in '''/usr/lib/'''
 
**NOTE: If you are running the experimental MTA x64 server, you will need [http://nightly.mtasa.com/files/x64/libmysqlclient.so.16 this file] instead:
 
====64 bit CentOS 6====
* If you get a problem with such as "libreadline.so.5: cannot open shared object file: No such file or directory.", edit '''''/etc/yum.conf''''' and add this line:
multilib_policy=all
Then issue this command:
yum install compat-readline5
* Further 64 bit solutions can be found [http://forum.mtasa.com/viewtopic.php?f=106&t=35328#p367282 on the forums]
 
== MySQL Troubleshooting==
* If you are using the inbuild MySQL functions such as [[dbConnect]] and [[dbQuery]], you will need to have '''libmysqlclient.so.16''' installed.
* If you can't get '''libmysqlclient.so.16''' installed by conventional means, then try [http://nightly.mtasa.com/files/libmysqlclient.so.16 downloading the file from here] and copying it to your Linux server '''/usr/lib/''' directory.
 
==Cent OS Troubleshooting==
* If you are using Cent OS and you get something like /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by xmll.so) this can be resolved by doing downloading the archive [[http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/9/Fedora/i386/os/Packages/libstdc++-4.3.0-8.i386.rpm here]] and unpacking it with the following command:
 
rpm2cpio libstdc++-4.3.0-8.i386.rpm | cpio -i --make-directories


==[Optional] Installing and Configuring an External Web Server==
==[Optional] Installing and Configuring an External Web Server==

Revision as of 22:21, 9 December 2015

Installation

Main binary download

If you have 32 bit Linux, download the latest stable Linux binaries:

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

Or if you have 64 bit Linux:

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

Main binary extract

Unpack into a directory:

tar -xf mta.tar.gz

Default config

Download the default config files:

wget -O config.tar.gz 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 config.tar.gz
mv config/* mta/mods/deathmatch

Change to the MTA server install directory:

cd mta

Test

You can now test if the server will start correctly:

./mta-server

or if using the 64 bit server:

./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
rm mtasa-resources-latest.zip
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)