Jump to content
  • We are looking for staff for the Wiki area!
    If interested please
    click here and select "Documentation Team"

  • Installing Mangos on Debian 9 or a Debian based Distribtion


    onixiya

    I tested this on Debian 9.6 however this guide should work on any recent Debian distribution such as Ubuntu.

    Required Packages

    First we need to install all of the required programs and library's.

    Open up a root terminal. If your not root, enter this to become root

    sudo su

    Install the following packages

    apt install git make cmake libssl-dev libbz2-dev build-essential default-libmysqlclient-dev

    We need to grab the mysql stuff from here. Follow the instructions there. Also, choose mysql 5.7. A script needed later requires this so don't install mysql 8. Install the server with

    apt install mysql-server

    You also need to grab and compile libace. You can get it from here. Extract it and read the instructions.They're pretty straight-forward. It should be named 'ACE-INSTALL.html' or something similar.

    When thats done, enter this command. I highly recommend doing this even if your just keeping the server to yourself

    mysql_secure_installation

     I suggest these options:

    Don't use the password plugin
    Change the root password
    Remove the anonymous user
    Disable remote access for root
    Remove the test database
    Reload privileges

    Restart your system with

    init 6


    Getting the Mangos source code

    Now we need the source code for mangos. Open up a terminal as root and go to the home directory:

    cd ~

    Lets create a root directory for all of the mangos files

    mkdir mangos

    Now we clone the source code. Mangos servers above two are unstable or incomplete. Don't be surprised if something doesn't work or is missing.

    git clone https://github.com/mangoszero/server.git --recursive --depth 1

    For the database

    git clone https://github.com/mangoszero/database.git --recursive --depth 1

    If you want a different server(say mangos one), simply change the url. For example

    git clone https://github.com/mangosone/server.git --recursive --depth 1

    For the mangos one server. If you want mangos two, simply do the same. Do the same with the database.

    Wait for the repos to be cloned (the server is about 200-250mb-ish)

    Compilaton

    The good part. Enter the mangos source directory

    cd server

    Make a new directory for the build files.

    mkdir build

    Go into it

    cd build

    Now run this to configure the makefiles

    cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/bin/mangos

    If cmake doesn't complain about anything, your good to go with compiling it.  To speed up compilation, you need to know how many cores your cpu has. Most cpus have 2 or 4 cores. Search it up if your not sure. Now to compile it, simply enter this

    make -j2

    Change -j2 to how cores you have. If you have 4 cores, change it to

    make -j4

    If you only have one core, don't bother with the -j flag, just type in 'make' and hit enter.

    This will take a while depending on how fast your cpu is. Just be paitent.

    After a bit, mangos will be compiled(yay)and you will need to separate the needed files from the source code. To install it into your install prefix(default is /usr/local/bin/mangos), do this

    make install

    Database Setup: The Sequel
    Now for another database setup (i know, its crazy). This time, we will be loading some stuff into it. Enter the database folder you cloned earlier and execute InstallDatabases.sh

    ./InstallDatabases.sh

    If it says something similar to 'bash: ./InstallDatabases.sh: Permission denied', the script isn't marked as executable. Mark everything needed as executable by running this

    chmod -R +x *.sh

    Now have a go at running the script again. When execute it, you'll be brought to a menu. The defaults are fine for a new server so just press 'n' and hit enter

    You will have to give it your mysql details. This needs to be your server hostname(ip address), username, password and server port. The only things you need to change are the username and password. Keep in mind all of this must be done as the ROOT user.

    Game Data

    Now this is the longest part if decide to get mmaps. To run the server, you MUST extract the .dbc and .map files. To do this, copy everything in the tools folder to where your wow client is. Keep in mind the version of the client as it must be a specific version for this(mangoszero is a bit more lenient then others). You need 1.12.x (x can be any number) for mangoszero, 2.3.4 for mangosone, 3.3.5 for mangostwo(favourite), 4.3.4 for mangosthree and 5.4.1 for mangosfour. To extract the dbc and map files, execute this when in your wow client folder

    ./mapextractor

    This can take around 5 minutes to complete. Once thats done, copy over the folders "dbc" and "maps" to where you installed mangos. I recommend getting all of the data though so to get the vmaps, make sure the maps folder is still in your wow folder and exectute this

    ./vmaps4extractor

    Once thats done, type this in your terminal

    ./vmaps4assembler

    Just copy over the "vmaps" folder to where mangos is. Now for movemaps. This can take anywhere from an hour to a whole day depending on your computer and what client data you're extracting. Make sure the vmaps and maps folders are still in your wow folder and type this out

    ./MoveMapGen.sh 2

    Now, you might want to know how many cores your computer has. Most computers have 2 so if you don't know, just leave the command as is. If you got 4 or 8 cores, replace the 2 with a 4 or a 8. More threads the better but your computer will be a lot slower if you use all of your cpu. Press enter and prepare to wait a while. Once its finished extracting, copy over the folder "mmaps" to where mangos is. You can delete the maps, dbc, vmaps, buildings and mmaps from your client folder now if you want.

    Server Configuration

    Now to configure the server. Go to the mangos configuration folder

    cd /usr/local/bin/mangos/etc

    Copy the files to their proper name. DON'T delete them. They're a backup in case your .conf files get corrupted or you mess up some settings

    cp mangosd.conf.dist mangosd.conf
    cp realmd.conf.dist realmd.conf

    Edit realmd.conf and find the line 'LoginDatabaseInfo', change the information to suit your database. For example if my database hostname is localhost or 127.0.0.1, the port is 3306, username is root, the password is mangos and my realm database is realmd, it would look like this

    LoginDatabaseInfo = "127.0.0.1;3306;root;mangos;realmd"

    Save the file and edit mangosd.conf. Look for lines, LoginDatabaseInfo, WorldDatabaseInfo and CharacterDatabaseInfo. Do the same to those lines as you did to the one in realmd.conf. You may wish to fully read mangosd.conf to fine-tune your server if you wish.

    Save the file.

    Starting the Server

    Now to see if your hard work has paid off. Go to where you installed the server and start realmd

    ./realmd

    Now start mangosd

    ./mangosd

    If theres a error mangosd or realmd can't fix, it'll tell you problem then exit. It will be up to fix it however. The most common problem is that the password or username is wrong or that the database isn't running. Try editing mangosd.conf or realmd.conf if thats the case and making sure the db is running

    If it started and gives you a prompt, the server is loaded and awaiting a connection from a client.

    Starting the server with systemd

    This allows you to startup your computer and have mangosd and realmd load with it. Very useful on a dedicated server. We need to make 2 .service files to do this.

    touch /etc/systemd/system/mangosd.service
    touch /etc/systemd/system/realmd.service

    Edit mangosd.service with your preferred text editor. Don't type 'edit /etc/systemd/system/mangosd.service' unless you know how to quit vi.

    [Unit]
    Description=WoW server
    After=network.target mysql.service
    
    [Service]
    Type=simple
    User=root
    ExecStart=/usr/local/bin/mangos/bin/mangosd -c /usr/local/bin/mangos/etc/mangosd.conf
    Restart=on-abort
    
    [Install]
    WantedBy=multi-user.target

    Do the same with realmd.service

    [Unit]
    Description=WoW server
    After=network.target mysql.service
    
    [Service]
    Type=simple
    User=root
    ExecStart=/usr/local/bin/mangos/bin/realmd -c /usr/local/bin/mangos/etc/realmd.conf
    Restart=on-abort
    
    [Install]
    WantedBy=multi-user.target

    Let systemd reload.

    systemctl daemon-reload

    Start realmd via systemd to see if the .service file is valid

    systemctl start realmd

    Do the same with mangosd

    systemctl start mangosd

    Check the status of both services with

    systemctl status realmd
    systemctl status mangosd

    If it's working, you should see something like a green OK on both daemons (fun fact: daemons and services are the same thing) then you should be good to enable them at startup. Do this for realmd

    systemctl enable realmd
    systemctl enable mangosd

    Restart your system

    init 6

    Check that they started as root

    systemctl status realmd

    Do the same with mangosd

    If its good then mangosd and realmd will always start with your system until you disable them.

    Letting WoW clients connect to your server
    This is the 2nd last thing you need to do. This will allow WoW clients to connect to your server. We need to edit a table in the database. If you know what your doing with mysql, follow along but do the equivalent on the terminal. If you prefer doing things with a gui(graphical user interface, your using one right now!), lets install a gui mysql client. We'll use 'mysql-workbench'

    apt install mysql-workbench

    After its installed, check your start menu in 'Programming'. Start mysql workbench and click on your server. Enter your password and look on the lower left. Click on the little arrow next to realmd and scroll down to realmlist. Right click on it and click on 'Alter Table'. Go down to localAddress and double click on the '127.0.0.1'. Change this to your lan ip. You can find out your lan ip by opening a terminal and typing in

    ifconfig

    You will see about 4-5 interfaces. If your connection is a wired one, you should look at a interface named 'enp' followed by letters and numbers. For example, 'enp14s0'. Then look at the 'inet' part. This is your lan ip. Do the same if your connection is wireless or wi-fi. Wireless connections will be named like 'wlp' with some letters and numbers. 'wlp20s0' is a example.

    Once you have changed localAddress to your lan ip, you need to change address to your external ip. Go here to find out your ip. Now we need to let realmd know that the database has changed. Stop it with

    systemctl stop realmd

    Now start it again with

    systemctl start realmd

    Connecting a WoW client to your server

    Nearly there! Go to where your wow client is and look for a file named realmlist.wtf. Delete everything in this file and put the following stuff in it

    set realmlist 10.1.1.1
    set patchlist 10.1.1.1

    Change 10.1.1.1 to your server ip. It can be the lan ip if its on the same network as the server. Now for the moment of truth. Open up WoW.exe(not the launcher)and wait for it to load. Skip the cinematic if want by pressing escape(esc). Now login into the server by using administrator as the email and no password.  Choose the only realm and create your character. You now have a functioning WoW server for you and your friends to play on! Also, since you logged in using the admin account, you can use game master commands. Type in the chat '.gm help' for a list of commands currently in mangos. Have fun with it!


    User Feedback

    Recommended Comments

    Thanks for the guide got stuck at:

    The error was that I did not have the CMAKE_CXX_COMPILER

    Quote
    
    cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/bin/mangos
    

    Solution:

    sudo apt-get update
    sudo apt-get install build-essential

    The error was that I did not have the MYSQL dev libs and headers, in case anyone else has this issue on a headless Debian 9

    Quote

    cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/bin/mangos

    Solution:

    sudo apt-get install default-libmysqlclient-dev

     

    Edited by Stu Art
    Link to comment
    Share on other sites

    Hello sir! Sorry for such inconvenience. But now I get an error message when start ./mangod . The ./realmd starts flawlessly. But I get this message when running ./mangosd:

    Quote

     

    The table `db_version` indicates that your [Character] database does not match the expected structure! 

    [A] You have database Version: 21
                          Structure: 2
                            Content: 2
                        Description: Remove field from dbDocs

      You need database Version: 21
                          Structure: 4
                            Content: 1
                        Description: Add_Field_Comments

    You must apply all updates after [A] to to use MaNGOS with this database.
    These updates are included in the database/Character/Updates folder.

     

     

    How can I apply those updates? Thanks a lot!

    Edited by Fernando Oliveira
    Link to comment
    Share on other sites

    Quote

    Now this is the longest part if decide to get mmaps. To run the server, you MUST extract the .dbc and .map files. To do this, copy everything in the tools folder to where your wow client is. Keep in mind the version of the client as it must be a specific version for this(mangoszero is a bit more lenient then others).

    Hello, could you be more specific about the game data please ?

    I created a Debian 9.8 VM with VirtualBox on my Win 10 PC. I followed your steps until this one, I'm a bit at a loss to what should I do now ? Do I have to copy the files from my Wow client to my Debian VM ?
    If yes, wich files from the Wow client and where on the Linux VM ?

    Thank you for your tutorial, I hope I will be able to run a few tests before classic release 🙂

     

     

     

    Link to comment
    Share on other sites

    root@debian:~# apt install git make cmake libssl-dev libbz2-dev build-essential default-libmysqlclient-dev
    正在读取软件包列表... 完成
    正在分析软件包的依赖关系树
    正在读取状态信息... 完成
    没有可用的软件包 libbz2-dev,但是它被其它的软件包引用了。
    这可能意味着这个缺失的软件包可能已被废弃,
    或者只能在其他发布源中找到

    没有可用的软件包 default-libmysqlclient-dev,但是它被其它的软件包引用了。
    这可能意味着这个缺失的软件包可能已被废弃,
    或者只能在其他发布源中找到

    E: 软件包 libbz2-dev 没有可安装候选
    E: 软件包 default-libmysqlclient-dev 没有可安装候选

    Link to comment
    Share on other sites

    database isn't installing properly :/ i've tried five times now with a fresh database install, updates, everything. the updates don't work, keeps saying "update skipped". and when i try running mangosd, it tells me i'm missing quest 8332 text and revision refactor.

    Link to comment
    Share on other sites

    Try applying the update manually. Open up your mysql client and log in. Now notice what file is above when it says, "update skipped". Open that file with a text editor like nano and copy everything in it. Now paste it in editor on workbench(or whatever your preferred client is) and execute it. If it fails for some reason, show the results here.

    Link to comment
    Share on other sites

    Good evening when I go to make the server I receive the following error. 

    [ 37%] Building C object dep/tomlib/Crypt/CMakeFiles/tomcrypt.dir/src/stream/sosemanuk/sosemanuk.c.o
    [ 37%] Building C object dep/tomlib/Crypt/CMakeFiles/tomcrypt.dir/src/stream/sosemanuk/sosemanuk_memory.c.o
    [ 37%] Building C object dep/tomlib/Crypt/CMakeFiles/tomcrypt.dir/src/stream/sosemanuk/sosemanuk_test.c.o
    [ 37%] Linking C static library libtomcrypt.a
    [ 37%] Built target tomcrypt
    Makefile:151: recipe for target 'all' failed
    make: *** [all] Error 2
    root@mangos-server:/home/mangos/mangos/server/build#
     

    Link to comment
    Share on other sites

    Ok, first off thank you for the help provided so far. I am real close. I just need to know the location where the maps need to be placed.  I had to extract the maps on my windows machine. I have the three folders and just need to figure out where they need to go. I get the following error when running mangosd. 

    Please check for the existence of map file '../etc/maps/0004331.map'
    Correct *.map files not found in path '../etc/maps' or *.vmtree/*.vmtile files i                                 n '../etc/vmaps'. Please place *.map and vmap files in appropriate directories o                                 r correct the DataDir value in the mangosd.conf file.

    I have put the folders in several etc folders but none has been the right one. Does the ../ refer to root of the drive?

    Link to comment
    Share on other sites

    On 1/27/2020 at 8:39 AM, razz2u2 said:

    Ok, first off thank you for the help provided so far. I am real close. I just need to know the location where the maps need to be placed.  I had to extract the maps on my windows machine. I have the three folders and just need to figure out where they need to go. I get the following error when running mangosd. 

    Please check for the existence of map file '../etc/maps/0004331.map'
    Correct *.map files not found in path '../etc/maps' or *.vmtree/*.vmtile files i                                 n '../etc/vmaps'. Please place *.map and vmap files in appropriate directories o                                 r correct the DataDir value in the mangosd.conf file.

    I have put the folders in several etc folders but none has been the right one. Does the ../ refer to root of the drive?

    you can define the path in mangosd.conf, and i think the path like /home/mangos/your/maps/path/ is better than ../your/maps/path

    Edited by 汪可微
    Link to comment
    Share on other sites

    I have finally got the zero server up and running and was able to connect to it. The only question I have is do you have to do anything special to get the playerbots working?  I have enabled the playerbot config file and the ahbot config file.  The ahbot is working fine. When i go to add a bot  using ".bot add name " it says no such  command.  Are they supposed to be installed by default? I remember a couple years ago there was a install file to run and you had to select if you wanted it to install.  

     

    Link to comment
    Share on other sites

    11 hours ago, razz2u2 said:

    I have finally got the zero server up and running and was able to connect to it. The only question I have is do you have to do anything special to get the playerbots working?  I have enabled the playerbot config file and the ahbot config file.  The ahbot is working fine. When i go to add a bot  using ".bot add name " it says no such  command.  Are they supposed to be installed by default? I remember a couple years ago there was a install file to run and you had to select if you wanted it to install.  

     

    you need create some characters in your account ,then try .bot add [character name] again,if it dosn't work maybe need sql databases support

    Link to comment
    Share on other sites

    Mangosd start error

     

    I have installed a mangos server and configured it to the extent that it should actually start.  Unfortunately, an error occurs when starting the mangosd.service.

    Here I have taken a picture of the server status:1327336811_2020-02-0512_26_15.png.f7ae390e5936b7e535577ea10589b1c1.png

    Link to comment
    Share on other sites

    Awesome guide! Thank you very much!

    i managed to install everything:  realmd and mangosd launch flawlessly.

    i changed the realmlist address and local address ip to my actual lan ip and applied it...

    i did the same in the client file realmlist.wtf with your instructions...

    you say to write "administrator" to login without password (i tried lowercase and uppercase), but it doesn't work somehow...

    it asks for a password (i tried the database one) and it doesn't allow me to connect...

    is there a way to create another account, please?

    i wonder if there is a way to be sure that the client sees the server as i am not sure it is actually true...

    thank you

    warm regards from Guadeloupe

    Link to comment
    Share on other sites



    Guest
    This is now closed for further comments

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use