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!
- Required Programs
- Updating your server (host).
- Installment of your development tools.
- Pulling the latest Trinity Core source
- Creating your build directory
- Configuring for compiling
- Compiling Trinity Core
- Making server public
- How to import your databases though SSH.
- Setting up a automatic restarter for your world server
- How to start your server
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.
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.
sudo apt-get install build-essential autoconf libtool gcc g++ make cmake git-core wget p7zip-full libncurses5-dev zlib1g-dev libbz2-dev
sudo apt-get install openssl libssl-dev mysql-server mysql-client libmysqlclient-dev libmysql++-dev libreadline6-dev
The following command is only if you're trying to compile 4.3.4 or 6.x only.
sudo apt-get install libboost-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-iostreams-dev
Pulling Trinity Core onto your server
sudo apt-get install libzmq-dev
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
- cd /home
- git clone https://github.com/TrinityCore/TrinityCore.git
- cd TrinityCore
- git checkout 3.3.5
Run the following command, to enter your Trinity Core folder you just pulled.
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)
Configuring for compiling
You are now ready to configure your cmake to compile. Run the following command.
Compiling Trinity Core:
cmake ../ -DPREFIX=/home/`echo $USER`/server
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.
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.)
Now after awhile, the server should compile with no compiling errors. You can find your server files under cd /home/root/server
make -j <number of cores>
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.
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.
Now you are ready to change the configuration file to get your server online!
mv authserver.conf.dist authserver.conf
mv worldserver.conf.dist worldserver.conf
Run the following command to edit 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.
CTRL+O - hit enter afterwards.
Run the following command to edit worldserver.config
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.
How to import your databases though SSH.
CTRL+O - hit enter afterwards.
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.
- mysql -u root -p <-- it'll ask for your root password after you run this command
- CREATE DATABASE IF NOT EXISTS auth;
- CREATE DATABASE IF NOT EXISTS characters;
- 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:
- mysql -u root -p auth < /home/TrinityCore/sql/base/auth_database.sql
- 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.
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.
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:
To exit the screen window, push CTRL + A + D.
screen -s authserver ./authserver
Run the following command to start your World Server:
To exit the screen window, push CTRL + A + D.
screen -s worldserver ./world-restarter.sh
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.
Run the following command to attempt to install webmin.
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.
Enabling remote mysql:
sudo apt-get install -f
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 -
Once webmin has loaded, you should see something like this:
Log into webmin using the same details provided for your Ubuntu server. Now that you have logged into webmin you should see something like:
You will then need to click on servers, which you can locate on the right side of your screen once logged into webmin.
Steps to enable remote SQL:
- 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.
- Then locate and click on "MySQL Server Configuration"
- Then find MySQL server listening address and change it from local host to any
- Save and restart mysql