Skip to content

Installation Instructions

Muehe edited this page Nov 13, 2024 · 214 revisions

Installation Instructions

How to install C(ontinued)-MaNGOS from scratch and apply the latest updates.

This guide will help you for Windows, *nix (Ubuntu, Debian), and MacOS (11.1), and for all supported clients: Classic - TBC - WotLK.

Instructions covering older versions of Mac OS X (10.6 & 10.7) specific steps are available here in addition of this guide.

For other environments (like FreeBSD, ARM and similar), consider reaching out on Discord for assistance.

These installation instructions are expected to be current, so please read through every step again to ensure that you didn’t skip or misunderstand something before going to Discord for help.

If you run into issues during installation or need help understanding one of the following steps, please visit Discord to look for solutions and ask questions.

If you are an absolute beginner to programming and compiling then you may want to go through the Beginner’s Guide first.

Software requirements (General)

Game client of:

  • World of Warcraft Classic (1.12.x) for cmangos-classic

  • World of Warcraft TBC (2.4.3) for cmangos-tbc

  • World of Warcraft WotLK (3.3.5a) for cmangos-wotlk

Software requirements (Windows)

Install with Chocolatey:

choco install -y git cmake make boost-msvc-14.1 vcredist-all mysql vscode dbeaver
Notes:
  • You’ll need to add cmake to PATH after installing. Default install location is C:\Program Files\CMake\bin.

  • You also need to add BOOST_ROOT to your environment variables. Boost is located in C:/local/boost_SOMEVERSION.

Install manually:

  • Git - Ensure the "Windows Explorer Integration - Git Bash Here" option is enabled on the "Select Components" page of the install wizard in order to follow along with these instructions. The default options should be fine otherwise. Alternatively, you can install (Git Extensions instead, which comes with Git, MySYSGit, and KDiff).

  • CMake is now used to generate visual studio project file as it’s are not provided anymore. Using version 3.22.1 or newer is encouraged.

  • Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries. Using version 1.75.0 or newer is encouraged. If you see the error "Could NOT find Boost" in CMake, your version of Boost may be incompatible. Check the compatibility table.

  • Visual C++ 2022 or newer: Visual Studio Downloads (Visual Studio Community 2022 is recommended, but Express 2022 for Desktop will also do the job and is free, it is however not as good a choice for open source development as CE (Community Edition).

  • Any MySQL server such as MySQL server community edition or XAMPP.

  • Any MySQL client (optional, for easy database access) such as MySQL Workbench, SQLyog, or DBeaver

  • An advanced text editor (optional) such as Notepad++ or VSCode. Not required, but it will make it easier to edit the configuration files in later steps.

You can find a video here of how to install Git, Visual Studio and CMAKE.

Software requirements (*nix)

You will need Git, GCC, CMake, MySQL, Boost and a few libraries.

Ubuntu (20.04)

sudo apt install build-essential gcc g++ automake git-core autoconf make patch libmysql++-dev mysql-server libtool libssl-dev grep binutils zlibc libbz2-dev cmake libboost-all-dev

Ubuntu (22.04)

sudo apt install build-essential gcc g++ automake git-core autoconf make patch libmysql++-dev mysql-server libtool libssl-dev grep binutils zlib1g-dev libbz2-dev cmake libboost-all-dev

Default GCC 11 versions present in Ubuntu 22.04 (11.2 and 11.3) contain internal compiler bug, which prevents building CMaNGOS. While GCC 11.3 is known to work for some users, it is recommended to upgrade your default compiler version to GCC 12 to avoid potential problems, although some reports indicate that the bug is present for GCC 12 as well:

sudo apt install g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 --slave /usr/bin/g++ g++ /usr/bin/g++-12

Debian

apt install grep build-essential gcc g++ automake git-core autoconf make patch cmake libmariadb-dev libmariadb-dev-compat mariadb-server libtool libssl-dev binutils zlibc libc6 libbz2-dev subversion libboost-all-dev

Fedora

dnf install epel-release
dnf install git make cmake gcc g++ mariadb-server mariadb-devel libtool boost-devel boost-static

RockyLinux/AlmaLinux/Oracle Linux

dnf config-manager --set-enabled crb
dnf install git make cmake gcc g++ mariadb-server mariadb-devel libtool boost-devel boost-static

Arch Linux

pacman -Syu base-devel git cmake mariadb mariadb-libs boost boost-libs

Note: precompiled headers require a cmake that is version 3.16 or newer. You can compile from source or get binary releases on this page: https://cmake.org/download/

Note: Some distributions ship with very old but guaranteed stable packages. CMaNGOS may require more recent versions of these packages.

Note: CMaNGOS links against static Boost libraries. Make sure you have static Boost libraries installed.

Software requirements (MacOS)

You will need Xcode and Homebrew installed to follow this guide.

Install dependencies as follows

xcode-select --install
brew install cmake boost mysql@5.7

Essentials

CMaNGOS

is the server, also called "core", which manages all the game inquiries and accesses your SQL database to get the information needed.

ScriptDev2

is a library consisting of C++ scripts that handles special world events and quests, as well as complex dungeon & raid encounters. AS OF 11/1/2015 ScriptDev2 HAS BEEN INTEGRATED INTO THE "CORE"

ACID

stands for "Advanced Creature Intelligence Database". Also referred to as "EAI" (EventAI). It is data that defines and handles the behaviors of most creatures in the world. ACID, DBScripts, and ScriptDev2 all complement each other, so you should consider all three options when creating scripts. AS OF 10/2016 ACID HAS BEEN INTEGRATED INTO THE "DATABASES"

The "world db" in the context of a CMaNGOS installation is usually referring to the database which contains all of the content of the game world run by CMaNGOS.

CMaNGOS databases

cMaNGOS provides 3 different content databases depending on the core version:

World Of Warcraft Client

is a client to connect to the server. It’s your own copy of the game.

Tools

Git

is a free distributed revision control or source code management tool which allows you to easily manage a virtual filesystem. With this tool, you can download or "clone" the CMaNGOS code.

CMAKE

its the most used tools that help to keep this project cross-platform.

Microsoft Visual Studio

is used to created, modify and compile the code using C and C++ programming languages. With this tool, you’ll compile CMaNGOS and ScriptDev2 on Windows.

MySQL server

is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. After you’ve created the databases and imported the data, they will contain your entire world for World of Warcraft.

MySQL client

allows you to connect to the MySQL server by providing an easy-to-use interface to import and change the data in the database.

How things fit together

The following parts exist:

  • Server services: The binary files mangosd(.exe) and realmd(.exe) manage the communication with the client

  • World database: This database is filled by the database provider and contains content like NPCs, quests and objects

  • Characters database: Contains the information about characters like player-name, level and items

  • Realmd database: This database contains account-information (account-name, password and such)

  • Client: Which will, with adapted realmlist, connect to your server

Get the remote data to your system

It is a good idea to start off your installation with some basic directory structure. See the below options depending on your operating system and follow along.

For Windows

For this guide we will assume that you will use C:\Mangos as base directory under which you put everything.

All shell commands are expected to be typed from a Git bash started from the C:\Mangos directory. To do so, right-click onto C:\Mangos in the windows explorer, and select Git bash here from the context menu.

For *nix

Create a new directory to clone your copy of CMaNGOS into:

cd ~ && mkdir cmangos && cd ~/cmangos

The rest of the guide assumes that you have this folder in your home directory.

Clone CMaNGOS

To make the guide more consistent across the versions we’re cloning into another subdirectory named "mangos". If you leave the "mangos" part out of the argument, it’ll be cloned into a directory named like the git repository (mangos-wotlk for example)

After having opened Git bash in the right folder, simply type:

  • Classic:

    git clone https://github.com/cmangos/mangos-classic.git mangos
  • The Burning Crusade:

    git clone https://github.com/cmangos/mangos-tbc.git mangos
  • Wrath of the Lich King:

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

Submit this git command with enter/return. This will take a little time to complete, but afterwards you will have created a sub-directory named mangos into which the CMaNGOS sources are cloned.

A simple video of the process

Clone database for your CMaNGOS version

Classic-DB

  • Open C:\Mangos with git bash.

    git clone https://github.com/cmangos/classic-db.git

This will create a new subfolder classic-db in which the Classic-DB SQL-files are located.

TBC-DB

  • Open C:\Mangos with git bash.

    git clone https://github.com/cmangos/tbc-db.git

This will create a new subfolder tbc-db in which the TBC-DB SQL-files are located.

WotLK-DB

  • Open C:\Mangos with git bash.

    git clone https://github.com/cmangos/wotlk-db.git

This will create a new subfolder wotlk-db in which WOTLK-DB SQL-files are located.

Directory structure

Now you should have the following subfolders:

  • mangos (containing the sources of CMaNGOS)

  • classic-db OR tbc-db OR wotlk-db OR Database containing the content of your database-provider

For windows we suggest creating an additional run folder, on *nix and MacOS this can be useful if you don’t want to install to /opt

  • run

For *nix, MacOS, or cmake compile we suggest creating an additional build folder, this is not required for Visual Studio

  • build

Compiling CMaNGOS

Installing and Configuring boost (*nix and MacOS)

The CMaNGOS cmake scripts should automatically detect the location of your boost installation, and configure the build accordingly. If it is not detected, please ensure that your BOOST_ROOT environment variable is set properly.

On most *nix you just have to install boost development libraries from your distribution package repositories.

On Debian and Ubuntu you can simply install the libboost-all-dev meta-package. On Fedora there should be a package named boost-devel (untested). If you followed the Software requirements (*nix) step above you should have the respective package installed already.

On MacOS, add the boost path as an environment variable

echo "export DYLD_LIBRARY_PATH=/usr/local/opt/boost/lib:DYLD_LIBRARY_PATH" >> ~/.zshrc"
source ~/.zshrc

For instructions on how to compile boost from source code or general information, see the boost Getting Started guide.

Installing and Configuring boost (Windows)

Video Guide
Step-by-step Guide
  • Go to https://sourceforge.net/projects/boost/files/boost-binaries

  • Or compile yourself

    • boost version older than 1.66 will throw "unknown compiler" errors when using VS 2017, ignore it.

  • Download the correct version as indicated in the table below or the boost_x_xx_x-bin-msvc-all-32-64.7z (the x_xx_x part is the boost version). If you need the Win32 or x64 version depends on what architecture you would like your compiled server executable to use. For most people x64 is fine.

    • Note: This has nothing to do with your Windows version, apart from the fact that 64bit executables will not run on a 32bit Windows. It is very unlikely you have a 32bit OS but if you want to make sure that you have a 64bit one press <Win>+<Pause>.

    • Note: You can install both the Win32 and the x64 binaries into the same directory, in case you want to switch build architectures. Visual Studio will automatically select the correct version.

Win32 x64

VS 2015

boost_x_xx_x-msvc-14.0-32.exe

boost_x_xx_x-msvc-14.0-64.exe

VS 2017

boost_x_xx_x-msvc-14.1-32.exe

boost_x_xx_x-msvc-14.1-64.exe

VS 2022

boost_x_xx_x-msvc-14.3-32.exe

boost_x_xx_x-msvc-14.3-64.exe

  • Install the downloaded binaries.

  • Go to the PC Properties (press <Win>+<Pause>)

  • Click on Advanced System Settings

  • Click on Environment Variables

  • At the bottom under System variables click New

    • Name: BOOST_ROOT

    • Value: C:\local\boost_x_xx_x Replace the x with the version number you downloaded, e.g. boost_1_75_0.

      • If you changed the path while installing the binaries, you will have to do that here as well.

    • Confirm

  • To make sure all programs are aware of the added environment variable reboot your system.

Additional remarks regarding boost for advanced users (Windows)

If you are not using cmake, the built-in project files assume that BOOST_ROOT environment variable is set.

If you have already boost in another folder schema you can also define BOOST_LIBRARYDIR to point to the right folder. Then only win32 or x64 will work according to the file you have on that folder. Point BOOST_LIBRARYDIR to the folder where the dll and lib files are, usually a subfolder of your boost root folder, e. g. the subfolder lib32-msvc-14.1.

If you are using cmake to generate a solution and project files, the CMaNGOS cmake scripts should automatically detect the location of your boost installation, and configure the build accordingly. If it is not detected, please ensure that your BOOST_ROOT environment variable is set properly.

For instructions on how to compile boost from source code or general information, see the boost Getting Started guide.

Note: In a typical boost installation environment with Visual Studio, the user will configure their Visual Studio property sheets to point to the boost installation. This will allow boost to be found by all projects on that system. For information on configuring property sheets, look here.

If you’re experiencing issues with CMake (The following Boost libraries could not be found), you will have to rename folder in boost directory.

(boost\lib32-msvc-14.1 -> boost\lib)

Compiling CMaNGOS (Windows)

A video of the build process is now available.

  • Launch cmake

  • Set the source bin to C:\Mangos\mangos

  • Set the destination folder to C:\Mangos\mangos\bin\buildir (create that folder if it doesn’t exist)

  • Tick BUILD_EXTRACTORS in CMake (Buildings / Cameras / dbc / maps / mmaps / vmaps)

  • Click Configure button and set your compiler version and platform (note: platform is set to Win32 by default. Set it to x64 if you’re using 64bit Windows.)

  • Select your options then click another time on Configure button

  • Click Generate button

  • If you get any errors messages run File → Delete Cache and try to configure CMake again.

  • Now you can click on Open button or go to C:\Mangos\mangos\bin\buildir and click on the .sln file

  • Wait for Visual Studio to finish loading.

  • Open the menu "Build" → "Configuration Manager"

    • Choose "Release" in the drop down box for "Active Solution Configuration"

    • The drop down box "Active Solution Platform" should be set to "Win32" by default. Change it to "x64" if you want to compile 64bit executables. (This setting has to correspond with the boost version you installed.)

    • Close the window

  • Click the menu "Build" → "Build Solution"

    • This will take some time.

    • You might get some warning messages. Don’t worry about it, that’s normal.

    • You must not get any error messages, although if you do so, you could click the menu "Build" → "Clean Solution" to restart the compile.

    • If you get error messages saying some boost files cannot be found, you may need to restart your Visual Studio and/or your computer for the environment variables to be set.

If you cannot solve an error, please join the discord to ask for help

Compiling CMaNGOS (*nix & MacOS)

We assume you have followed the instructions above and cloned the core repository into ~/cmangos/mangos. Adjust the paths if your setup is different.

  • Create the build folder:

    mkdir ~/cmangos/build
  • Enter the build folder:

    cd ~/cmangos/build
  • Invoke cmake ../mangos, suggested options are:

    • -DCMAKE_INSTALL_PREFIX=~/cmangos/run to install into /home/username/cmangos/run folder, otherwise it will install to /opt/mangos by default.

    • -DPCH=1 to compile with PCH mode (much faster after updates).

    • -DDEBUG=0 to remove debug mode from compiling (recommended)

    • -DBUILD_PLAYERBOTS=ON to build with playerbots enabled

    • Switch compiler (for problems such as the internal compiler error in gcc 11/12):

      • -DCMAKE_C_COMPILER=/path/to/compiler

      • -DCMAKE_CXX_COMPILER=/path/to/compiler

    • Examples:

      • Just want to compile CMaNGOS (e.g. for updates)

        cmake ../mangos -DCMAKE_INSTALL_PREFIX=~/cmangos/run -DPCH=1 -DDEBUG=0
      • Want compile CMaNGOS & the map extraction tools (recommended for first time setup)

        cmake ../mangos -DCMAKE_INSTALL_PREFIX=~/cmangos/run -DBUILD_EXTRACTORS=ON -DPCH=1 -DDEBUG=0
      • Want compile CMaNGOS & the map extraction tools & playerbots (playerbots let players summon other characters from their account as bots)

        cmake ../mangos -DCMAKE_INSTALL_PREFIX=~/cmangos/run -DBUILD_EXTRACTORS=ON -DPCH=1 -DDEBUG=0 -DBUILD_PLAYERBOTS=ON
      • Want to switch to clang

        cmake ../mangos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
  • Invoke make to compile CMaNGOS and ScriptDev2

    make
    • You may define the number of threads for faster compilation (e.g. make -j8 for 8 threads)

    • There is currently a bug in GCC 11 and possibly GCC 12 which causes GCC to fail compiling CMaNGOS. You can downgrade or upgrade GCC to circumvent this, or you can compile CMaNGOS with a different compiler like clang

  • Copy the compiled files to the installation directory (~/cmangos/run) by running the following command:

    make install
  • Go the configuration directory and copy the config files to their correct names:

    cd ~/cmangos/run/etc
    cp mangosd.conf.dist mangosd.conf
    cp realmd.conf.dist realmd.conf
    cp anticheat.conf.dist anticheat.conf

Install CMaNGOS binary files (Windows)

  • Transfer the files from your compile folder (likely C:\Mangos\mangos\bin\Win32_Release) into C:\Mangos\run

  • Go to C:\Mangos\mangos\src\game\AuctionHouseBot and copy ahbot.conf.dist.in to C:\Mangos\run and rename it to ahbot.conf

  • If you compiled project with the PlayerBots enabled, go to C:\Mangos\mangos\src\game\PlayerBot and copy playerbot.conf.dist.in to C:\Mangos\run and rename it to playerbot.conf

Extract files from the client

Note: The CMaNGOS project does not supply the retail client files. You must source your own copy of that software.

Note: The extractors are compiled only if you pass the -DBUILD_EXTRACTORS=ON option to cmake during compilation.

Note that extracting mmaps might take a long time depending on your CPU, you will want to give it as many CPU cores as you can. While mmaps are optional, their use is advised, as they improve AI pathfinding. You will be prompted whether you want to extract them or not by the extraction script.

Note: The extractors work only on the system on which they are compiled on. If you have your client files on Windows but built CMaNGOS on Linux, you can download pre-compiled Extractors depending on your version from:

Extraction on Windows

  • Copy the content of C:\Mangos\mangos\bin\Win32_Release\Extractors\ into your C:\World of Warcraft folder

  • Run ExtractResources.sh from your C:\World of Warcraft.

For this you can open a "Git Bash" on your C:\World of Warcraft folder and type ExtractResources.sh

Depending on your installation settings, a simple double click onto the ExtractResources.sh file from your explorer might also work.

  • When finished, move the folders maps, dbc, and vmaps - optionally mmaps, CreatureModels and Cameras - that have been created in your C:\World of Warcraft to your C:\Mangos\run (the buildings folder is not required and can be deleted).

Extraction on *nix and MacOS

If you followed this guide you should find all the extractor files in ~/cmangos/run/bin/tools.

  • Copy all of them over to your WoW client directory

  • Set the executable flag on the shell scripts:

    chmod +x ExtractResources.sh MoveMapGen.sh
  • Make sure the Data directory starts with an uppercase D because extraction is case-sensitive on Linux

  • Run the data extraction:

    bash ./ExtractResources.sh
  • When finished, move the folders maps, dbc, and vmaps - optionally mmaps, CreatureModels and Cameras - that have been created to ~/cmangos/run/bin (the buildings folder is not required and can be deleted).

Further Information:

Install databases

For this section it is assumed you have already installed your MySQL server, and have a password for "root" user.

Following instruction are still working but included tool in database repository can now handle a full installation of the DB

To make use of some additional installation helper scripts it is HIGHLY suggested when installing MYSQL you include the command path to the BIN folder (Option during Install). If this option was not available or if you missed it please follow the instructions found here before proceeding. If you don’t have this configured properly then you will not be able to follow along with the command-line steps below in the guide because the command prompt will not recognize "mysql" as a valid command.

Deprecation Notice:

The following instructions about installing the database are deprecated as they have been automated in the ./InstallFullDB.sh script. They will remain in the installation instructions for the purpose of troubleshooting.

When you have downloaded the database repo for the respective server version you can run ./InstallFullDB.sh at any point after having set up your MySQL server. The script will guide you through the process of creating everything and basically has a "do everything" button. Depending on how you set up your MySQL server you may have to run the script as root or with sudo sudo ./InstallFullDB.sh. I recommend leaving all settings on default and letting it auto-detect the core path. If you want to increase the security of your CMaNGOS setup you can later manually change the password for the automatically created mangos user, which has the password mangos by default. If you have any problems with this step, please join the Discord and ask, or open an issue on GitHub.

Please skip ahead to Configuring CMaNGOS!

Create empty databases

Either use a GUI tool for mysql and open the SQL-files, or do it by command-line as this guide shows.

From the C:\Mangos folder invoke (in Git bash):

  • mysql -uroot -p < mangos/sql/create/db_create_mysql.sql

    And enter your password in the following dialogue (similar in all other next steps)

    This will create a user (name mangos, password mangos) with rights to the databases "mangos" (world-db), characters and realmd

Initialize world database:

From the C:\Mangos folder invoke (in Git bash):

  • mysql -uroot -p classicmangos < mangos/sql/base/mangos.sql

If you’re working with mangos-tbc:

  • mysql -uroot -p tbcmangos < mangos/sql/base/mangos.sql

If you’re working with mangos-woltk:

  • mysql -uroot -p wotlkmangos < mangos/sql/base/mangos.sql

    This will create an empty world database.

Initialize characters database:

From the C:\Mangos folder invoke (in Git bash):

  • mysql -uroot -p classiccharacters < mangos/sql/base/characters.sql

If you’re working with mangos-tbc:

  • mysql -uroot -p tbccharacters < mangos/sql/base/characters.sql

If you’re working with mangos-woltk:

  • mysql -uroot -p wotlkcharacters < mangos/sql/base/characters.sql

    This will create an empty characters database.

Initialize logs database:

From the C:\Mangos folder invoke (in Git bash):

  • mysql -uroot -p classiclogs < mangos/sql/base/logs.sql

If you’re working with mangos-tbc:

  • mysql -uroot -p tbclogs < mangos/sql/base/logs.sql

If you’re working with mangos-woltk:

  • mysql -uroot -p wotlklogs < mangos/sql/base/logs.sql

    This will create an empty logs database.

Initialize realmd database:

From the C:\Mangos folder invoke (in Git bash):

  • mysql -uroot -p classicrealmd < mangos/sql/base/realmd.sql

If you’re working with mangos-tbc:

  • mysql -uroot -p tbcrealmd < mangos/sql/base/realmd.sql

If you’re working with mangos-wotlk:

  • mysql -uroot -p wotlkrealmd < mangos/sql/base/realmd.sql

    This will create an empty realmd database.

Metrics database:

For real-time metrics we suggest looking into InfluxDB and Grafana. The core supports posting HTTP data to a websocket in InfluxDB format.

In the configuration file all that is required is to fill out the following based on your connection in mangosd.conf:

Metric.Enable = 0

Metric.Address = "127.0.0.1"

Metric.Port = 8086

Metric.Database = "perfd"

Metric.Username = ""

Metric.Password = ""

The rest of the information can be found in the appropriate InfluxDB and Grafana documentations, which are well maintained.

Fill world database:

Support for cmangos databases.

From the C:\Mangos folder invoke (in Git bash or depending on installation with double-click!)

  • cd classic-db, cd tbc-db OR cd wotlk-db (choose the one appliciaple to your situation)

  • ./InstallFullDB.sh

    This will create a config file named "InstallFullDB.config", looking like:

    ####################################################################################################
    # 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
    #   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 DB
    MANGOS_DBNAME="classicmangos" **("tbcmangos" if you're working with mangos-tbc)**
    
    ## 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
    ##   If set the core updates located under sql/updates/mangos from this mangos-directory will be added automatically
    CORE_PATH=""
    
    ## Define your mysql programm if this differs
    MYSQL="mysql"
    
    # Enjoy using the tool
  • Change configuration in any text-editor

    With the default configuration, you only need to change CORE_PATH to:

    CORE_PATH="/c/Mangos/mangos"
    (for *nix /home/<USER_NAME>/cmangos/mangos)

    * You may actually have to set CORE_PATH="../mangos" (assuming default paths from this guide), if the tilde is not properly resolved into your home folder path, causing InstallFullDB.sh to complain about not finding "/home/username/cmangos". Tested on openSUSE 12.3.

  • Now the helper tool is configured, and you only need to run the helper script, whenever you want to set your world database to a clear state!

  • bash ./InstallFullDB.sh

    And check the output if the database could be set up correctly. If the helper script complains about not finding the config file, just open InstallFullDB.sh in a text editor and set

    SCRIPT_FILE="./InstallFullDB.sh"
    CONFIG_FILE="./InstallFullDB.config"
  • You can now run the script again, and it should start filling your world database.

  • cd ../..

If you get an error saying ./InstallFullDB.sh: line 126: mysql: command not found then you need to add mysql.exe to the PATH variable. (Windows + Pause → Advanced System Settings → Environment Variables → System Variables → Edit Path and add the location of your mysql.exe)

Basic concept of manual database filling

The database providers provide

A full-dump release file::
  This file contains the whole database content of one point
Updatepacks::
  An updatepack consist of
  - collected core updates for the mangos (world) database
  - collected core updates for the characters database
  - collected core updates for the realmd database
  - content fixes

So you need to:

* Apply the latest release file
* Apply all following updatepack files (always corepatches before updatepacks)
* Apply the remaining updates from the core (located in C:\Mangos\mangos\sql\updates

* Note: For those wishing to run the core in debug mode, InstallFullDB.sh have a hidden config option for LOCALES="NO" which does not install locale translations and significantly lowers core load time when repeatedly restarting. Only recommended for developers.

Configuring CMaNGOS

This part should be an extra wiki-page: Meaning of config files from mangos/sd2

With the default installations, you should get a working environment out of the box :)

OpenSSL3 Legacy Provider

If you are using OpenSSL3 on Linux you may need to activate the legacy provider in your openssl.cnf (often found in /etc/ssl/openssl.cnf, but may vary between distros).

There you’ll look for "List of providers to load"

and beneath this:

[provider_sect]
default = default_sect
you add the following line:
legacy = legacy_sect

next you look for "[default_sect]" immediately underneath it it should say #activate = 1 if it does, please change it to activate = 1, removing the "#" in front. This step is very important! Not doing it can lock you out of your computer!

Next leave an empty line and then add the following:

[legacy_sect]
activate = 1

The final config should look like the following in the section we edited:

# List of providers to load
[provider_sect]
default = default_sect
legacy = legacy_sect
# The fips section name should match the section name inside the
# included fipsmodule.cnf.
# fips = fips_sect

# If no providers are activated explicitly, the default one is activated implicitly.
# See man 7 OSSL_PROVIDER-default for more details.
#
# If you add a section explicitly activating any other provider(s), you most
# probably need to explicitly activate the default provider, otherwise it
# becomes unavailable in openssl.  As a consequence applications depending on
# OpenSSL may not work correctly which could lead to significant system
# problems including inability to remotely access the system.
[default_sect]
activate = 1

[legacy_sect]
activate = 1
Please note the lines that do not have a "#" in front, these must not have a "#" in front in your config either.

(OPTIONAL) Update *.conf files

You will need to manually update the configuration files within your "run" directory (ie C:\Mangos\run ).

The files are:

  • mangosd.conf: Holds configuration for the mangosd executable

  • realmd.conf: Holds configuration for the realmd executable

  • (Very optional) ahbot.conf: Holds configuration for AHBot (by default disabled)

  • (optional, only if you enabled PlayerBots during compilation) playerbot.conf: Holds configuration for PlayerBots (by default disabled)

Most important to configure are the database settings. You will need this if you decided to use a different password/user then the "default" combination of mangos/mangos.

These settings are relatively self-explanatory. You should pay attention mainly to the values of "LoginDatabaseInfo", "WorldDatabaseInfo", and "CharacterDatabaseInfo" found in your mangosd and realmd configuration files.

(OPTIONAL) Update realmd.realmlist

You need to change this only if you changed the mangosd.conf settings "WorldServerPort" or "RealmID"

This information is required so that the realmd "knows" to which mangosd he should forward a player after authentication, so if you want to use your server outside itself (e.g. on your LAN) please change 127.0.0.1 by your server ip !

Apply code to realmd database, adapt to your wishes

DELETE FROM realmlist WHERE id=1;
INSERT INTO realmlist (id, name, address, port, icon, realmflags, timezone, allowedSecurityLevel)
VALUES ('1', 'MaNGOS', '127.0.0.1', '8085', '1', '0', '1', '0');

Where of course the data must match the configs:

  • port (above 8085) must match the value in the mangosd.conf (Config option: "WorldServerPort")

  • id (above 1) must match the value in the mangosd.conf (Config option: "RealmID")

Configuring your WoW-Client

  • Copy C:\World Of Warcraft\Data\enEN\realmlist.wtf to realmlist.old within the same folder

Your locale folder may be named differently according to your region ("enUS", "enGB", "frFR", "deDE", etc)

  • Open realmlist.wtf in Notepad and change the contents to the following:

    set realmlist 127.0.0.1

Always use the wow.exe and NOT the launcher to start your WoW-Client

Running your Server

On Windows system launch C:\Mangos\run\mangosd.exe and C:\Mangos\run\realmd.exe

On *nix run the corresponding binary files :

~/cmangos/run/bin/mangosd -c ~/cmangos/run/etc/mangosd.conf -a ~/cmangos/run/etc/ahbot.conf
~/cmangos/run/bin/realmd -c ~/cmangos/run/etc/realmd.conf

Tip1

Don’t run mangosd or realmd as root !

You can create a separate user "mangos" to limit access to the cmangos binaries:

useradd -m -d /home/mangos -c "MaNGOS" -U mangos
sudo passwd mangos

enter new password for the mangos user

copy the run directory to your new mangos user:

sudo cp -r ~/cmangos/run /home/mangos/run
sudo chown mangos:mangos /home/mangos/run

Then log in as the mangos user:

su mangos

Tip2

you can run mangosd and realmd in separate screens

exec screen -dmS mangosd /home/mangos/run/bin/mangosd -c /home/mangos/run/etc/mangosd.conf -a /home/mangos/run/etc/ahbot.conf
exec screen -dmS realmd /home/mangos/run/bin/realmd -c /home/mangos/run/etc/realmd.conf

(make note of where you have your run directory. this example is for when you have created a separate mangos user.)

Tip3

if you want to start mangosd and realmd at your server boot, you can use a cron task. create a /home/mangos/cmangos-launcher.sh file with this content :

#!/bin/bash
exec screen -dmS mangosd /home/mangos/mangos/run/bin/mangosd -c /home/mangos/mangos/run/etc/mangosd.conf -a /home/mangos/mangos/run/etc/ahbot.conf++
exec screen -dmS realmd /home/mangos/mangos/run/bin/realmd -c /home/mangos/mangos/run/etc/realmd.conf++

and then, as mangos user, run crontab -e and add this line :

@reboot /bin/bash /home/mangos/cmangos-launcher.sh

It’ll run this script at your server boot.

Alternatively you can create a systemd service for CMaNGOS.

Creating first account:

Once everything in mangosd has loaded, here are some commands you can use.

In your Mangosd window, there is tons of text; not to worry, keep typing anyway, it doesn’t matter

Creating the actual account

account create [username] [password]

Example:

account create MyNewAccount MyPassword

Enabling expansions for a user

account set addon [username] [0 to 3]
  • 0) Basic version

  • 1) The Burning Crusade

  • 2) Wrath of the Lich King

Example:

account set addon MyNewAccount 2

Changing GM levels

account set gmlevel [username] [0 to 3]
  • 0) Player

  • 1) Moderator

  • 2) Game Master

  • 3) Administrator

Example:

account set gmlevel MyNewAccount 2

Shutdown your server

.server shutdown [delay]

The delay is the number of seconds

First login:

Always use the wow.exe and NOT the launcher to start your WoW-Client

Start your WoW-Client with the wow.exe and login with your previously created account name (NOT email) and password.

Note that if this account is GM-Account, you can use lots of nice commands to get around, (remark the . with which they all start) ie:

  • .tele <location>

  • .lookup

  • .npc info and .npc aiinfo

  • .modify aspeed <rate>

  • .gm fly on (note that although the command is available, it does not work on the classic core)

Enjoy running and messing with your CMaNGOS server!

Troubleshooting

  • Server crashes immediately after boot or on login:

    • This can happen if OpenSSL 3 is used on the system but CMaNGOS was not compiled with support for it, or if legacy providers are disabled in the OpenSSL configuration.

  • Stuck in the login screen:

    • Check your firewall settings: mangosd and/or realmd might be blocked.

  • Getting a compiler error at TileAssembler.cpp:

    • gcc 11.2 (and 11.3 or 12 on some distributions) have a bug in their code optimizer. Try to use a different compiler (newer or older version of gcc or clang for example)

  • Random crashes in G3D Code

    • May be caused by the memory allocation implementation of G3D. Rebuild CMaNGOS with the -DNO_BUFFERPOOL flag to disable G3D memory management and use C++ Standard memory management instead

  • The extractors show a weird message and not all directories are there:

    • Try starting the extractors with bash: bash ./ExtractResources.sh

  • make install fails with a strange zlib/libz error:

    • Go into your build directory cd ~/cmangos/build

    • From there go into _deps/zlib-build and open the file cmake_install.cmake

    • Delete everything in the file and save the empty file. You can now run make install again successfully.

Clone this wiki locally