Wise
12-11-16, 11:38 PM
Credits to Psykko for this awesome guide (tumbs up)
WELCOME TO THIS TUTORIAL
brought to you by Psykko
http://img5.fotos-hochladen.net/uploads/tutorialheaderextc5f7302.jpg
______________________________________________
Greetings, i decided to publish this small tutorial for all the people without alot Linux knowledge. This Tutorial contains reading and dragons, but it also includes anything you need for a save and successful start on your Linux System. People with Knowledge can surely skip a few steps, this is written for total beginners. Following i list a register of things within this Tutorial. Should we start?
Tutorial overview:
1. Getting a Linux Machine with a free month (optional)
1.1 Gathering Software for Linux Communication
1.2 Setup Sessions
___
2. Linux System Setup
2.1 Installation of needed Packages
2.2 SSH Port
2.3 MySQL Port
2.4 Setup Git
2.5 Setup User
___
3. Setup TrinityCore
3.1 Clone the newest TrinityCore
3.2 Merge with ElunaLuaEngine (optional)
3.3 Cmake
3.4 Compiling and Installing
3.5 Configuration
3.6 Setup of iptables
___
4. Database Setup
4.1 User and Database Setup
4.2 Base Database Installation
4.3 WorldDb and Updates
4.4 Realmlist
___
5. Server Startup Prepare
5.1 Adding an Restarter
5.2 Starting Auth and World with Screen
___
6. End
______________________________________________
1. Getting a Linux Machine with a free month (optional)
Im showing you here how you can get a neat vps for small money inculsive a free month of payment.
This VPS is a great choise for starting a Server.
https://contabo.de/downloads/contabo_screen_rgb_800x300.png (https://contabo.com/?show=configurator&vserver_id=145)
Click at the Image above to spectate the VPS.
______________________________________________
1.1 Gathering Software for Linux Communication
Its up to you what kind of Program you are going to use to communicate with your VPS/Dedicated Server. In this Tutorial I will be using PuTTy and WinSCP, but i will list some other Programs too.
We are in need of an Program which allows us to open an SSH tunnel between your Computer and your VPS, therefore im using PuTTy.
And we will also need an File Transfer Protocol Program for Filetransfer between your Computer and your VPS, therefore im using WinSCP since it has many functions and a nice interface.
PuTTy - Click to Download the Installer (https://the.earth.li/~sgtatham/putty/latest/x86/putty-0.67-installer.msi)
WinSCP - Click to Download the Installer (http://winscp.net/download/winscp576setup.exe)
FileZilla - Click to Download the Installer (http://downloads.sourceforge.net/project/filezilla/FileZilla_Client/3.15.0/FileZilla_3.15.0_win64-setup.exe?r=&ts=1454315717&use_mirror=vorboss)
CyberDuck - Click to Download the Installer (https://update.cyberduck.io/windows/Cyberduck-Installer-4.7.3.exe)
BitKinex - Click to Download the Installer (http://www.bitkinex.com/ftp/client/bitkinex323.exe)
I would really suggest you to use PuTTy and WinSCP since they have a good integration with each other.
So we going to install PuTTy by starting the downloaded Installer and following the Steps.
http://puu.sh/mRCKv/9bbd8e966c.png
http://puu.sh/mRCOp/955a4f54f7.png
http://puu.sh/mRCRf/c61418f4d8.png
Now we are going to install WinSCP by starting the Installer and follow the Steps.
http://puu.sh/mRCXE/35c75acb58.png
http://puu.sh/mRCZR/6fad0bbb03.png
http://puu.sh/mRD1N/4a6b44306b.png
http://puu.sh/mRD7v/7e5980ae3d.png
Congratulation, you have successfully installed everything you need to work with your VPS!
______________________________________________
1.2 Setup Sessions
First of all, we are going to open PuTTy, you should find something like this
http://puu.sh/mRDh8/752e220d92.png
http://img5.fotos-hochladen.net/uploads/puttybixtr8ozpd.png
Fill the Informations like in the Layout above.
(following is an example of mine)
http://puu.sh/mRDF8/0ea7d268f4.png
So far PuTTy is finished.
Lets open up WinSCP and you should find something like this.
http://puu.sh/mRDOC/cd5a9ac3ac.png
http://img5.fotos-hochladen.net/uploads/winscptds6hgb78q.png
Fill the Informations like in the Layout above.
(following is an example of mine)
http://puu.sh/mRE0M/257d723238.png
http://puu.sh/mRE3Y/5cab59c710.png
Choose again a Name for the Session, i entered My VPS instead of [email protected] and mark the Save Password Button. Ok
(above is an example of mine)
You are now able to access PuTTy and WinSCP by doubleclicking the Session Name.
______________________________________________
2. Linux System Setup
We are now going to open our PuTTy Session.
(note: any first connection to a VPS causes an PuTTy Security Alert, dont get in panic, hit the Yes Button.)
After that, login with the root user to your Linux System. Take the Password from the Email/Userpanel of your Provider.
(note: the passwords never getting shown in PuTTy. You can paste into PuTTy per rightclick into the black field)
http://puu.sh/mREjc/0cd49ef750.png
http://puu.sh/mRFIh/218afe5f8c.png
We are now logged into our Linux System. Im using Debian 7 minimal 64bit for this Tutorial. Since im running 64bit, i will need to download 32bit Libaries too, so im in need of adding the 32bit architecture to the System for better integration. So we are going to enter dpkg --add-architecture i386 into PuTTy and run it.
http://puu.sh/mRG1E/45256078a5.png
After that happened, we are going to run apt-get update && apt-get upgrade into PuTTy and run it, to catch the updates for the previous set architecture
http://puu.sh/mRG9D/2d9ad21995.png
Now simply run apt-get install ia32-libs
Ubuntu Users need this:
______________________________________________
2.1 Installation of needed Packages
So far our Linux System does not contain any Software exept you are using LAMP (recommented if you are going to host a website too). We are going to install all needed Packages we need to generate, compile and install our TrinityCore containing MySQL (not git, git is getting installed seperate sooner.)
(note: skip this if you have them installed already.)
Here is a list of the needed Packages:
So we are going to run apt-get install -y sudo screen libtool gcc g++ mysql-server mysql-client libmysqlclient-dev libmysql++-dev make cmake p7zip-full libncurses5-dev zlib1g-dev libbz2-dev gdb nano openssl libssl-dev libreadline6-dev libboost-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-iostreams-dev build-essential autoconf into PuTTy and run it.
It will start reading and downloading the packages and installing them... So far you dont have an mysql-server installed,you are going to get in contact with this screen.
simply enter an password for the user "root" for MySQL
http://puu.sh/mRGAy/b858f4a5d4.png
you need to re-enter it.
http://puu.sh/mRGHT/b807ae03fc.png
______________________________________________
2.2 SSH Port
Before it comes to Compiling and all that stuff, we need to do some changes for your own security. We are going to change the SSH port which is currently 22 which is default for Linux.
We are going to enter nano /etc/ssh/sshd_config into PuTTy
(note: you can only move per cross-buttons on your keyboard in PuTTy. To enter Numbers, dont use the Numblock.)
http://puu.sh/mRGX9/d50a346381.png
Something like this should appear, we are going to change the part
Port 22 to something else, you can use any number within this range 49152-65535.
I am used to 53155.
http://puu.sh/mRH5r/43c6332c4c.png
Press CTRL+X to exit nano. Now you are getting asked to save changes.
http://puu.sh/mRHdJ/ca7f47124f.png
Enter Y to continue and again press <Enter> after that.
http://puu.sh/mRHi8/77e20b408f.png
______________________________________________
2.3 MySQL Port
After we have changed the SSH Port, we are now going to change the MySQL Port too. Default: 3306
We are going to enter nano /etc/mysql/my.cnf into PuTTy. You should find something like this:
http://puu.sh/mRHrD/2cbbe4d06d.png
http://www.fotos-hochladen.net/uploads/mysqlvp0we1rj8c.png
Change the Port from 3306 at both locations to any number within this range 49152-65535 and put a single # infront of bind-address = 127.0.01 like in the Layout above.
http://puu.sh/mRHFk/bcaa51058e.png
I am used to 53165. Press CTRL+X to exit nano. Now you are getting asked to save changes.
Enter Y to continue and again press <Enter> after that.
http://puu.sh/mRIdQ/307d757003.png
Now we need to change the SSH Port in PuTTy and WinSCP from 22 to our new Port.
http://img5.fotos-hochladen.net/uploads/puttynewport49hxg1vnd0.png
http://img5.fotos-hochladen.net/uploads/winscpnewportr71mlvb6oj.png
2.4 Setup Git
After we have changed the SSH and MySQL Port, we can Setup Git and also the last step before we are going to add the User for Compiling and Running the Server.
So we enter apt-get install -y git into PuTTy
http://puu.sh/mRIvJ/0bc13620f1.png
After that, we need to do some Git Configuration. We add an Username and Email for this Git per entering the following into PuTTy
Replace the lightblue stuff with your infos (does not require an github user)
git config --global user.name "Enter Username"
git config --global user.email "Enter EMail Address"
______________________________________________
2.5 Setup User
The last Step before the generating and compiling begins is adding a new user for all of this. We have neither an existing one, netiher an folder where to actually start working. So we make use of the command useradd and add a few parameters.
-m to create the homedirectory
-s bash
(note: to find out what to enter here, you need to enter which bash into PuTTy and copy the path)
-d to set homedirectory on login
REPLACE THE LIGHTBLUE STUFF WITH YOUR INFO
useradd -m -s /bin/bash -d /username/ username
After that, we setting a password for the User we just created, in my case it was acweb. We run passwd username
http://puu.sh/mRJqq/47c517fa5c.png
______________________________________________
3 Setup TrinityCore
So we are now going to reboot our system once since we have done alot of installations and changes of ports. So we run reboot into PuTTy and close it, waiting till the VPS comes back up.
http://puu.sh/mRJ5p/d7504f396d.png
Once the VPS is back available, open PuTTy and login with the new created user.
http://puu.sh/mRJBK/11395e4b5c.png
______________________________________________
3.1 Clone the newest TrinityCore
So we are now logged in with our server-user. Let us begin with downloading the newest 3.3.5a TrinityCore. We Execute git clone -b3.3.5 git://github.com/TrinityCore/TrinityCore.git src into PuTTy.
http://puu.sh/mRJPZ/2aab3f876f.png
______________________________________________
3.2 Merge with ElunaLuaEngine (optional)
We do now own the Newest TrinityCore 3.3.5a Sourcecode. If you want to use Lua within your TrinityCore, we need to execute cd src into PuTTy to enter the src folder where all the trinitycore files are placed and then we need to run
git pull --recurse-submodules git://github.com/ElunaLuaEngine/ElunaTrinityWotlk.git
Something like this should come up
http://puu.sh/mRJZf/f61b874db1.png
Go all the way down with your arrow down button and enter an message, im used to acwebtutorial
http://puu.sh/mRK3c/5feb527202.png
Press CTRL+X to exit. Now you are getting asked to save changes.
Enter Y to continue and again press <Enter> after that.
Something like that should you see now after its finished
http://puu.sh/mRK8Q/7f872954f5.png
Now we only run git submodule init && git submodule update into PuTTy and we are finished with merging.
http://puu.sh/mRKbI/47cea3ba61.png
______________________________________________
3.3 Cmake
Now we can run cmake to run the generation of the compileable files.
We are visiting back our homedirectory per running cd per PuTTy
http://puu.sh/mRKm0/96b5320906.png
Now we are going to create a new directory for our cmake step. We are going to run mkdir cmake in PuTTy.
To Check if the Directory was created, run ls and seek out for it.
http://puu.sh/mRKrj/3d0d6b24e4.png
Now we are going to enter the cmake folder by entering cd cmake into PuTTy.
To run cmake, simply enter cmake into PuTTy to run it, but we need to add a few additional parameters.
I am going to use the followings:
source/path
-DCMAKE_INSTALL_PREFIX
-DTOOLS
-DUSE_COREPCH
-DUSE_SCRIPTPCH
For those who need Warnings and Debug also need those:
-DWITH_WARNINGS
-DWITH_COREDEBUG
REPLACE THE LIGHTBLUE STUFF WITH YOUR INFO
For example (normal)
cmake ../src -DCMAKE_INSTALL_PREFIX=/username/run -DTOOLS=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1
For example (debug)
cmake ../src -DCMAKE_INSTALL_PREFIX=/username/run -DTOOLS=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DWITH_WARNINGS=1 -DWITH_COREDEBUG=1
You should see something like this now
http://puu.sh/mRKzD/6388367843.png
______________________________________________
3.4 Compiling and Installing
Our TrinityCore is now ready to be compiled. We can do that per using the command make and the install command
Depending on how much CPU Cores you have, you can add -j X to the make command as parameter.
For Example in my case:
make -j 6 && make install
It should start compiling. Now you wait till it reached 100% and till it has installed the server binaries to the install_prefix we set before in cmake.
http://puu.sh/mRKHK/6578dba90f.png
http://puu.sh/mRLyN/9014d63dd4.png
Depending on your Hosting Specs, it can take a while since the Precompiled Headers are included, any further on re-compile for example when adding a Script will be alot faster.
______________________________________________
3.5 Configuration
Our TrinityCore is now Compiled and Installed, we can now move to the configs folder and remove the .dist per again visit the homedirectory per cd and then execute cd /run/etc in PuTTy.
http://puu.sh/mRLD1/17c0840f9d.png
After that we are going to run the following 2 commands:
cp authserver.conf.dist authserver.conf && cp worldserver.conf.dist worldserver.conf
rm authserver.conf.dist && rm worldserver.conf.dist
to copy the existing files without the .dist and delete the files with .dist after that.
as soon as we only have authserver.conf and worldserver.conf in our folder (check it per using ls) we need to give those files some permissions per running chmod 777 authserver.conf && chmod 777 worldserver.conf in PuTTy
http://puu.sh/mRLGr/5e5694f65b.png
Now we are going to Open WinSCP and Connect with the root user to the Linux System. Follow the path -> ../username/run/etc where the configs are placed.
http://puu.sh/mRLMk/505323d62b.png
Open them by Selecting both with your mouse and hit <Enter>
First thing we are going to change is the ListenPort and the PID File.
Choose any Port from 1-65500
http://puu.sh/mRLXe/dee41bdd70.png
The next thing is changing the MySQL Port from 3306 to our new Port.
http://puu.sh/mRM3b/037e2ce01e.png
Now we are going to open the worldserver.conf and also edit a few things first.
We are adding an external folder for dbc,maps,vmaps,mmaps for better overview of things.
We set binary folder to logfolder and change the MySQL and Worldserver Port (Choose any Port from 1-65500)
We also enable mmaps and pid for the worldserver, and disable updates
http://puu.sh/mRMbi/2d96ea58f0.png
http://puu.sh/mRMhU/edd89b3c14.png
http://puu.sh/mRMmi/51ffe97e68.png
http://puu.sh/mRMp8/08adf020be.png
http://puu.sh/mRPFh/6b169f1488.png
After that, go into your binary folder with cd ../bin and create a new folder called data per mkdir data in PuTTy.
Now we are going to enter the data folder with cd data and download the dbcs,maps,vmaps and mmaps with the following command
wget http://euve104411.serverprofi24.de/ac-tut/resources.zip (1000MB+)
Let it finish load. and after that extract the files with unzip resources.zip or unzip e resources.zip use (A)LWAYS on getting a request
The Stuff is Extracted from my Client and Compressed and Uploaded to the Tutorial VPS to be HTTP Downloaded by you.
After you extracted the stuff, we are going to remove the zip file again.
rm resources.zip
To see everything is alright, run ls into putty and look out that it looks like this:
[COLOR=#FF0000]( THERE ARE NOW A FEW MORE FOLDERS FROM UPDATE BUT OUTDATED IMAGE! )
http://puu.sh/n2w2j/d9030eeaad.png
______________________________________________
3.6 Setup of iptables
TrinityCore is now Configured and all ports are set. lets setup iptables and allow the ports we need.
We open another PuTTy Session and login with the root user and run apt-get install iptables, after that we forward all ports with this command.
iptables -A INPUT -i eth0 -p tcp -m tcp --dport PORTNUMBER -j ACCEPT
Run it multible times with your SSH, MySQL, AuthserverListen, WorldServer Port.
http://puu.sh/mRMNa/f4a59268f7.png
In my case
______________________________________________
[COLOR=#B22222]4. Database Setup
So far we have anything done for a successfull serverstart, we only need to install the Database for that.
______________________________________________
4.1 User and Database Setup
So we are going to open PuTTy with the root user and run mysql -uroot -p after that we are going to enter the following to add an user to connect from our computer to the vps mysql service, simply replace the lightblue stuff with your infos. (copy the row's one by one, else it will create a user called enter a name)
create user 'enter a name'@'%' identified by 'enter a password';
grant all privileges on *.* to 'the username you choosed before'@'%' WITH GRANT OPTION;
For Example:
Press CTRL+C to exit MySQL.
then enter the following folder cd ../username/src/sql/create to setup the user for the configs and also create the databases auth, characters and world
http://puu.sh/mRN7h/ca417fdd66.png
now we run mysql -uroot -p < create_mysql.sql
http://puu.sh/mRNer/a770fdd634.png
______________________________________________
4.2 Base Database Installation
After that we are going to leave the create directory and move to the base directory per running cd ../base in PuTTy
Now we execute authdatabase to the db "auth" and characterdatabase to db "characters"
mysql -uroot -p auth < auth_database.sql
mysql -uroot -p characters < characters_database.sql
______________________________________________
4.3 WorldDb and Updates
Now we only need to download and install the newest TDB and apply the Updates and the setup is nearly finished!
run cd to visit your homedirectory as user root and move into the opt folder per cd ../opt
Now we download the TDB per wget https://github.com/TrinityCore/TrinityCore/releases/download/TDB335.62/TDB_full_335.62_2016_10_17.7z
http://puu.sh/mRNur/ba9d2d24f2.png
Now we extract the file per 7z e TDB_full_335.62_2016_10_17.7z and execute the full-db sql file into our world db
http://puu.sh/mRNCh/c734c04b2e.png
mysql -uroot -p world < TDB_full_world_335.62_2016_10_17.sql
(note: dont panic, its not frozen or stuck, it just takes its time to finish batching in the whole database.)
http://puu.sh/mRNDN/6a532d4e5a.png
When the database is finished with loading, you need to run cd ../username/src/contrib to reach the file merge_updates_unix.sh to save some time on the updates.
Now we give the file access to run per chmod 777 merge_updates_unix.sh
We need to add the new Path, since TC forgot to change it.. We going to type nano merge_updates_unix.sh and add "3.3.5" to the path.
http://puu.sh/oWgRL/bcbc47e59a.png
after that we execute it with ./merge_updates_unix.sh, a new file should appear called "world_update.sql" which we are going to execute into the database with mysql -uroot -p world < world_update.sql
http://puu.sh/mRNO6/62927c8a05.png
______________________________________________
4.4 Realmlist
Now we only need to edit the realmlist. For that we run as root user the following commands mysql -uroot -p after that we execute a query doing the job for us.. Simple Replace the Lightblue stuff with your infos and enter it into PuTTy
USE auth;
UPDATE realmlist SET name = "Ac-Web Tutorial", address = '85.25.46.60', port = '63125';
http://puu.sh/mROef/464a30d91d.png
Press CTRL+C to exit MySQL.
______________________________________________
5. Server Startup Prepare
Now we only need to start the authserver and worldserver once to check everything is alright.
So we login with our user and run cd run/bin after the login
now we try to run the authserver per ./authserver
http://puu.sh/mRPuk/f9e7c9b0d5.png
It was successfully! Press CTRL+C to exit the Authserver for now.
Now we try to run the worldserver per ./worldserver
http://puu.sh/mRTp9/f60d4582ea.png
It was successfully! Now we are going to create our admin account.
Type the following into PuTTy
account create name password
account set addon name 2
http://puu.sh/mRTvS/18fbb0ac86.png
Press now CTRL+C to exit the Worldserver for now.
Openup PuTTy again and login with the root user and run the following command mysql -uroot -p
Once your logged into mysql, run the following query:
USE auth;
INSERT INTO rbac_account_permissions (accountId, permissionId, granted) VALUES ('1','192','1');
http://puu.sh/mRTOi/a2b1697790.png
Now our Account has Administrator Access..
______________________________________________
5.1 Adding an Restarter
We switch back to our PuTTy Session with our sperate user or login with it and run cd /run/bin to get into the server-binary folder
Now we are going to add a small restarter script per nano restarter.sh and paste the following into it:
#!/bin/bash
while :; do
./worldserver
sleep 0
done
http://puu.sh/mRU45/4c8f6f19b7.png
Press CTRL+X to exit nano. Now you are getting asked to save changes.
Enter Y to continue and again press <Enter> after that.
Now we grant the restarter permissions to be executed per chmod 7777 restarter.sh
http://puu.sh/mRUb7/d078dd5edf.png
______________________________________________
5.2 Starting Auth and World with Screen
Make sure you are in /username/run/bin.
Now to start the auth and restarter without having PuTTy open, we going to use screen
Run the following commands:
screen -AmdS auth ./authserver
screen -AmdS world ./restarter.sh
You can access any of those screens per
screen -r auth
screen -r world
http://puu.sh/mRUnF/1273c927cb.png
to check if the binaries are actually started, run ps -fx and seek out for ./authserver and ./worldserver
http://puu.sh/mRUrj/5fddf61acf.png
Now we only need to set our Realmlist.
set realmlist your.ip.address.here:RealmPort
my case:
set realmlist euve104411.serverprofi24.de:1337
http://puu.sh/mRUvU/5ee603e738.jpg
http://puu.sh/mRUAl/c3b1509f6d.jpg
______________________________________________
Few parts (suggestions) by MyLilSuccy
Section 5
Instead of forcing GM permissions onto the account via MySQL, just add the following to the Trinity account setup
account set gmlevel acweb 3 -1
The proper way to shutdown the server is to issue the command
server shutdown 0
The 0 here is a delay, in seconds, before the shutdown happens.
An exit code and a message can be given with this command as well (usefull for shutting down the server for maintenance). For example, to shutdown after 15 minutes with exit code 255, you can do
server shutdown 900 255 For routine maintenance
Players will see the message [SERVER] Shutdown in 15 Minute(s) - For routine maintenance
They will receive reminders every 15 seconds as well.
Section 5.1
The exit code from the shutdown command can be checked for in the restart script so as not to auto-restart for normal shutdowns. Here's my suggested changes for the worldserver restart script
#!/bin/bash
# Restart the worldserver on exit unless exit code 255 is returned
# Clean server shutdown can be done with
# server shutdown <delay> 255 [message]
# where <delay> is a time delay in seconds before server goes down.
# [message] is an option message sent to all players
RESTART=1
while [$RESTART -eq 1]; do
./worldserver
if [$? -eq 255] then
RESTART=0
fi
sleep 0
done
Section 5.2
Instead of screen, try using tmux. It is much more flexible. Check it out (https://tmux.github.io/)
End
WELCOME TO THIS TUTORIAL
brought to you by Psykko
http://img5.fotos-hochladen.net/uploads/tutorialheaderextc5f7302.jpg
______________________________________________
Greetings, i decided to publish this small tutorial for all the people without alot Linux knowledge. This Tutorial contains reading and dragons, but it also includes anything you need for a save and successful start on your Linux System. People with Knowledge can surely skip a few steps, this is written for total beginners. Following i list a register of things within this Tutorial. Should we start?
Tutorial overview:
1. Getting a Linux Machine with a free month (optional)
1.1 Gathering Software for Linux Communication
1.2 Setup Sessions
___
2. Linux System Setup
2.1 Installation of needed Packages
2.2 SSH Port
2.3 MySQL Port
2.4 Setup Git
2.5 Setup User
___
3. Setup TrinityCore
3.1 Clone the newest TrinityCore
3.2 Merge with ElunaLuaEngine (optional)
3.3 Cmake
3.4 Compiling and Installing
3.5 Configuration
3.6 Setup of iptables
___
4. Database Setup
4.1 User and Database Setup
4.2 Base Database Installation
4.3 WorldDb and Updates
4.4 Realmlist
___
5. Server Startup Prepare
5.1 Adding an Restarter
5.2 Starting Auth and World with Screen
___
6. End
______________________________________________
1. Getting a Linux Machine with a free month (optional)
Im showing you here how you can get a neat vps for small money inculsive a free month of payment.
This VPS is a great choise for starting a Server.
https://contabo.de/downloads/contabo_screen_rgb_800x300.png (https://contabo.com/?show=configurator&vserver_id=145)
Click at the Image above to spectate the VPS.
______________________________________________
1.1 Gathering Software for Linux Communication
Its up to you what kind of Program you are going to use to communicate with your VPS/Dedicated Server. In this Tutorial I will be using PuTTy and WinSCP, but i will list some other Programs too.
We are in need of an Program which allows us to open an SSH tunnel between your Computer and your VPS, therefore im using PuTTy.
And we will also need an File Transfer Protocol Program for Filetransfer between your Computer and your VPS, therefore im using WinSCP since it has many functions and a nice interface.
PuTTy - Click to Download the Installer (https://the.earth.li/~sgtatham/putty/latest/x86/putty-0.67-installer.msi)
WinSCP - Click to Download the Installer (http://winscp.net/download/winscp576setup.exe)
FileZilla - Click to Download the Installer (http://downloads.sourceforge.net/project/filezilla/FileZilla_Client/3.15.0/FileZilla_3.15.0_win64-setup.exe?r=&ts=1454315717&use_mirror=vorboss)
CyberDuck - Click to Download the Installer (https://update.cyberduck.io/windows/Cyberduck-Installer-4.7.3.exe)
BitKinex - Click to Download the Installer (http://www.bitkinex.com/ftp/client/bitkinex323.exe)
I would really suggest you to use PuTTy and WinSCP since they have a good integration with each other.
So we going to install PuTTy by starting the downloaded Installer and following the Steps.
http://puu.sh/mRCKv/9bbd8e966c.png
http://puu.sh/mRCOp/955a4f54f7.png
http://puu.sh/mRCRf/c61418f4d8.png
Now we are going to install WinSCP by starting the Installer and follow the Steps.
http://puu.sh/mRCXE/35c75acb58.png
http://puu.sh/mRCZR/6fad0bbb03.png
http://puu.sh/mRD1N/4a6b44306b.png
http://puu.sh/mRD7v/7e5980ae3d.png
Congratulation, you have successfully installed everything you need to work with your VPS!
______________________________________________
1.2 Setup Sessions
First of all, we are going to open PuTTy, you should find something like this
http://puu.sh/mRDh8/752e220d92.png
http://img5.fotos-hochladen.net/uploads/puttybixtr8ozpd.png
Fill the Informations like in the Layout above.
(following is an example of mine)
http://puu.sh/mRDF8/0ea7d268f4.png
So far PuTTy is finished.
Lets open up WinSCP and you should find something like this.
http://puu.sh/mRDOC/cd5a9ac3ac.png
http://img5.fotos-hochladen.net/uploads/winscptds6hgb78q.png
Fill the Informations like in the Layout above.
(following is an example of mine)
http://puu.sh/mRE0M/257d723238.png
http://puu.sh/mRE3Y/5cab59c710.png
Choose again a Name for the Session, i entered My VPS instead of [email protected] and mark the Save Password Button. Ok
(above is an example of mine)
You are now able to access PuTTy and WinSCP by doubleclicking the Session Name.
______________________________________________
2. Linux System Setup
We are now going to open our PuTTy Session.
(note: any first connection to a VPS causes an PuTTy Security Alert, dont get in panic, hit the Yes Button.)
After that, login with the root user to your Linux System. Take the Password from the Email/Userpanel of your Provider.
(note: the passwords never getting shown in PuTTy. You can paste into PuTTy per rightclick into the black field)
http://puu.sh/mREjc/0cd49ef750.png
http://puu.sh/mRFIh/218afe5f8c.png
We are now logged into our Linux System. Im using Debian 7 minimal 64bit for this Tutorial. Since im running 64bit, i will need to download 32bit Libaries too, so im in need of adding the 32bit architecture to the System for better integration. So we are going to enter dpkg --add-architecture i386 into PuTTy and run it.
http://puu.sh/mRG1E/45256078a5.png
After that happened, we are going to run apt-get update && apt-get upgrade into PuTTy and run it, to catch the updates for the previous set architecture
http://puu.sh/mRG9D/2d9ad21995.png
Now simply run apt-get install ia32-libs
Ubuntu Users need this:
______________________________________________
2.1 Installation of needed Packages
So far our Linux System does not contain any Software exept you are using LAMP (recommented if you are going to host a website too). We are going to install all needed Packages we need to generate, compile and install our TrinityCore containing MySQL (not git, git is getting installed seperate sooner.)
(note: skip this if you have them installed already.)
Here is a list of the needed Packages:
So we are going to run apt-get install -y sudo screen libtool gcc g++ mysql-server mysql-client libmysqlclient-dev libmysql++-dev make cmake p7zip-full libncurses5-dev zlib1g-dev libbz2-dev gdb nano openssl libssl-dev libreadline6-dev libboost-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-iostreams-dev build-essential autoconf into PuTTy and run it.
It will start reading and downloading the packages and installing them... So far you dont have an mysql-server installed,you are going to get in contact with this screen.
simply enter an password for the user "root" for MySQL
http://puu.sh/mRGAy/b858f4a5d4.png
you need to re-enter it.
http://puu.sh/mRGHT/b807ae03fc.png
______________________________________________
2.2 SSH Port
Before it comes to Compiling and all that stuff, we need to do some changes for your own security. We are going to change the SSH port which is currently 22 which is default for Linux.
We are going to enter nano /etc/ssh/sshd_config into PuTTy
(note: you can only move per cross-buttons on your keyboard in PuTTy. To enter Numbers, dont use the Numblock.)
http://puu.sh/mRGX9/d50a346381.png
Something like this should appear, we are going to change the part
Port 22 to something else, you can use any number within this range 49152-65535.
I am used to 53155.
http://puu.sh/mRH5r/43c6332c4c.png
Press CTRL+X to exit nano. Now you are getting asked to save changes.
http://puu.sh/mRHdJ/ca7f47124f.png
Enter Y to continue and again press <Enter> after that.
http://puu.sh/mRHi8/77e20b408f.png
______________________________________________
2.3 MySQL Port
After we have changed the SSH Port, we are now going to change the MySQL Port too. Default: 3306
We are going to enter nano /etc/mysql/my.cnf into PuTTy. You should find something like this:
http://puu.sh/mRHrD/2cbbe4d06d.png
http://www.fotos-hochladen.net/uploads/mysqlvp0we1rj8c.png
Change the Port from 3306 at both locations to any number within this range 49152-65535 and put a single # infront of bind-address = 127.0.01 like in the Layout above.
http://puu.sh/mRHFk/bcaa51058e.png
I am used to 53165. Press CTRL+X to exit nano. Now you are getting asked to save changes.
Enter Y to continue and again press <Enter> after that.
http://puu.sh/mRIdQ/307d757003.png
Now we need to change the SSH Port in PuTTy and WinSCP from 22 to our new Port.
http://img5.fotos-hochladen.net/uploads/puttynewport49hxg1vnd0.png
http://img5.fotos-hochladen.net/uploads/winscpnewportr71mlvb6oj.png
2.4 Setup Git
After we have changed the SSH and MySQL Port, we can Setup Git and also the last step before we are going to add the User for Compiling and Running the Server.
So we enter apt-get install -y git into PuTTy
http://puu.sh/mRIvJ/0bc13620f1.png
After that, we need to do some Git Configuration. We add an Username and Email for this Git per entering the following into PuTTy
Replace the lightblue stuff with your infos (does not require an github user)
git config --global user.name "Enter Username"
git config --global user.email "Enter EMail Address"
______________________________________________
2.5 Setup User
The last Step before the generating and compiling begins is adding a new user for all of this. We have neither an existing one, netiher an folder where to actually start working. So we make use of the command useradd and add a few parameters.
-m to create the homedirectory
-s bash
(note: to find out what to enter here, you need to enter which bash into PuTTy and copy the path)
-d to set homedirectory on login
REPLACE THE LIGHTBLUE STUFF WITH YOUR INFO
useradd -m -s /bin/bash -d /username/ username
After that, we setting a password for the User we just created, in my case it was acweb. We run passwd username
http://puu.sh/mRJqq/47c517fa5c.png
______________________________________________
3 Setup TrinityCore
So we are now going to reboot our system once since we have done alot of installations and changes of ports. So we run reboot into PuTTy and close it, waiting till the VPS comes back up.
http://puu.sh/mRJ5p/d7504f396d.png
Once the VPS is back available, open PuTTy and login with the new created user.
http://puu.sh/mRJBK/11395e4b5c.png
______________________________________________
3.1 Clone the newest TrinityCore
So we are now logged in with our server-user. Let us begin with downloading the newest 3.3.5a TrinityCore. We Execute git clone -b3.3.5 git://github.com/TrinityCore/TrinityCore.git src into PuTTy.
http://puu.sh/mRJPZ/2aab3f876f.png
______________________________________________
3.2 Merge with ElunaLuaEngine (optional)
We do now own the Newest TrinityCore 3.3.5a Sourcecode. If you want to use Lua within your TrinityCore, we need to execute cd src into PuTTy to enter the src folder where all the trinitycore files are placed and then we need to run
git pull --recurse-submodules git://github.com/ElunaLuaEngine/ElunaTrinityWotlk.git
Something like this should come up
http://puu.sh/mRJZf/f61b874db1.png
Go all the way down with your arrow down button and enter an message, im used to acwebtutorial
http://puu.sh/mRK3c/5feb527202.png
Press CTRL+X to exit. Now you are getting asked to save changes.
Enter Y to continue and again press <Enter> after that.
Something like that should you see now after its finished
http://puu.sh/mRK8Q/7f872954f5.png
Now we only run git submodule init && git submodule update into PuTTy and we are finished with merging.
http://puu.sh/mRKbI/47cea3ba61.png
______________________________________________
3.3 Cmake
Now we can run cmake to run the generation of the compileable files.
We are visiting back our homedirectory per running cd per PuTTy
http://puu.sh/mRKm0/96b5320906.png
Now we are going to create a new directory for our cmake step. We are going to run mkdir cmake in PuTTy.
To Check if the Directory was created, run ls and seek out for it.
http://puu.sh/mRKrj/3d0d6b24e4.png
Now we are going to enter the cmake folder by entering cd cmake into PuTTy.
To run cmake, simply enter cmake into PuTTy to run it, but we need to add a few additional parameters.
I am going to use the followings:
source/path
-DCMAKE_INSTALL_PREFIX
-DTOOLS
-DUSE_COREPCH
-DUSE_SCRIPTPCH
For those who need Warnings and Debug also need those:
-DWITH_WARNINGS
-DWITH_COREDEBUG
REPLACE THE LIGHTBLUE STUFF WITH YOUR INFO
For example (normal)
cmake ../src -DCMAKE_INSTALL_PREFIX=/username/run -DTOOLS=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1
For example (debug)
cmake ../src -DCMAKE_INSTALL_PREFIX=/username/run -DTOOLS=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DWITH_WARNINGS=1 -DWITH_COREDEBUG=1
You should see something like this now
http://puu.sh/mRKzD/6388367843.png
______________________________________________
3.4 Compiling and Installing
Our TrinityCore is now ready to be compiled. We can do that per using the command make and the install command
Depending on how much CPU Cores you have, you can add -j X to the make command as parameter.
For Example in my case:
make -j 6 && make install
It should start compiling. Now you wait till it reached 100% and till it has installed the server binaries to the install_prefix we set before in cmake.
http://puu.sh/mRKHK/6578dba90f.png
http://puu.sh/mRLyN/9014d63dd4.png
Depending on your Hosting Specs, it can take a while since the Precompiled Headers are included, any further on re-compile for example when adding a Script will be alot faster.
______________________________________________
3.5 Configuration
Our TrinityCore is now Compiled and Installed, we can now move to the configs folder and remove the .dist per again visit the homedirectory per cd and then execute cd /run/etc in PuTTy.
http://puu.sh/mRLD1/17c0840f9d.png
After that we are going to run the following 2 commands:
cp authserver.conf.dist authserver.conf && cp worldserver.conf.dist worldserver.conf
rm authserver.conf.dist && rm worldserver.conf.dist
to copy the existing files without the .dist and delete the files with .dist after that.
as soon as we only have authserver.conf and worldserver.conf in our folder (check it per using ls) we need to give those files some permissions per running chmod 777 authserver.conf && chmod 777 worldserver.conf in PuTTy
http://puu.sh/mRLGr/5e5694f65b.png
Now we are going to Open WinSCP and Connect with the root user to the Linux System. Follow the path -> ../username/run/etc where the configs are placed.
http://puu.sh/mRLMk/505323d62b.png
Open them by Selecting both with your mouse and hit <Enter>
First thing we are going to change is the ListenPort and the PID File.
Choose any Port from 1-65500
http://puu.sh/mRLXe/dee41bdd70.png
The next thing is changing the MySQL Port from 3306 to our new Port.
http://puu.sh/mRM3b/037e2ce01e.png
Now we are going to open the worldserver.conf and also edit a few things first.
We are adding an external folder for dbc,maps,vmaps,mmaps for better overview of things.
We set binary folder to logfolder and change the MySQL and Worldserver Port (Choose any Port from 1-65500)
We also enable mmaps and pid for the worldserver, and disable updates
http://puu.sh/mRMbi/2d96ea58f0.png
http://puu.sh/mRMhU/edd89b3c14.png
http://puu.sh/mRMmi/51ffe97e68.png
http://puu.sh/mRMp8/08adf020be.png
http://puu.sh/mRPFh/6b169f1488.png
After that, go into your binary folder with cd ../bin and create a new folder called data per mkdir data in PuTTy.
Now we are going to enter the data folder with cd data and download the dbcs,maps,vmaps and mmaps with the following command
wget http://euve104411.serverprofi24.de/ac-tut/resources.zip (1000MB+)
Let it finish load. and after that extract the files with unzip resources.zip or unzip e resources.zip use (A)LWAYS on getting a request
The Stuff is Extracted from my Client and Compressed and Uploaded to the Tutorial VPS to be HTTP Downloaded by you.
After you extracted the stuff, we are going to remove the zip file again.
rm resources.zip
To see everything is alright, run ls into putty and look out that it looks like this:
[COLOR=#FF0000]( THERE ARE NOW A FEW MORE FOLDERS FROM UPDATE BUT OUTDATED IMAGE! )
http://puu.sh/n2w2j/d9030eeaad.png
______________________________________________
3.6 Setup of iptables
TrinityCore is now Configured and all ports are set. lets setup iptables and allow the ports we need.
We open another PuTTy Session and login with the root user and run apt-get install iptables, after that we forward all ports with this command.
iptables -A INPUT -i eth0 -p tcp -m tcp --dport PORTNUMBER -j ACCEPT
Run it multible times with your SSH, MySQL, AuthserverListen, WorldServer Port.
http://puu.sh/mRMNa/f4a59268f7.png
In my case
______________________________________________
[COLOR=#B22222]4. Database Setup
So far we have anything done for a successfull serverstart, we only need to install the Database for that.
______________________________________________
4.1 User and Database Setup
So we are going to open PuTTy with the root user and run mysql -uroot -p after that we are going to enter the following to add an user to connect from our computer to the vps mysql service, simply replace the lightblue stuff with your infos. (copy the row's one by one, else it will create a user called enter a name)
create user 'enter a name'@'%' identified by 'enter a password';
grant all privileges on *.* to 'the username you choosed before'@'%' WITH GRANT OPTION;
For Example:
Press CTRL+C to exit MySQL.
then enter the following folder cd ../username/src/sql/create to setup the user for the configs and also create the databases auth, characters and world
http://puu.sh/mRN7h/ca417fdd66.png
now we run mysql -uroot -p < create_mysql.sql
http://puu.sh/mRNer/a770fdd634.png
______________________________________________
4.2 Base Database Installation
After that we are going to leave the create directory and move to the base directory per running cd ../base in PuTTy
Now we execute authdatabase to the db "auth" and characterdatabase to db "characters"
mysql -uroot -p auth < auth_database.sql
mysql -uroot -p characters < characters_database.sql
______________________________________________
4.3 WorldDb and Updates
Now we only need to download and install the newest TDB and apply the Updates and the setup is nearly finished!
run cd to visit your homedirectory as user root and move into the opt folder per cd ../opt
Now we download the TDB per wget https://github.com/TrinityCore/TrinityCore/releases/download/TDB335.62/TDB_full_335.62_2016_10_17.7z
http://puu.sh/mRNur/ba9d2d24f2.png
Now we extract the file per 7z e TDB_full_335.62_2016_10_17.7z and execute the full-db sql file into our world db
http://puu.sh/mRNCh/c734c04b2e.png
mysql -uroot -p world < TDB_full_world_335.62_2016_10_17.sql
(note: dont panic, its not frozen or stuck, it just takes its time to finish batching in the whole database.)
http://puu.sh/mRNDN/6a532d4e5a.png
When the database is finished with loading, you need to run cd ../username/src/contrib to reach the file merge_updates_unix.sh to save some time on the updates.
Now we give the file access to run per chmod 777 merge_updates_unix.sh
We need to add the new Path, since TC forgot to change it.. We going to type nano merge_updates_unix.sh and add "3.3.5" to the path.
http://puu.sh/oWgRL/bcbc47e59a.png
after that we execute it with ./merge_updates_unix.sh, a new file should appear called "world_update.sql" which we are going to execute into the database with mysql -uroot -p world < world_update.sql
http://puu.sh/mRNO6/62927c8a05.png
______________________________________________
4.4 Realmlist
Now we only need to edit the realmlist. For that we run as root user the following commands mysql -uroot -p after that we execute a query doing the job for us.. Simple Replace the Lightblue stuff with your infos and enter it into PuTTy
USE auth;
UPDATE realmlist SET name = "Ac-Web Tutorial", address = '85.25.46.60', port = '63125';
http://puu.sh/mROef/464a30d91d.png
Press CTRL+C to exit MySQL.
______________________________________________
5. Server Startup Prepare
Now we only need to start the authserver and worldserver once to check everything is alright.
So we login with our user and run cd run/bin after the login
now we try to run the authserver per ./authserver
http://puu.sh/mRPuk/f9e7c9b0d5.png
It was successfully! Press CTRL+C to exit the Authserver for now.
Now we try to run the worldserver per ./worldserver
http://puu.sh/mRTp9/f60d4582ea.png
It was successfully! Now we are going to create our admin account.
Type the following into PuTTy
account create name password
account set addon name 2
http://puu.sh/mRTvS/18fbb0ac86.png
Press now CTRL+C to exit the Worldserver for now.
Openup PuTTy again and login with the root user and run the following command mysql -uroot -p
Once your logged into mysql, run the following query:
USE auth;
INSERT INTO rbac_account_permissions (accountId, permissionId, granted) VALUES ('1','192','1');
http://puu.sh/mRTOi/a2b1697790.png
Now our Account has Administrator Access..
______________________________________________
5.1 Adding an Restarter
We switch back to our PuTTy Session with our sperate user or login with it and run cd /run/bin to get into the server-binary folder
Now we are going to add a small restarter script per nano restarter.sh and paste the following into it:
#!/bin/bash
while :; do
./worldserver
sleep 0
done
http://puu.sh/mRU45/4c8f6f19b7.png
Press CTRL+X to exit nano. Now you are getting asked to save changes.
Enter Y to continue and again press <Enter> after that.
Now we grant the restarter permissions to be executed per chmod 7777 restarter.sh
http://puu.sh/mRUb7/d078dd5edf.png
______________________________________________
5.2 Starting Auth and World with Screen
Make sure you are in /username/run/bin.
Now to start the auth and restarter without having PuTTy open, we going to use screen
Run the following commands:
screen -AmdS auth ./authserver
screen -AmdS world ./restarter.sh
You can access any of those screens per
screen -r auth
screen -r world
http://puu.sh/mRUnF/1273c927cb.png
to check if the binaries are actually started, run ps -fx and seek out for ./authserver and ./worldserver
http://puu.sh/mRUrj/5fddf61acf.png
Now we only need to set our Realmlist.
set realmlist your.ip.address.here:RealmPort
my case:
set realmlist euve104411.serverprofi24.de:1337
http://puu.sh/mRUvU/5ee603e738.jpg
http://puu.sh/mRUAl/c3b1509f6d.jpg
______________________________________________
Few parts (suggestions) by MyLilSuccy
Section 5
Instead of forcing GM permissions onto the account via MySQL, just add the following to the Trinity account setup
account set gmlevel acweb 3 -1
The proper way to shutdown the server is to issue the command
server shutdown 0
The 0 here is a delay, in seconds, before the shutdown happens.
An exit code and a message can be given with this command as well (usefull for shutting down the server for maintenance). For example, to shutdown after 15 minutes with exit code 255, you can do
server shutdown 900 255 For routine maintenance
Players will see the message [SERVER] Shutdown in 15 Minute(s) - For routine maintenance
They will receive reminders every 15 seconds as well.
Section 5.1
The exit code from the shutdown command can be checked for in the restart script so as not to auto-restart for normal shutdowns. Here's my suggested changes for the worldserver restart script
#!/bin/bash
# Restart the worldserver on exit unless exit code 255 is returned
# Clean server shutdown can be done with
# server shutdown <delay> 255 [message]
# where <delay> is a time delay in seconds before server goes down.
# [message] is an option message sent to all players
RESTART=1
while [$RESTART -eq 1]; do
./worldserver
if [$? -eq 255] then
RESTART=0
fi
sleep 0
done
Section 5.2
Instead of screen, try using tmux. It is much more flexible. Check it out (https://tmux.github.io/)
End