The following warnings occurred:
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit
Warning [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead - Line: 198 - File: inc/plugins/mwsshcode.php PHP 7.0.19 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/mwsshcode.php 198 preg_replace
/inc/class_plugins.php 139 mwsshcode_run
/inc/class_parser.php 187 pluginSystem->run_hooks
/inc/functions_post.php 717 postParser->parse_message
/showthread.php 1063 build_postbit



Fork me on GitHub
Ubuntu install instructions for beginners
Post: #1
I have been working on installation instruction for Ubuntu for some time now. I got side tracked on other things, but would like to get back to completing it. It's at a point I need review. It is about 85% complete.

Any suggestions, and comments are appreciated
[-] The following 1 user says Thank You to adellaci for this post:
  • Issuntril
Reply
Post: #2
Installation Instructions for Beginners, WotLK, UDB, Ubuntu 14.04

Updated: 02/02/2017 * Incomplete Draft * 11:14 am EST *** Completed Backup, Restore & Clear ***

How to install C(ontinued)-MaNGOS from scratch and how to update it.

This Guide is to help beginners install WotLK on an Ubuntu 14.04 system from scratch. The purpose of these instructions is to give you enough basic knowledge of Linux in order to compile a cMANGOS server from scratch. At the end of the guide we will be covering how to add updates to CMaNGOS database structures and updates to the UDB database entries. So sit back, relax, get a cup of coffee, and let's get to it.

I have found that, if this is your very first or second time, it is best to print the directions out, and write on it: your IP Address, Machine Name, User, and passwords. This will help you keep everything straight and in order.

  1. Install Ubuntu 14.04 & user.

  2. Install Apache web server.

  3. Install MySQL.

  4. Install OpenSSH server.

  5. Install phpMyAdmin.

  6. Install additional software.

  7. Getting the CMaNGOS/ScriptDev2, UDB, & ACID files.

  8. Compiling CMaNGOS – WotLK.

  9. Create CMaNGOS databases, & update.

  10. Install UDB (WotLK) & update.

  11. Extract files from the client.

  12. Starting Server.

  13. Editing WoW client to connect to the server.

  14. Creating a WoW user account.

  15. Database maintenance (Optimize, Backup, Restore, & Clear)

Addresses
1. Install Ubuntu 14.04

Parameters for this example;
OS: Ubuntu 14.04
Computer Name: CMangos-Server
Full Name: Mangos
User: mangos
Password: mangos
IP Address: 192.168.1.10


1.1 First you will need to download Ubuntu. From this link you need to select either the Server or Desktop version. The Desktop version comes in a choice of 32 or 64 bits; select which one is appropriate for your system. The Server version only comes in 64 bit.

1.2. Once downloaded, you need to burn the ISO to a DVD, and install it on your system.

1.3a. Server Install:

1.3a.1 Here is a link on how to install. From that guide, we are going to enter "CMangos-Server" for the hostname. We are going configure the network manually with IP Address: 192.168.1.10, Netmask: 255.255.255.0, Gateway: 192.168.1.1, Name Server Address: 8.8.8.8, and Hostname for FQDN (same as the hostname we entered earlier). For the user name and password, we are going use "Mangos" (without the quotes) and "mangos" (without quotes), respectively. For the disk partition, if you are using multiple drives, use "Guided - use entire disk and set up LVM." If you are using a single hard drive, use "Guided - use entire disk."

1.3a.2 At software selection, we are going to select OpenSSH server and Lamp server. When MySQL is installing you can refer to section 3: Install MySQL server. Once the OS is installed, you will login using "mangos" (without quotes) as both the user name and password. The first thing you want to do is update Ubuntu by issuing the following commands:
Code:
sudo apt-get update
sudo apt-get upgrade


This will show what will be updated; press Enter/Return and the update will begin. Once this is done you can skip to section 5: Install phpMyAdmin.

1.3b. Desktop Install:

1.3b.1. Here is a link on how to install. From that guide, we are going use "CMangos-Server" (without quotes) for the computer's name, and "mangos" (without quotes) for both the user name and password. Once the OS is installed, you will login with mangos as the user name and mangos as the password. In order to get a command line terminal you will need to press the "Ctrl"+"Alt"+"T" keys at the same time. First thing you want to do is update Ubuntu by issuing the following commands in the terminal:
Code:
sudo apt-get update
sudo apt-get upgrade

This will show what will be updated; press Enter/Return and the update will begin.

1.3b.2. We have some additional work to do when installing the Desktop version: we want to make our IP Address static so that it will not change. The easiest way to do this is from the desktop: directions are at this link (use Method 2). To make the change take effect, you may have to reboot or issue this command in the terminal:
Code:
sudo service network-manager restart

*Note - Sometimes I have found that I had to issue the command twice and then wait about 15 seconds or so before the system reconnects.


2. Install Apache web server

2.1. Next we need to install an Apache web server so we can have access to phpMyAdmin for the MySQL database. We will do this by typing the following command into the terminal:
Code:
sudo apt-get update
sudo apt-get install apache2


*Note - The install will usually start Apache2 web server for you. If it doesn't, issue the following commands in the terminal.
Code:
sudo service apache2 restart


2.2. To test if Apache is up and running: open a browser on your computer or any other computer on you network and enter 192.168.1.10 into the address bar. A screen should appear showing that Apache's default "index.html"



3. Install MySQL:

Parameters
user: root
password: rootmysql

3.1. Next we need to install the MySQL database server. You’ll need to issue the following command in the terminal:
Code:
sudo apt-get update
sudo apt-get install mysql-server


3.2. During the installation a window will open up in the terminal for "Package Configuration - Configuring phpmyadmin." This is asking for you to enter a password for the root user. Enter "rootmysql" (without quotes). Additional instructions and information can be found at this link.
*Note - You will want to enter your own root password. You will need it to create a user in MySQL that will be used by CMaNGOS

*Note - The install will usually start MySQL server for you. If it doesn't, issue the following commands in the terminal.
Code:
sudo service mysql restart



4. Install OpenSSH server

4.1 SSH is what we are going to use later on in this guide to get files we need from our Windows machine in the WoW folder to our Ubuntu CMaNGOS server. This will be quite simple. Type the following commands in terminal:
Code:
sudo apt-get update
sudo apt-get install openssh-server

This is the easiest, most painless part of this guide.


5. Install phpMyAdmin:

Parameters
MySQL Password: rootmysql
phpMyAdmin: phpsql

5.1. Next we will install phpMyAdmin which gives us web browser access to our database. The reason I picked this to access the database is because you will not have to install any additional software on you windows machine to access the data, you just need a web browser. Here is a link that I use to do my installations. In a terminal we are going to run these commands:
Code:
sudo apt-get update
sudo apt-get install phpmyadmin mcrypt


5.2. During the install a window will come up inside the terminal called "Package Configuration - Configuring phpmyadmin." We will want to make sure "apache2" is selected and press the "Space" bar. An asterisk should appear between the brackets. Press the "Enter" key to continue installing.

5.3. Once again the "Package Configuration - Configuring phpmyadmin" window will come open, wanting to know if you want to attach it to the database. You will select yes, by making sure the "Yes" is highlighted and pressing the "Space" bar. Another screen will come up asking for the administrative (root) password to the database, the one you entered in step 3.2. This leads to the last screen that asks you to set a password for MySQL for phpMyAdmin. You will need to enter "phpsql" (without quotes) and press the "Enter" key.
*Note - You want to create your own password.

5.4. At this point we want to explicitly enable php5-mcrypt extension. We will do so by entering this command in the terminal:
Code:
sudo php5enmod mcrypt

Now we need to restart Apache, so the changes take effect, by issuing this command in the terminal.
Code:
sudo service apache2 restart


5.5. Time to test if it installed correctly. Open a web browser and enter the following address: http://192.168.1.10/phpmyadmin. A screen like this one should come up.
[Image: pmyadmin-login-screen.png]

Enter "phpmyadmin" for the user and "phpsql" for the password. If everything is okay you will see a screen with two database tables on the left hand side. One is a "information_schema", and the other is "phpmyadmin"

*Note - If you followed the link I posted in step 4.1, you may want to continue on to step 2 in that guide. That will add another level of security to your setup, especially if you are going to allow access to your CMaNGOS server from outside your house.


6. Install additional software

6.1. This is were we are going to get all the software we need to retrieve, update and compile the CMaNGOS project. In your terminal enter this command:
Code:
sudo apt-get install build-essential gcc g++ automake git-core \
autoconf make patch libmysql++-dev mysql-server libtool \
libssl-dev grep binutils zlibc libc6 libbz2-dev cmake subversion \
libboost-all-dev

There will we a long list of extra packages that it is going to install, that is okay. Just hit the "Enter" key. After this it's time to get to the real nitty gritty.


7. Getting the CMaNGOS/ScriptDev2, UDB, & ACID files

7.1. We are going to clone all of our files into our home directory for user mangos (/home/mangos). To make sure we are there type the following command in your terminal:
Code:
cd ~


7.2. Now we will start with by cloning CMaNGOS - WotLK/ScriptDev2, enter the following command:

Code:
git clone git://github.com/cmangos/mangos-wotlk.git mangos

This will create a directory called mangos and populate it with the latest files and folders (/home/mangos/mangos).
*Note - ScriptDev2 has been incorporated into CMaNGOS core as of 11/01/2015, so there is no need to clone ScriptDev2 separately.

7.3. Next we are going to clone UDB - WotLK. This is the data that we are going to populate our database with:
Code:
git clone git://github.com/cmangos/wotlk-db.git

This is going to create a folder called Database (/home/mangos/Database).

7.4. ACID *Note - ACID is now located in the directory /home/mangos/Database/ACID/[/s]


8. Compiling CMaNGOS – WotLK/ScriptDev2

8.1. Next we are going to make a place to install our program and set user rights after it is compiled. I like to install mine in /opt/mangos-server:
Code:
sudo mkdir /opt/mangos-server
sudo mkdir /opt/mangos-server/share
sudo mkdir /opt/mangos-server/logs
sudo chown mangos:mangos /opt/mangos-server


8.2. Now it is time to start building the server application. We are going to create a directory to do the compiling in and configure "make":
Code:
cd ~
mkdir build
cd build
cmake ../mangos -DCMAKE_INSTALL_PREFIX=/opt/mangos-server -DBUILD_EXTRACTOR=ON -DBUILD_VMAP_EXTRACTOR=ON -DBUILD_MMAP_EXTRACTOR=ON -DPCH=ON

*Note - The directory that we enter at "-DCMAKE_INSTALL_PREFIX=" is where "make" (cmake) will install the server file to. If you want your CMaNGOS server installed in another location, this is what you will need to change. Make sure that you have the directory created, and that the user "mangos" (or whatever user name you are using) has owner rights to it.

8.3. We are now going to compile and install the files:
Code:
make
make install



9. Create CMaNGOS databases, & update.

9.1. First thing will be to create the databases, & assign permissions to the user "mangos." SQL queries have been created to do this for us in the /home/mangos/mangos/sql/create directory:
Code:
cd ~/mangos/sql/create
mysql -uroot -prootmysql < db_create_mysql.sql

*Note - If you chose a different user name and/or password to run CMaNGOS under, you will have to edit the file 'db_create_mysql.sql'. There will four lines that you will have to change. The line that reads CREATE USER 'mangos'@'localhost' IDENTIFIED BY 'mangos'; where CREATE USER 'mangos'@'localhost' is, you will change mangos to the user you created, and IDENTIFIED BY 'mangos', you will change mangos to the password you created. You will need to change the user in the same manner at the end of the three 'GRANT' statements as well. It is best to not use the same password as you use to login to Ubuntu.

Now, to check that it was created, open a browser tab, and enter in the address bar "192.168.1.10/phpmysql." On the 'Welcome to phpMyAdmin' page enter the user name and password. You should see on the left hand side four databases; characters, information_schema, mangos, & realmd. Currently the database 'information_schema' will be the only one with tables in it if you tried to expand the databases.

9.2. Next we are going to add tables and table structure to our database. These query statements will be found in the directory /home/mangos/mangos/sql/base:
Code:
cd ~/mangos/sql/base
mysql -umangos -pmangos characters < characters.sql
mysql -umangos -pmangos mangos < mangos.sql
mysql -umangos -pmangos realmd < realmd.sql

If we go back to the browser, refresh, and expand the databases we should see that those three databases are now populated with tables, but no data yet.

9.3. Now we need to check if there any updates to our three databases structures. Those queries will be located in the directory /home/mangos/mangos/sql/updates. There will be three directories there; character, mangos, and realmd, for each respective databases.

9.3.1 First one we are going to do is the characters database, but we need to know what version that database is currently at. Go back to your browser page of phpMyAdmin, expand the characters database by clicking on the "+" sign next to it. The database will expand to show all the tables. Looking down through the list you should see a table called 'characters_db_version': click on it. This will show you the columns in the table. At the time of this writing the column reads as "required_12937_01_characters_pvpstats", this is the last update that has been applied to the database. We now want to go to the directory, and list the update files:
Code:
cd ~/mangos/sql/updates/characters
ls

We will need to apply any queries that have a prefix number greater then our 'characters_db_version'. So, for example, if the devs made another change to 'pvpstats' you may see a file '12937_01_characters_pvpstats.sql'. If it was a change to another table in the database, for example 'account_data', you may see a file like this: '12942_01_characters_reset_talents.sql'. There could be many of these files. They will have to be entered in the correct number order. So let's say that these two examples exist, we would perform the following commands:
Code:
mysql -umangos -pmangos characters < 12937_01_characters_pvpstats.sql
mysql -umangos -pmangos characters < 12942_01_characters_reset_talents.sql

These commands would continue until you processed all of the necessary files.

9.3.2 The same would go for updates to the databases 'mangos', and 'realmd', from their respective update directory. Database 'mangos' version will be located in the 'mangos' database, in the table 'db_version' in the fourth coulmn, and at the time of this writting, reads as 'required_12938_01_mangos_scriptdev2_tables'. The SQL query will be similar to the one we used for the database 'characters', except you will replace 'characters' in that statement with 'mangos', and process all the *.sql files in the directory /home/mangos/mangos/sql/updates/mangos.

9.3.3 Database 'realmd' version will be located in the 'realmd' database, in the table 'realmd_db_version' in the only column, and at the time of this writting, reads as 'required_10008_01_realmd_realmd_db_version'. The SQL query will be similar to the one we used for the database 'characters', except you will replace 'characters' in that statement with 'realmd',and process all the *.sql files in the directory /home/mangos/mangos/sql/updates/realmd.

9.4 Since ScriptDev2 has been incorporated into CMaNGOS core as of 11/01/2015, we will need to populate the mangos database with scriptdev2.sql which is located in the directory "~/mangos/sql/scriptdev2".
Code:
cd ~/mangos/sql/scriptdev2
mysql -umangos -pmangos mangos < scriptdev2.sql



10. Install UDB (WotLK) & update.

10.1 Next we need to execute the script. The first time we run it, it will create a configuration file named InstallFullDB.config in the same folder
Code:
cd ~/Database
sh ./InstallFullDB.sh

The output should look like this:
Code:
Welcome to the UDB helper ./InstallFullDB.sh

Run this tool from a bash compatible terminal (on windows like Git Bash)

To configure edit the file ./InstallFullDB.config


10.2 Now we'll need to edit the configuration file to connection to the mysql server, and identify where all the queries are to populate the "mangos" database with the data. This is what the file looks like.
Code:
####################################################################################################
# This is the config file for the './InstallFullDB.sh' script
#
# You need to insert
#   MANGOS_DBHOST:      Your MANGOS database host
#   MANGOS_DBNAME:      Your MANGOS database schema
#   MANGOS_DBUSER:      Your MANGOS username
#   MANGOS_DBPASS:      Your MANGOS password
#   CORE_PATH:          Your path to core's directory (OPTIONAL: Use if you want to apply remaining core updates automatically)
#   ACID_PATH:          Your path to a git-clone of ACID (OPTIONAL: Use it if you want to install recent downloaded acid)
#   MYSQL:              Your mysql command (usually mysql)
#
####################################################################################################

## Define the host on which the mangos database resides (typically localhost)
MANGOS_DBHOST="localhost"

## Define the database in which you want to add clean UDB
MANGOS_DBNAME="mangos"

## Define your username
MANGOS_DBUSER="mangos"

## Define your password (It is suggested to restrict read access to this file!)
MANGOS_DBPASS="mangos"

## Define the path to your core's folder (This is optional)
##   If set the core updates located under sql/updates/mangos from this mangos-directory will be added automatically
CORE_PATH=""

## Define the path to the folder into which you cloned ACID (This is optional)
##   If set the file acid_wotlk.sql will be applied from this folder
ACID_PATH=""

## Define your mysql programm if this differs
MYSQL="mysql"

# Enjoy using the tool

If you changed your username and/or password in step 9.1 then you will have to change "MANGOS_DBUSER="mangos", and/or "MANGOS_DBPASS ="mangos" to the ones you selected. We will also need to change the localation of the ".sql" files we want processed. CORE_PATH="../mangos" and ACID_PATH="../acid"

10.3 Now it's time to populate our database, by executing InstallFullDB.sh again.
Code:
sh ./InstallFullDB.sh

You will see in the terminal all the files that it processes and/or any that fail. If there where no failures our database should be fully populated and up to date.


11. Extract files from the client

In this section we are going to cover, how to compile the tools, transfer the files to our Ubuntu system to be extract from, compile the tools, were to place the files, and how change mangosd.conf to use the map files.

11.1 We need to make a place on our server to place the wow client data and the tools we are going to need to get that data we need from maps. They will consist of "ad", "vmapextractor", "vmapassembler", "MoveMapGen", and "MoveMapGen.sh"  

Code:
cd ~
mkdir wowdata

11.2 We need to copy the tools, "ad", "vmapextractor", "vmapassembler" "MoveMapGen" & "MoveMapGen.sh" to our "wowdata" folder.
Code:
cp ~/build/contrib/extractor/ad ~/wowdata
cp ~/build/contrib/vmap_extractor/vmapextract/vmap_extractor ~/wowdata
cp ~/build/contrib/vmap_assembler/vmap_assembler ~/wowdata
cp ~/build/contrib/mmap/MoveMapGen ~/wowdata
cp ~/mangos/contrib/extractor_binary/MoveMapGen.sh ~/wowdata
cp ~/mangos/contrib/extractor_binary/offmesh.txt ~/wowdata
chmod +x ~/wowdata/MoveMapGen.sh

11.3.1 Now that we have tools built, it time to get the wow data from our Windows system, to our Ubuntu system. We are going to do this using a Windows version of SCP which can be download from this web site WinSCP. Install this on you Windows system
*Note - You can use a portable hard drive or a thumb drive to move the files to the server

11.3.2 Once it is installed, start the application. When it starts a box will come up asking you for to enter information to connect up to your Ubuntu system. For the protocol you can use "SFTP", for Host name: for this tutorial will be the system IP address 192.168.1.10, User name: mangos, and Password: mangos, then click "Login". It may ask you to confirm that you want connect to this unknown system, select yes.

11.3.3 A screen comes up showing your Windows directories on the left, and your Ubuntu directories on the right. On the right side get to the "wowdata" directory. On the left side get to your World of Warcraft directory and just highlight (click once) the "Data" directory. Click on the "Upload" button, and it will show you that it is going to upload the files to "/home/mangos/wowdata/*.*". Click "Ok", and sit back while it transfers the files. This will take some time, so be patient!

11.4 Now that all the files have been transferred to our Ubuntu system, it's time to create the "dbc", "maps", "vmaps", and "mmaps".

11.4.1 First we need to extractor maps from the wow data files. This will create to directories: "Buildings" & "maps"
Code:
cd ~/wowdata
./ad -f 0
./vmap_extractor -l
*Note - The option "-f 0" in the command "./ad" increases the resolution of the map information created, as does the option "-l" after the "./vmap_extractor" command. This will create large map files and take a lot longer to process, and are optional.

11.4.2 Next we are going to create the vmaps.
Code:
mkdir vmaps
./vmap_assembler Buildings vmaps


11.4.3 Next we are going to create the mmaps.
Code:
mkdir mmaps
./MoveMapGen.sh

11.4.3 Last we are going to move our map files to our server directory.
Code:
cp dbc /opt/mangos-server/share
cp maps /opt/mangos-server/share
cp vmaps /opt/mangos-server/share
cp mmaps /opt/mangos-server/share


12. Starting Server

12.1.1 Before we can start our server there is a few thing we need to get done. Lets start by making a copy  of "mangosd.conf.dist" to "mangosd.conf", then editing the "mangosd.conf" file. This file handles the configuration of the world and how it will behave, so take the time to read the comments for each of the parameters. We are going to go over the parameters that are needed to get the server up and running right. The other settings is going to be a matter of preference for how you want your server to behave. Our starting point will be line 62 in the file.  

Code:
cd /opt/mangos-server/etc
cp mangosd.conf.dist mangosd.conf

mangosd.conf file
Code:
RealmID = 1
DataDir = "../share"
LogsDir = "../log"
LoginDatabaseInfo     = "localhost;3306;mangos;mangos;realmd"
WorldDatabaseInfo     = "localhost;3306;mangos;mangos;mangos"
CharacterDatabaseInfo = "localhost;3306;mangos;mangos;characters"
LoginDatabaseConnections = 1
WorldDatabaseConnections = 1
CharacterDatabaseConnections = 1
MaxPingTime = 30
WorldServerPort = 8085
BindIP = "192.168.1.10"

# Log File for SD2-Errors
SD2ErrorLogFile = "SD2Errors.log"

RealmID: - The first line by default will 1 for the RealmID. This must match the realmlist inside the realmd database

DataDir: - This line is where we tell mangosd where the map files are.

LogsDir: - This parameter tell mangosd where we want our log files to be written.

LoginDatabaseInfo, WorldDatabaseInfo, CharacterDatabaseInfo: - These parameters tell mangosd how to connect up to each database in MySQL, and is broken down to "hostname;port;username;password;database". The first part is the IP address of MySQL server. Since MySQL server and mangosd are on the same machine that address needs to be "localhost" or "127.0.0.1", which mean the same.

The next 5 parameters should be just fine the way they are.

BindIP: - This parameter tell mangosd to use that IP Address to listen to for incoming data/connections. It has to match the IP Address that you set the server during the install, and you can check that by typing the following command in the terminal window, which will be "inet addr:" that you are looking for.
Code:
ifconfig

SD2ErrorLogFile: - This parameter is what to name the file that we want all the errors for ScriptDev2 to go to.

12.1.2 The next group of parameters we need check will start at line 230. Here we will be telling mangosd that we are using vmaps & mmaps
Code:
vmap.enableLOS = 1
vmap.enableHeight = 1
vmap.ignoreSpellIds = "7720"
vmap.enableIndoorCheck = 1
DetectPosCollision = 1
TargetPosRecalculateRange = 1.5
mmap.enabled = 1
mmap.ignoreMapIds = ""
UpdateUptimeInterval = 10
They should be enabled by default, but check just the same

The rest of the parameter just governor how the world behaves. Once you have your server is up and running, take the time to go down through the entire file and read the commenting for each parameter. They are well done.

*Note - Take the time to read the commented lines. They explain very well what each parameter controls

12.1.3 Next we need to rename & edit the "realmd.conf.dist" file.

Code:
cd /opt/mangos-server/etc
cp realmd.conf.dist realmd.conf
vim realmd

realmd.conf
Code:
LoginDatabaseInfo = "localhost;3306;mangos;mangos;realmd"
LogsDir = "../log"
MaxPingTime = 30
RealmServerPort = 3724
BindIP = "192.168.1.10"
PidFile = ""
LogLevel = 0
LogTime = 0
LogFile = "Realmd.log"
LogTimestamp = 1
LogFileLevel = 0
LogColors = ""
UseProcessors = 0
ProcessPriority = 1
WaitAtStartupError = 0
RealmsStateUpdateDelay = 20
WrongPass.MaxCount = 0
WrongPass.BanTime = 600
WrongPass.BanType = 0

At line 110 "LoginDatabaseInfo = "localhost;3306;mangos;mangos;realmd"", we will need to change the dirst "mangos" to the user you have setup, and second "mangos" to the password you have chosen.

At line 111 "LogsDir =" we need to identify where we want our realmd log to be to. For this example we have chosen the "log" folder. (../log)

At line 114 "BindIP =" we need to set the IP address that realmd needs to listen to for clients logging on. Is this example it is 192.168.1.10.

At line 118 "LogFile =" we want to select a name for our realmd log file. This can be any name you would like.

*Note - Take the time to read the commented lines. They explain very well what each parameter controls


12.2.1 We now want to create scripts to start "mangosd". I chose to do it at the home directory of user
Code:
cd ~
vim mangosd.sh

mangosd.sh
Code:
cd /opt/mangos-server/bin
./mangosd -c ../etc/mangosd.conf

12.2.2 We now want to do the same for "realmd"
Code:
cd ~
vim realmd.sh

realmd.sh
Code:
cd /opt/mangos-server/bin
./realmd -c ../etc/realmd.conf

12.3 Now we can start our server. It is a bit different between "Desktop" version and "Server".

12.3.1a For the "Desktop" version we will want to open up two terminals in the first terminal we want to execute the command;
Code:
sh ./mangosd.sh

And in the second terminal we want to execute the command;
Code:
sh ./realmd.sh

12.3.1b For the "Server" version we need to create two log in terminals to run both executables. The first one you we open "tty1", by pressing the key <Ctrl>+<Alt>+<F1>. Login with your "mangos" user and issue the same command as you would in the "Desktop" version.

Now we need to login into tty2, by pressing the keys <Ctrl>+<Alt>+<F2>. Login with your "mangos" user and issue the same command as you would in the "Desktop" version.

If we didn't have any errors on start up, our server is ready to have the client connect.


13. Editing WoW client to connect to the server.

13.1 On our Windows machine we need to change the realm list. On a standard installation on Windows 7 it should be located at "C:\Program Files (x86)\World of Warcraft\", or, "C:\Program Files (x86)\World of Warcraft\Data\enUS", and the file name is realmlist.wtf. We are going to edit it with notepad. The two lines that we want to change is;
Code:
set realmlist 192.168.1.10
set patchlist 192.168.1.10

13.2 Next we need to change what file our World of Warcraft desktop icon starts. Right click on the desktop icon, and select Properties. Change target from;
Code:
C:\Program Files (x86)\World of Warcraft\Launcher.exe
to;
Code:
C:\Program Files (x86)\World of Warcraft\WoW.exe


14. Creating a WoW user account

14.1 On our server, in the window that is running "mangosd", press the <Enter> key, and type;
Code:
account create [username] [password]
[username] being the user name you want to use to log into WoW, and [password] the password you want to choose.

14.2 Now we need to set the expansion of the user to WotLK, and they are numbered as such.

   0) Classsic

   1) The Burning Crusade

   2) Wrath of the Lich King

   3) Cataclysm

Code:
account set addon [username] 2
[username] being the name you created the step before, and the number "2" is to identify that it is WotLK.

14.3 We are now going to set the user's GM level to be able to use "in game" GM commands.


   0) Player

   1) Moderator

   2) Game Master

   3) Administrator

Code:
account set gmlevel [username] 3

14.4 Now you are ready to log in to the game with your new Administrator account. The list of command that you can issue "in game" are kept in the database "mangos", in the table "command". There is also short description of the function of the command. When you issue a command in the chat box, you have to proceed it with a period...example;
Code:
.commands
This will list the available commands in the chat box.


15. Database maintenance (Optimize, Backup, Restore, & Clear)

15. In this section we are going to cover the maintenance of our database. To do maintenance we need to shutdown 'mangosd' & 'realmd'. On the server, In the terminal you have 'mangosd' running press the <Enter> key and type:
Code:
server shutdown 0
Then press <Enter> key. It should reply that it is terminating, and may or may not complain that it has a segmentation fault. The fault does not appear to create any issues, so don't worry about it.

Next shutdown 'realmd', Go to the terminal 'realmd' is running in and press the keys <Ctrl> + c, and 'realmd' will terminate.  

Next we need to open a browser and enter in the address bar:
Code:
192.168.1.10/phpmyadmin

Log in and the following screen will appear.

[Image: attachment.php?aid=131]


15.1 Optimize  First thing we are going to do is optimize the database. Because we did all the database update queries when we were filling the database, our database is a little disorganized. Click on the database 'mangos', and it will expand to show all the tables in the database. On the right hand side it will show information on all the tables for mangos. In the far right column 'Overhead' will show you the amount of overhead there is for each table. As you scroll down to the bottom, it will show you the total amount of overhead.

At the bottom of the right screen on the left hand side  there is a check box "Check All / Check tables having overhead", check this box off. Just to the right of that there is a pull down box "With selected:". Open the pull down and select "Optimize Table". It will execute the command, and when finished it will display information on the operation. At the very top below the tabs you should see a yellow box stating "Your SQL query has been executed successfully". Just below that it will display the SQL query that it performed to optimize. Below that will list status of each database table.

To get back to the table list of database mangos, we can either click on the tab "Structure" or on the left side click on database mangos. If you look on the right side and scroll down, you should see that the overhead it now zero.

15.2 Backup  Time to make a backup of all the databases. Click on the database 'characters' in the left side of phpmyadmin screeen. On the right side click on the tab 'Export'. Click on 'Custom - display all possible options'. All the table should be highlighted, if not click on 'Select All'. In the section 'Output:' in the box 'File name template' at the end of '@DATABASE@' add date or any other identifier to help identify version you are backup. Scroll down to the last section 'Data database options'. In the box 'maximal length of created query' increase the number. This prevents a very large query from being truncated. Click on the 'Go' button. A box will come up asking you where you want to view or save the file. Click on 'Save File' and click 'OK'. Now select the location that you want to save the file.

Perform the same procedure for the databases 'mangos' and 'realm'. Now you have a full copy of your databases.

*Note If you want to be able to drop the table and re-create them in case there is a database structure change, select the options in 'Object creation options', 'Add CREATE DATABASE / USE statement' and 'Add DROP TABLE / VIEW / PROCEDURE / FUNCTION /EVENT statement'.

15.3 Restore To restore your database, select the database you want to restore on the left hand side of the 'phpmyadmin' page. Click on the 'Import' tab on the top right hand side. Click on the 'Browse...' button and select the corresponding file, and click the 'Go' button.  

*Note The same is done for all the databases.

15.4 Clear The clear function keeps the database and table structure intact, but empties the table of any data. To do this select the database that you want to clear. Make sure on the right side you have the tab 'Structure selected. You can select the table or tables you want or you can select all tables at the bottom of the table structure list 'Check All / Check tables having overhead'. In the box just to the right, select 'Empty'. It will immediately ask you if you are sure you want to 'Truncate' the table(s). If you click 'Yes' it will empty all the tables that you selected.

*Note If you want to remove the table completely, select 'Drop' instead of 'Empty'.


Attached Files Thumbnail(s)
   
[-] The following 6 users say Thank You to adellaci for this post:
  • Beerfish, Lankytim, Castro, Tyler, Issuntril, hawkwynd
Reply
Post: #3
Good work.

I thought since the guide is aimed at beginners, perhaps you might make a mention of:
- how to "edit" a text file in a non-desktop Ubuntu environment (eg: vi, or does it come with nano?)
- how to use, say, PuTTY to connect to the SSH server from a PC (maybe you were going to cover this later in your guide, using scp to transfer extracted client files from a Windows PC...)

No sys admin cheat sheet is complete without a note on how to do backups Smile How about a brief section on using mysqldump to backup/restore the characters and realmd DB? On second thought, you've already set them up with phpMyADmin which I suppose can be used for that!

Were you going to cover start/stop scripts (either initd or systemd)?
[-] The following 1 user says Thank You to Lankytim for this post:
  • adellaci
Reply
Post: #4
What do you think about a quick mention of basic hardware requirements, specifically the disk space required for the extracted client files? I'm old so I still think 5+GB is noteworthy lol. It could be significant for some small VPS plans, perhaps? Anyway it would be disappointing to get all the way through the guide, only to run out of space for mmaps.
[-] The following 1 user says Thank You to Lankytim for this post:
  • adellaci
Reply
Post: #5
Thank you for the input Lankytim.

Quote:- how to "edit" a text file in a non-desktop Ubuntu environment (eg: vi, or does it come with nano?)

Yes i plan on covering text file editing. Ubuntu server comes with both vi and nano. I, myself prefer vim. Very mush the same as vi, but with more functions


Quote:- how to use, say, PuTTY to connect to the SSH server from a PC (maybe you were going to cover this later in your guide, using scp to transfer extracted client files from a Windows PC...)

I was going to cover that in the "11. Extract files from the client" section. I'll have to try both to see which is the simplest. There is also WinSCP. For me, my desktop computer is a Ubuntu/Windows dual boot. I start Ubuntu, mount my Windows partition, and scp to copy files over to the server.


Quote:No sys admin cheat sheet is complete without a note on how to do backups Smile How about a brief section on using mysqldump to backup/restore the characters and realmd DB? On second thought, you've already set them up with phpMyADmin which I suppose can be used for that!

I hadn't thought about backup/restore. I guess I should add that to it. I do use phpMyAdmin to do my backups.


Quote:Were you going to cover start/stop scripts (either initd or systemd)?

I was planning on covering a start script, never gave a thought to having it start on machine boot. I guess I’ll need to research that.



Quote:What do you think about a quick mention of basic hardware requirements, specifically the disk space required for the extracted client files? I'm old so I still think 5+GB is noteworthy lol. It could be significant for some small VPS plans, perhaps? Anyway it would be disappointing to get all the way through the guide, only to run out of space for mmaps.

No I was not planning on it, because I have always had plenty of hard drive space, but it is a good point, I suppose I should consider it.
Reply
Post: #6
Lankytim, do you have a Ubuntu system you can try the instructions on?
Reply
Post: #7
Not currently. Debian Jessie is what I run (looks like it should be very similar).

I could run up a fresh Ubuntu VM and try it, but won't get a chance to do that for perhaps 1wk.
Reply
Post: #8
(06-21-2016, 09:05 AM)Lankytim Wrote: Not currently.  Debian Jessie is what I run (looks like it should be very similar).

I could run up a fresh Ubuntu VM and try it, but won't get a chance to do that for perhaps 1wk.


It should be very close to Ubuntu. It is base on Debian.
Reply
Post: #9
Has anybody reviewed the procedure?
Reply
Post: #10
I actually i'm in the process of going through this guide and setting it up on latest Ubuntu box.
I've been away from the scene for a long time so just picking this up for the first time in a year or so.

There are some minor details / preferences that could be fixed/added....

I added a data folder and a logs folder in section 8.1 for use later on.
Code:
sudo mkdir /opt/mangos-server/data
sudo mkdir /opt/mangos-server/logs

Section 9.4 ... typos at the end of the paragraph that messed up the code! Smile
Code:
cd ~/mangos/sql/scriptdev2
mysql -umangos -pmangos mangos < scriptdev2.sql


I'd would like to see a bit more detail regarding the .conf files and getting them setup....especially for setting the IP for lan play and possibly external access for friends.
Also found out that the conf files must go in the /etc folder...i had originally moved them to the /bin and was having issues till I found another post mentioning to leave them there.

Code:
cp /opt/mangos-server/etc/realmd.conf.dist /opt/mangos-server/etc/realmd.conf
cp /opt/mangos-server/etc/rmangosd.conf.dist /opt/mangos-server/etc/rmangosd.conf
cp /opt/mangos-server/etc/ahbot.conf.dist /opt/mangos-server/etc/ahbot.conf

I updated the Data folder and Logs folder in the conf files
realmd.conf
Code:
LogsDir = “/opt/mangos-server/logs”

mangosd.conf
Code:
Datadir = “/opt/mangos-server/data”
LogsDir = “/opt/mangos-server/logs”

Now i'm working on figuring out how to get the files extracted to copy up to the data folder


Urlryn
[-] The following 1 user says Thank You to Urlryn for this post:
  • adellaci
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [TBC] TBC-DB proper install method? No item loot from ceratures! mrC 1 612 10-17-2016, 05:11 PM
Last Post: JoseQ
  Classic - Ubuntu - Make errors nexmorbus 8 1,735 04-18-2016, 11:04 PM
Last Post: nexmorbus
  [CLASSIC] ubuntu gdb ivin 0 1,062 10-12-2015, 06:57 AM
Last Post: ivin
  [WOTLK] Compilation error on Ubuntu 12.04 Vladskywolf 4 2,210 09-22-2015, 03:20 PM
Last Post: evil@wow
  [ALL] Instalation instructions SADraco 1 1,521 09-21-2015, 01:59 PM
Last Post: cala
  [CLASSIC] Fresh Install - SQL scripting issue? pillbug22 2 1,661 09-16-2015, 01:20 AM
Last Post: pillbug22
  [WOTLK] Successful Install Yllidor 4 2,555 07-30-2015, 09:28 PM
Last Post: Yllidor
  [CLASSIC] [FIXED] Fresh install database error Viela 3 2,864 07-21-2015, 09:36 AM
Last Post: goandgo
  [CATA] How to install the UDB database? yyelloww 4 3,160 05-23-2015, 09:29 PM
Last Post: Marco
  [CLASSIC] [Fixed] Much errors after fresh install and Starting Dainara 5 3,416 01-09-2015, 11:04 AM
Last Post: cala

Forum Jump:


Users browsing this thread: 3 Guest(s)

Continued MaNGOS | Return to Top | | Lite (Archive) Mode | RSS Syndication