World Of Warcraft TrinityCore Linux Private Server Guide

No Image

I have already posted on how you can setup and configure World of Warcraft Private Server Using Trinity Server Emulator on Windows. If you want something more stable then Windows then you need to setup World of Warcraft server on Linux. It is very complex for a newbie to setup a World of Warcraft server on Linux so it is recommended that you follow World of Warcraft Private Server Guide for Windows, if you don’t have any prior knowledge of Linux operating system.

How to Install TrinityCore on Linux

TrinityCore is a rather complex and demanding software, and as such it may seem quite daunting to install and maintain.
This how to guide will attempt to help you with installing World of Warcraft Private Server on Linux, and also show how this can be done in a way that also guide you with the basics of how Linux compilations works.

I advice you to read your distributions documentation on how to install packages, and also have at least knowledge of how it works with regards to adding users.

Most of this is based on the use of a Debian-based distribution, though we’ll try to inform as best as we can when something differs totally.


Getting Started

I advice you to run/install TrinityCore on a dedicated machine, or a machine that you know you have full control over.
It is recommended that you DO NOT install the software on a shared server solution or any server where other users may have access or might require resources to be available at all times.

Requirements to Install TrinityCore on Linux
This list gives an absolute minimum of packages required to work with a basic install of  TrinityCore, and is in no way meant as “the ultimate solution of packages”.

Please read the distribution documentation or other guides on other packages / solutions that you might want installed, for example LAMP (Linux w/Apache, MySQL and PHP).

Debian-based distributions
sudo apt-get install build-essential autoconf libtool gcc g++ make cmake subversion mercurial patch wget links zip unzip unrar
sudo apt-get install openssl libssl-dev mysql-server mysql-client libmysqlclient15-dev libmysql++-dev libreadline5-dev zlib1g-dev libbz2-dev

RedHat-based distributions
Redhat-based distributions does not (as far as we know) include CMake by default, and requires extra repositories to be enabled.
Please refer to the distributions archive and/or secondary repositories (ex. RPMForge)
Installation of the packages mentioned underneath will require either root-privileges, or the use of sudo prepended to the respective commands.
yum groupinstall "development tools"
yum groupinstall "development libraries"
yum install gcc-g++ mercurial wget links zip unzip unrar
yum install mysql-server mysql-client mysql-devel
yum install openssl

Not included in default package-repositories (as mentioned above)
yum install cmake

Creating a user to work with
Start with logging in to your Linux-machine and create an account for the server itself – on most recent distributions this can easily be done with the following command :
sudo adduser <username>
Note : Change <username> into the preferred username of your server-account – we will as far as possible avoid using specific usernames in this guide.

Installing ACE (Adaptive Communication Environment)
TrinityCore requires a specific communication-library for inter-process communication, and as such needs special attention on that matter.
Due to that most distributions (even the most recent ones) does not supply the version required by TrinityCore as part of their basepackages by default.
To start the installation, log in to your previously created user :
su - <username>
cd ~/

Replace <username> with the username you chose when creating the account.

Downloading and unpacking the ACE-library
wget http://download.dre.vanderbilt.edu/previous_versions/ACE-5.7.8.tar.gz
tar xvzf ACE-5.7.8.tar.gz
cd ~/ACE_wrappers/ mkdir build
cd build

Configuring, compiling and installing ACE
IMPORTANT : If you are the owner of the machine, and at this stage want the ACE-library to be available for other users on your Linux-machine (and also making it easier for yourself at later stages), please follow alternative 2.

Alternative 1 : Local installation
../configure --prefix=/home/<username>/.sys/
make
make install

Again, replace <username> with the username you chose when creating the account.

Alternative 2 : Systemwide installation
../configure
make
sudo make install

As stated above, alternative 2 will build the library as a user without any specific privileges, and then install it into /usr/local as root (the superuser), reachable for other users that wish to use it for their own projects.It is safe safe to allow this library to be installed system wide.

Installing libMPQ (MoPaQ) MPQ-reader library

Configuring, compiling and installing libMPQ
IMPORTANT : If you are the owner of the machine, and at this stage want the MPQ-library to be available for other users on your Linux-machine (and also making it easier for yourself at later stages), please follow alternative 2
Change directory to <your-sourcedir>/externals/libmpq/ before doing this

Alternative 1 : Local installation
./autogen.sh
./configure --prefix=/home/<username>/.sys/
make
make install

Again, replace <username> with the username you chose when creating the account.

Alternative 2 : Systemwide installation
./autogen.sh
./configure
make sudo
make install

As stated above, alternative 2 will build the library as a user without any specific privileges, and then install it into /usr/local as root (the superuser), reachable for other users that wish to use it for their own projects.It is safe safe to allow this library to be installed system wide.

Installing OpenSSL (as known as libSSL)
The procedure described here has been created on a time that the version 0.9.8n was the newest one, it should also work on newer ones.
So if you want a newer (or maybe older) version check ftp://ftp.debian.org/debian/pool/main/o/openssl/

32-bit Debian-based distributions

wget ftp://ftp.debian.org/debian/pool/main/o/openssl/libssl-dev_0.9.8n-1_i386.deb
wget ftp://ftp.debian.org/debian/pool/main/o/openssl/libssl0.9.8_0.9.8n-1_i386.deb
wget ftp://ftp.debian.org/debian/pool/main/o/openssl/openssl_0.9.8n-1_i386.deb

sudo dpkg -i libssl-dev_0.9.8n-1_i386.deb
sudo dpkg -i libssl0.9.8_0.9.8n-1_i386.deb
sudo dpkg -i openssl_0.9.8n-1_i386.deb

64-bit Debian-based distributions

wget ftp://ftp.debian.org/debian/pool/main/o/openssl/libssl-dev_0.9.8n-1_amd64.deb
wget ftp://ftp.debian.org/debian/pool/main/o/openssl/libssl0.9.8_0.9.8n-1_amd64.deb
wget ftp://ftp.debian.org/debian/pool/main/o/openssl/openssl_0.9.8n-1_amd64.deb

sudo dpkg -i libssl-dev_0.9.8n-1_amd64.deb
sudo dpkg -i libssl0.9.8_0.9.8n-1_amd64.deb
sudo dpkg -i openssl_0.9.8n-1_amd64.deb

Other distributions
For cases where you want to run an even newer release of OpenSSL than mentioned here, or your distribution not supplying a version that isn’t of recent date, please check your distributions repositories or documentation.
You can also retrieve it as sourcecode at http://openssl.org/source (feel free to use newer packages if you really feel like it). To build it from source code, here’s a primer :

wget http://openssl.org/source/openssl-0.9.8n.tar.gz

tar -xvf openssl-0.9.8n.tar.gz
cd openssl-0.9.8n

Alternative 1 : Local installation
./config --prefix=/home/<username>/.sys shared
make
make install

Replace <username> with the username you chose when creating the account.

Alternative 2 : Systemwide installation
./config shared
make
sudo make install

Please note that any old revision of the OpenSSL package installed by the distribution may/will interfere with the new version. See your distribution documentation for information on how to remove it to be able to use the new one.

If you have done the systemwide install, you will no longer need any extra parameters for SSL when compiling TrinityCore.

Optional software
These tools are only needed or useful if you are connecting from a Windows host to your Linux machine
Graphical database-viewing/editing
HeidiSQL
SQLyog
Please note that the software called Navicat is NOT supported due to issues with how it handles SQL-files with “/* */”-style comments. It is advised that you stay well clear of this program unless you really are looking for issues.

Remote console connects to the server
Putty
Putty Tray

Filetransfer through SFTP or FTP
WinSCP

Building the server itself

Getting the sourcecode
cd ~/
hg clone http://trinitycore.googlecode.com/hg/ trinitycore

A directory trinitycore will be created automatically and all the source files will be stored in there.

Compiling the Source Code

Creating the build-directory
To avoid issues with updates and colliding sourcebuilds, we create a specific build-directory, so we avoid any possible issues due to that (if any might occur)
mkdir build
cd build

To configure the core, we use space-separated parameters attached to the configuration-tool (cmake) – do read the entire section before even starting on the configuration-part.
This is for your own good, and you HAVE been warned. A full example will also be shown underneath the explanations.
cmake ../trinitycore/ [additional parameters]

Parameter explanations

-DPREFIX=<path to install core and tools> (path where your compiled core/tools and libraries will be stored/installed to)
-DACE_LIBRARY=<path to ACE library> (path to your libACE.so file – do not use if you have ACE installed systemwide)
-DACE_INCLUDE_DIR=<path to ACE includes/headers> (path to the libACE include directory – do not use if you have ACE installed systemwide)
-DOPENSSL_LIBRARIES=<path to OpenSSL libraries> (path to your OpenSSL libraries directory – do not use if you have OpenSSL installed systemwide)
-DOPENSSL_INCLUDE_DIR=<path to OpenSSL includes> (path to your OpenSSL includes directory – do not use if you have OpenSSL installed systemwide)

-DDO_SCRIPTS=1 (compile core with scripts * )
-DDO_TOOLS=1 (compile core with extractiontools for maps and vmaps)
-DDO_CLI=1 (compile core with command line interface support * )
-DDO_RA=1 (compile core with remote access console support)
-DDO_SQL=1 (copy sql files to target directory when installing)
-DCENTOS=1 (use this for Centos/RH/Fedora and RedHat-based distributions)

Note : * means “used by default”, and does not need to be set.
The above parameters when combined into a full example :
cmake ../trinitycore/ -DPREFIX=/home/<username>/server -DDO_RA=1 -DDO_SQL=1

The above will turn on the remote console access system, and install the SQL-files into the server-directory under the /home/<username>/server/shared/trinity/sql/ directory.
Note that you WILL have to configure the server well if you ever want to use the RA-access functionality.
Note: New users are advised NOT to use the RA-feature without understanding the security-implications involved!

Building the core
After configuring and checking that everything is in order (read cmakes output), you can build Trinity (this will take some time unless you are on a rather fast machine)
make
make install

If you have multiple CPU cores, you can enable the use of those during compile :
make -j <number of cores>
make install

After compiling and installing, you will find your core binaries in /home/<username>/server/bin, and the standard configuration files in the /home/<username>/server/etc folder.
(As usual, replace <username> with the username you created earlier). Now you can continue reading on and learn how how to update the sourcetree.

Keeping the code up to date
TrinityCore developers are always at work fixing and adding new features to the core. You can always check them here.(Link http://code.google.com/p/trinitycore/source/list) To update the core files, do the following :
cd ~/trinitycore/
hg pull -u

Now return to the compilation-section again, and repeat the instructions there.

Installing the databases

Fetching the databases
Simply type in the users homedirectory the following :
hg clone http://trinitydb.googlecode.com/hg/ trinitydb
A folder trinitydb will be created and all files will be stored in there.

About the MySQL server installation

When configuring MySQL make sure you remember the password you set for the default root account and that you enabled both MyISAM and InnoDB engines. You can leave all the other settings as default.
You might want to enable remote access to your MySQL server if your are also testing a website for your Trinity server or if you have friends testing with you which need access from remote locations.
Remember that this will decrease the security of your MySQL server in general, and is not adviced without prior knowledge on how to secure it.

Installing the Trinity DataBase Project (TDB) Database
NOTE: This guide is only for a fresh and new installation of TDB, so do not follow this if you already have a working database. You have been warned, all database content will disappear if you do.
A short primer on what the databases do
Trinity needs three databases to run:
realmd
(contains realm- and account-data (logins/passwords and accesslevels ++)
characters
(contains characterdata and certain worldstates)
world
(contains gamecontent such as spawns, quests, stats, quests, etc.)

Installing the databases
The first two are taken from the core installation directory, while the world database is taken from the TDB directory.
Create the three databases by importing /home/<username>/server/sql/create_mysql.sql – you now have three databases called realmd, characters and world.
Import realmd database structure by importing /home/<username>/trinitycore/sql/realmd.sql
Import characters database structure by importing /home/<username>/trinitycore/sql/characters.sql
Unzip /home/<username>/trinitydb/fulldb/TDB_333.9.29_7925.zip and import world DB structure and contents by importing TDB_333.9.29_7925.sql in the world DB.
Import in the world DB the following files in this precise order:

/home/<username>/trinitydb/updates/333.9/30_01_corepatch_world_7925_8307.sql
/home/<username>/trinitydb/updates/333.9/30_02_procedures_world.sql
/home/<username>/trinitydb/updates/333.9/30_03_updatepack_world.sql

Import all *.sql update files from /home/<username>/trinitycore/sql/updates/ which start with a number above ’8307′ so that your DB structure is up to date with the revision you just pulled and compiled.

Also note that we STILL use the generic <username> extension here, use the username you created for the server earlier!

Now your world database-structure is for TrinityCore revision 8307. You need to import the update files to have the proper world/characters/realmd database-structures for the revision you just pulled and compiled.

You will notice they are all named XXXX_world_tablename.sql or XXXX_characters_tablename.sql or XXXX_realmd_tablename.sql – make sure to import these into the correct database.

XXXX_world_tablename.sql —> world database
XXXX_characters_tablename.sql —> characters database
XXXX_realmd_tablename.sql —> realmd database

Keeping the database up to date
TDB developers are always at work fixing and adding new data to the database, but unlike core development, database updatepacks come more on a 1-2 times a month basis with many fixes from here and a lot of new data from developers and contributors.
We’ll use the same procedure as for updating core, just on the databasefiles instead.
cd ~/trinitydb
hg pull -u

Setting up the server
Now that you have the source compiled and the databases installed, you need to set up the server.

Extracting dbc, maps and vmaps files
In order to run, TrinityCore needs dbc- and map-files. In addition, if you want to enable vmaps (Making NPCs unable to see through walls etc.) you will need to extract them as well.
Warning: use Trinity’s extractors. If you use extractors from other projects it is almost certain that your Trinity Core will not recognize the extracted data!

To get the Trinity extractors you have to build the project with option -DDO_TOOLS=1 (#Parameter explanations).

dbc and maps files
cd <your WoW client directory>
/home/<username>/server/bin/mapextractor
cp -r dbc maps /home/<username>/server/data

Visual Maps (aka vmaps – optional)
You can also extract vmaps which will take quite a while depending on your machine (1-2 hours).
cd <your WoW client directory>
/home/<username>/server/bin/vmap3extractor
mkdir vmaps
/home/<username>/server/bin/vmap3assembler Buildings vmaps
cp -r vmaps /home/<username>/server/da
ta

Configuring the server
First of all you need to create 2 files : worldserver.conf and authserver.conf in your /home/<username>/server/etc/ folder.
You’ll find 2 files named worldserver.conf.dist and authserver.conf.dist. Copy these to their namesakes without the .dist extension.
cp worldserver.conf.dist worldserver.conf
cp authserver.conf.dist authserver.conf

Now you can go ahead and edit the two files (worldserver.conf and authserver.conf) to your liking, with the following notes in mind about them.

trinitycore.conf
Edit MySQL account username and password (instead of trinity;trinity).

LoginDatabaseInfo = “127.0.0.1;3306;trinity;trinity;realmd”
WorldDatabaseInfo = “127.0.0.1;3306;trinity;trinity;world”
CharacterDatabaseInfo = “127.0.0.1;3306;trinity;trinity;characters”
If you extracted vmaps then edit the following :
vmap.enableLOS = 1 <— set this to 1
vmap.enableHeight = 1 <— set this to 1
vmap.ignoreMapIds = “369″
vmap.ignoreSpellIds = “7720″
vmap.petLOS = 1 <— set this to 1

trinityrealm.conf
Edit MySQL account username and password (instead of trinity;trinity).
LoginDatabaseInfo = “127.0.0.1;3306;trinity;trinity;realmd”
You need to make sure that the authserver directs incoming connections to your realm.
In the realmd database there is a table called realmlist, where you need to edit the field address according to your needs
127.0.0.1                — Leave default localhost if you are connecting alone from the same machine TrinityCore runs on.
<Your LOCAL NETWORK ip>  — Use the machine’s LAN ip if you want other computers from the same network as the TrinityCore server to connect to your server.
<Your PUBLIC NETWORK ip> — Use your PUBLIC ip if you have friends and testers which need to connect your server from the internet.

Warning: The TrinityCore development team/owners and the TrinityDB team/owners DO NOT in any case sponsor nor support illegal public servers. If you use these projects to run an illegal public server and not for testing and learning it is your own personal choice.

Notes/Revisions

-DLARGE_CELL=0         has been deprecated and is not used at all (remove this if ever used before)
-DDO_MYSQL=1           has been deprecated and is not used at all (remove this if ever used before)
-DSSLLIB=<path>        has been deprecated and is not used at all (remove this if ever used before)
-DDO_DEBUG=0           not required, as its default is : 0
-DDO_RA=0              not required, as its default is : 0

The new method for custom SSL-libraries are
:
-DOPENSSL_LIBRARIES=<path to OpenSSL libraries directory>
-DOPENSSL_INCLUDE_DIR=<path to OpenSSL includes directory>

The paths for installation can be done without any other parameters but this :

-DPREFIX=/path/to/where/you/want/core/to/be/installed

It will create the following structure:

<path>/bin/             – binaries will be placed here
<path>/etc/             – configfiles will be placed here

Also, compile has been tested on Debian 5.0.4 x32/x64, Ubuntu 10.04 x32/x64, Centos 5.4 x32/x64 – all without problems IF YOU DO NOT MESS AROUND ON YOUR OWN!

Do NOT add your own compiled libraries on recent distributions, this is not required, and will only lead to confusion. If you face any problems in configuring World of Warcraft Private Server on Linux, let me know, I will try to help.

Disclaimer: The TrinityCore Development Team and Owners, the TrinityDB Team and Owners, SegmentNext and the writer of this article DO NOT in any case sponsor nor support illegal public servers. If you use these projects to run an illegal public server and not for testing and learning it is your own personal choice.

By Afnan Mir

We've got a lot of guides and FAQs here, and you can thank Afnan for providing many of them. It's him who does the research and assembles our FAQs before we can publish them.


Around The Network
    • Ramona

      Does running a blog like this takе а masѕivе amount ωork?

      I’ve very little understanding of programming however I had been hoping to start my own blog in the near future. Anyhow, should you have any ideas or tips for new blog owners please share. I understand this is off subject however I simply needed to ask. Kudos!

    • Tomas

      Hi, I have problem with this command:

      Change directory to /externals/libmpq/ before doing this

      I can’t find this dir, can you help me with this?

    • Kotori

      TrinityCore uses git now instead of mercurial.
      https://github.com/TrinityCore/TrinityCore