• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Written How to compile trinity on linux ubuntu - With pictures

Ghostcrawler336

Epic Member
How to compile Trinity Core on Ubuntu

Hello everyone, I see you are interested in learning how to compile and setup the latest trinity core on Ubuntu 14.04. In this tutorial I will teach you step by step, on how to compile and setup your server!

Sections:
  1. Required Programs
  2. Updating your server (host).
  3. Installment of your development tools.
  4. Pulling the latest Trinity Core source
  5. Creating your build directory
  6. Configuring for compiling
  7. Compiling Trinity Core
  8. Making server public
  9. How to import your databases though SSH.
  10. Setting up a automatic restarter for your world server
  11. How to start your server

Required Programs
Click the names, for the links.
  • Putty - Putty is a terminal emulator which will allow you to connect to your server though a secure SSH connection.
I will assume you know how to log into your server already.


Updating your Ubuntu host to get it ready:
When you first log into your Ubuntu server, you will need to run the following command(s) to update and upgrade your server. This will save you from having any problems installing the required development tools later on in this tutorial.
Code:
apt-get update && apt-get upgrade


Installment of your development tools:

Now you are ready to install the development tools. Run the following commands and wait for them to install.
Code:
sudo apt-get install build-essential autoconf libtool gcc g++ make cmake git-core wget p7zip-full libncurses5-dev zlib1g-dev libbz2-dev
Code:
sudo apt-get install openssl libssl-dev mysql-server mysql-client libmysqlclient-dev libmysql++-dev libreadline6-dev
Code:
sudo apt-get install libboost-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-iostreams-dev

The following command is only if you're trying to compile 4.3.4 or 6.x only.
Code:
sudo apt-get install libzmq-dev

Pulling Trinity Core onto your server

Now that you have all your development tools installed, you are ready to pull the latest Trinity Core, and compile the source.

Pulling the latest Trinity Core source

  1. cd /home
  2. git clone https://github.com/TrinityCore/TrinityCore.git
  3. cd TrinityCore
  4. git checkout 3.3.5

Run the following command, to enter your Trinity Core folder you just pulled.
Code:
cd Trinitycore

Creating your build directory
To avoid issues with updates and colliding source builds, we create a specific build-directory, so we avoid any possible issues due to that (if any might occur)

Code:
mkdir build
cd build

Configuring for compiling
You are now ready to configure your cmake to compile. Run the following command.

Code:
cmake ../ -DPREFIX=/home/`echo $USER`/server

Compiling Trinity Core:
Now that you have configured your cmake, you are now ready to compile. Run the following command(s) to compile your core. This might take some time, depending on the how fast your server(host) is.

Single Core Server(host)
The following command(s) should only be used, if your server(host) only has a single core CPU.
Code:
make
make install

Multiply Core Server(host)
The following command(s) should only be used, if your server(host) has two or more CPU cores.

example - make -j 4 (4 being the number of cores the server has.)
Code:
make -j <number of cores>
make install

Now after awhile, the server should compile with no compiling errors. You can find your server files under cd /home/root/server

Making your server public
I see you made it to this part in my tutorial, and I'm glad I could helpful so far. In this next step I will show you how to make your server public!
This part of the tutorial is very simple and easy to follow.

If you aren't already in the correct folder, please run the following command to get there.
Code:
cd /home/root/server/etc

Okay now that you are in the right folder, run the following command(s) to remove the .dist at the end of the config files.
Code:
mv authserver.conf.dist authserver.conf
mv worldserver.conf.dist worldserver.conf
Now you are ready to change the configuration file to get your server online!

Run the following command to edit authserver.config
Code:
nano authserver.config

Use the arrow keys to go down, until you find "LoginDatabaseInfo" and change it to your mysql information. and change it to your mysql information. Once you are done changing the mysql information and any other settings you are now ready to save and exit. Push the following keys to save the file, and exit.
Code:
CTRL+O - hit enter afterwards.
CTRL+X

Editing WorldServer.Config
Run the following command to edit worldserver.config
Code:
nano worldserver.conf

Use the arrow keys to go down, until you find "LoginDatabaseInfo", "WorldDatabaseInfo", "CharacterDatabaseInfo" and change it to your mysql information. Once you are done changing the mysql information and any other settings you are now ready to save and exit. Push the following keys to save the file, and exit.

Code:
CTRL+O - hit enter afterwards.
CTRL+X

How to import your databases though SSH.
I made this part of the tutorial for those users who wish to import your database SQL files though SSH,rather then waiting for them to import though Heidisql, etc. This is honestly a much faster way.

Run the following commands to create your database in case you haven't done that already.
  1. mysql -u root -p <-- it'll ask for your root password after you run this command
  2. CREATE DATABASE IF NOT EXISTS auth;
  3. CREATE DATABASE IF NOT EXISTS characters;
  4. CREATE DATABASE IF NOT EXISTS world;

After you have ran the commands list above, exit out of the MySQL server window and run the commands listed below:

After you have created your databases, exit out of the MySQL window by hitting CTRL + C really quick. Then run the commands listed below:

  1. mysql -u root -p auth < /home/TrinityCore/sql/base/auth_database.sql
  2. mysql -u root -p auth < /home/TrinityCore/sql/base/characters_database.sql

I personally don't know if they host the world database on the git repo, or not. But you can excute the world database the same way as shown above.

Downloading and unzip the DBC, Maps, Vmaps:

This part of the tutorial will be updated shortly

Setting up a automatic restarter for your world server
Run the following command to create a new file with the name world-restarter.sh.

Code:
nano world-restarter.sh

After you have ran the command listed above, it should automically open up the new file you just made. You are now ready to copy and paste the code listed below, to setup your restarter.

Note: You can paste text into your putty window by copying it, and then right clicking inside the window.
Code:
#!/bin/bash
while :
do
./worldserver
sleep 5
done

Once you have pasted the code above, you will need to save the new file by pushing CTRL+O then hit enter since the file is already named. Followed by CTRL + X to exit the text editor. This is a rather simple restarter, but it gets the job done for new Linux users.

How to start your server
After you have compiled, setup your database, and downloaded your maps, and what not.. You are now ready to start your server, and log ingame!

Run the following command to start your Auth Server:
Code:
screen -s authserver ./authserver
To exit the screen window, push CTRL + A + D.

Run the following command to start your World Server:
Code:
screen -s worldserver ./world-restarter.sh
To exit the screen window, push CTRL + A + D.

You can reattach to the screens, by typing screen -x and then screen -x PID.worldserver.





DOWNLOADING & INSTALLING WEBMIN

Run the following command, inside your root directory. This command will download webmin.

Code:
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.660_all.deb

Run the following command to attempt to install webmin.

Code:
dpkg --install webmin_1.660_all.deb

The install will be done automatically to /usr/share/webmin, the administration username set to root and the password to your current root password. You should now be able to login to Webmin at the URL http://localhost:10000/. Or if accessing it remotely, replace localhost with your system's IP address.


When you first run the install command, it is very common to get a error. You will get these errors because you are missing some required files. Just run the following command, and it will fix it right up.

Code:
sudo apt-get install -f




Enabling remote mysql:

Now that you have webmin installed, you can access it by opening your web browser and typing in your server IP followed by port 1000 like showing below -
Code:
IP:1000

Once webmin has loaded, you should see something like this:
dhyr.png


Log into webmin using the same details provided for your Ubuntu server. Now that you have logged into webmin you should see something like:
RxG7aSo.png


You will then need to click on servers, which you can locate on the right side of your screen once logged into webmin.
8zJQzhq.png


Steps to enable remote SQL:

  1. You will then need to click on "Mysql database server" and log into your mysql database using the information you setup during the installment of your development tools.
  2. Then locate and click on "MySQL Server Configuration"
  3. Then find MySQL server listening address and change it from local host to any
  4. Save and restart mysql
 
Last edited:

Ghostcrawler336

Epic Member
I have recently updated this guide a bit, I plan to make anther one for CentOS and maybe a few different Linux OS's.

Regards,
Ghostcrawler336.
 

Yepster

Emulation Addict
I am getting this problem

fatal: could not create work tree dir 'TrinityCore'.: Permission denied

after I put in "git clone git://github.com/TrinityCore/TrinityCore.git"

Thank you.
 

Hyperion

Founder
I am getting this problem

fatal: could not create work tree dir 'TrinityCore'.: Permission denied

after I put in "git clone git://github.com/TrinityCore/TrinityCore.git"

Thank you.


Make sure you are cloning in the correct user directory as the user
 

Yepster

Emulation Addict
okay, I got through that one, now I have this error.

yepster@Yepsters-Computer:~/TrinityCore/build$ cmake ../ -DPREFIX=/home/`echo $Yepster`/server -DTOOLS=1
-- Detected 64-bit platform
-- UNIX: Using jemalloc
-- UNIX: Using default configuration directory
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- GCC: Enabled c++11 support
-- GCC: Enabled C99 support
-- GCC: SFMT enabled, SSE2 flags forced
-- Found OpenSSL library: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
-- Found OpenSSL headers: /usr/include
CMake Error at cmake/macros/FindZMQ.cmake:80 (message):
Could not find ZMQ libraries/headers! Please install ZMQ with libraries and
headers
Call Stack (most recent call first):
CMakeLists.txt:59 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeOutput.log".
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeError.log".
yepster@Yepsters-Computer:~/TrinityCore/build$ cmake ../ -DPREFIX=/home/`echo $USER`/server -DTOOLS=1
-- Detected 64-bit platform
-- UNIX: Using jemalloc
-- UNIX: Using default configuration directory
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- GCC: Enabled c++11 support
-- GCC: Enabled C99 support
-- GCC: SFMT enabled, SSE2 flags forced
-- Found OpenSSL library: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
-- Found OpenSSL headers: /usr/include
CMake Error at cmake/macros/FindZMQ.cmake:80 (message):
Could not find ZMQ libraries/headers! Please install ZMQ with libraries and
headers
Call Stack (most recent call first):
CMakeLists.txt:59 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeOutput.log".
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeError.log".
 

Hyperion

Founder
okay, I got through that one, now I have this error.

yepster@Yepsters-Computer:~/TrinityCore/build$ cmake ../ -DPREFIX=/home/`echo $Yepster`/server -DTOOLS=1
-- Detected 64-bit platform
-- UNIX: Using jemalloc
-- UNIX: Using default configuration directory
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- GCC: Enabled c++11 support
-- GCC: Enabled C99 support
-- GCC: SFMT enabled, SSE2 flags forced
-- Found OpenSSL library: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
-- Found OpenSSL headers: /usr/include
CMake Error at cmake/macros/FindZMQ.cmake:80 (message):
Could not find ZMQ libraries/headers! Please install ZMQ with libraries and
headers
Call Stack (most recent call first):
CMakeLists.txt:59 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeOutput.log".
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeError.log".
yepster@Yepsters-Computer:~/TrinityCore/build$ cmake ../ -DPREFIX=/home/`echo $USER`/server -DTOOLS=1
-- Detected 64-bit platform
-- UNIX: Using jemalloc
-- UNIX: Using default configuration directory
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- GCC: Enabled c++11 support
-- GCC: Enabled C99 support
-- GCC: SFMT enabled, SSE2 flags forced
-- Found OpenSSL library: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
-- Found OpenSSL headers: /usr/include
CMake Error at cmake/macros/FindZMQ.cmake:80 (message):
Could not find ZMQ libraries/headers! Please install ZMQ with libraries and
headers
Call Stack (most recent call first):
CMakeLists.txt:59 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeOutput.log".
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeError.log".

Your error is defined at the top, "Could not find ZMQ libraries/headers! Please install ZMQ with libraries"

Try this (as root) apt-get install libzmq3-dev
 

Yepster

Emulation Addict
neither of those 2 things worked. it seeems the bulk of this is at "CMake Error at cmake/macros/FindBoost.cmake:1115 (message):
Unable to find the requested Boost libraries.

Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
"
and then also"See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeOutput.log".
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeError.log".
"
can anyone tell me exactly what is wrong here?
 

Tommy

Founder
neither of those 2 things worked. it seeems the bulk of this is at "CMake Error at cmake/macros/FindBoost.cmake:1115 (message):
Unable to find the requested Boost libraries.

Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
"
and then also"See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeOutput.log".
See also "/home/yepster/TrinityCore/build/CMakeFiles/CMakeError.log".
"
can anyone tell me exactly what is wrong here?

Go through my tutorial: http://emudevs.com/showthread.php/3864-How-to-install-and-setup-Boost
 

Hyperion

Founder
The original error you posted was different. It seems like you got ZMQ to install then encountered another error, BOOST.
So I'm pretty sure "one of those worked" for the ZMQ error. Follow Tommy's BOOST install directions
 
Top