vmangos / wiki

Documentation and guides aimed at users and contributors of the project.
26 stars 13 forks source link

ubuntu version of "Getting it working" #4

Closed steathy closed 3 years ago

steathy commented 3 years ago

on the wiki section. the 3rd part "Getting it working" is for windows only. Is there an ubuntu version?

For each step:

  1. what file should be copied for ACE and TBB in ubuntu? there's no dll. also where should them be copied to? the bin folder?
  2. how to extract maps in ubuntu server? copy the client to ubuntu and execute those commands accordingly?
  3. for sql, I guess simply run "make_migration.bat"?
  4. I cannot find the mangosd.conf file...
  5. to start server, run "run-mangosd" in bin folder?
mserajnik commented 3 years ago
  1. Since it's Ubuntu, you can simply install ACE and TBB via apt (as explained here)
  2. If you compile with USE_EXTRACTORS=1 (see here), the extractor tools will be compiled and you can simply copy them to the client directory and run them there (e.g., ./mapextractor), in the order as explained in the Wiki
  3. make_migration.bat is a batch script for Windows, which will of course not work on Ubuntu (or any other Linux distribution). You'll want to run either the shell script or the Python script instead
  4. The example config file is here, simply copy and rename that to mangosd.conf and adjust as needed
  5. You'll want to run bin/realmd for the auth server and bin/mangosd for the world server. bin/run-mangosd is a Bash script that executes bin/mangosd and auto-restarts the server in case it crashes (so you can use that too instead of running bin/mangosd directly, if you prefer)
steathy commented 3 years ago
  1. Since it's Ubuntu, you can simply install ACE and TBB via apt (as explained here)
  2. If you compile with USE_EXTRACTORS=1 (see here), the extractor tools will be compiled and you can simply copy them to the client directory and run them there (e.g., ./mapextractor), in the order as explained in the Wiki
  3. make_migration.bat is a batch script for Windows, which will of course not work on Ubuntu (or any other Linux distribution). You'll want to run either the shell script or the Python script instead
  4. The example config file is here, simply copy and rename that to mangosd.conf and adjust as needed
  5. You'll want to run bin/realmd for the auth server and bin/mangosd for the world server. bin/run-mangosd is a Bash script that executes bin/mangosd and auto-restarts the server in case it crashes (so you can use that too instead of running bin/mangosd directly, if you prefer)

Thank you very much for the explanation. for 2nd question, I have followed Compiling on Ubuntu and got all the extractors. Do you mean copy them to windows wow client to extract map files? They are linux files, not exe. Or do you mean copy the whole client folder to ubuntu server and extract map files from there? for 4th question, I've located mangosd.conf and realmd.conf, do I need to copy them to the bin folder?

mserajnik commented 3 years ago

for 2nd question, I have followed Compiling on Ubuntu and got all the extractors. Do you mean copy them to windows wow client to extract map files? They are linux files, not exe. Or do you mean copy the whole client folder to ubuntu server and extract map files from there?

Since you compiled the extractors for Linux, you would have to copy the client directory to your Ubuntu installation, put the extractors into that directory and run them. The second option would be to compile the extractors for Windows (either on Windows or via cross-compiling, though the latter would be more complex to set up) and then run them on Windows.

for 4th question, I've located mangosd.conf and realmd.conf, do I need to copy them to the bin folder?

Sorry, I should've clarified further: during the installation (with make install), it will have already copied the mangosd.conf.dist.in and realmd.conf.dist.in as mangosd.conf.dist and realmd.conf.dist respectively and put them into the correct directory (iirc, that's the etc on Linux, that should've been created during the installation too). You can then simply duplicate those two as mangosd.conf and realmd.conf in the directory they are already in.

steathy commented 3 years ago

for 2nd question, I have followed Compiling on Ubuntu and got all the extractors. Do you mean copy them to windows wow client to extract map files? They are linux files, not exe. Or do you mean copy the whole client folder to ubuntu server and extract map files from there?

Since you compiled the extractors for Linux, you would have to copy the client directory to your Ubuntu installation, put the extractors into that directory and run them. The second option would be to compile the extractors for Windows (either on Windows or via cross-compiling, though the latter would be more complex to set up) and then run them on Windows.

for 4th question, I've located mangosd.conf and realmd.conf, do I need to copy them to the bin folder?

Sorry, I should've clarified further: during the installation (with make install), it will have already copied the mangosd.conf.dist.in and realmd.conf.dist.in as mangosd.conf.dist and realmd.conf.dist respectively and put them into the correct directory (iirc, that's the etc on Linux, that should've been created during the installation too). You can then simply duplicate those two as mangosd.conf and realmd.conf in the directory they are already in.

Thanks for clarification. I've copied the client folder over and run map extractors. The commands I used are ./mapextractor, ./vmapextractor, ./vmap_assembler, and ./MoveMapGen. The first three finished successfully. The last one seems to be missing offmesh.txt with error message loadOffMeshConnections:: input file offmesh.txt not found!

I found an offmesh.txt here. However it only has three lines of code/text with comment AV.(Alterac Valley?) Is it the right one?

mserajnik commented 3 years ago

You should be able to use that file, yes. I actually wasn't aware that this exists in the repository and only ran MoveMapGen without it previously.

But from what I know, the offmesh file is optional and, with the particular file in the repository, only applies to a few locations (that's why it's only three lines). So even though that message is printed, that doesn't mean that it's failing. In my opinion, it shouldn't assume that default location for the offmesh.txt and print that message over and over if it's missing, but that's just how it's implemented.

You can tell MoveMapGen where the file is located via --offMeshInput. E.g., ./MoveMapGen --offMeshInput /path/to/your/offmesh.txt (see here).

On a sidenote, MoveMapGen will run for quite a while. I think I've measured around ~10 hours or so on one of my servers recently. Just so you are prepared for that.

steathy commented 3 years ago

You should be able to use that file, yes. I actually wasn't aware that this exists in the repository and only ran MoveMapGen without it previously.

But from what I know, the offmesh file is optional and, with the particular file in the repository, only applies to a few locations (that's why it's only three lines). So even though that message is printed, that doesn't mean that it's failing. In my opinion, it shouldn't assume that default location for the offmesh.txt and print that message over and over if it's missing, but that's just how it's implemented.

You can tell MoveMapGen where the file is located via --offMeshInput. E.g., ./MoveMapGen --offMeshInput /path/to/your/offmesh.txt (see here).

On a sidenote, MoveMapGen will run for quite a while. I think I've measured around ~10 hours or so on one of my servers recently. Just so you are prepared for that.

Thank you very much for the explanation. I believe I got the movement maps successfully generated. Here's what I did afterwards: I followed a tutorial here to install mysql 5.5 on my ubuntu server. Then I created 4 databases (logs, realmd, characters, and mangos) and executed logs.sql, logon.sql, and characters.sql correspondingly. Next I downloaded the newest world_full_14_june_2021.7z from here as instructed in the windows version tutorial and executed its sql file:world_full_14_june_2021.sql.

I think I messed up on the next step. I ran the shell script you previously suggested. Looks like nothing happened? I think I missed something here because after setting up the two conf files and trying to run realmd, it exited with error message `

Database realmd is missing the following migrations: 20210519212944`.

Another question is regarding the realmlist table, I guess that I need to put my public ip in the address column and my server address 192.168.1.xxx in the localAddress column.(ofc I need to setup port forwarding in my router) However, if I only want to play with my family within home network, do I simply put server ip address in both address and localAddress columns?

mserajnik commented 3 years ago

Database realmd is missing the following migrations: 20210519212944`.

The new database release actually moved that file it's complaining about to old_migrations, meaning it should be unused because that data is already in the new database release. So I don't know why it would be complaining here about the missing data, unless you are using a commit older than https://github.com/vmangos/core/commit/11fe48f8e5764aedd5270430d8a19c3392991ab3? To use that new database release, you have to use at least that commit.

Another question is regarding the realmlist table, I guess that I need to put my public ip in the address column and my server address 192.168.1.xxx in the localAddress column.(ofc I need to setup port forwarding in my router) However, if I only want to play with my family within home network, do I simply put server ip address in both address and localAddress columns?

You generally only need to change address.

From my understanding, localAddress tells the authentication server (realmd) where it can find the VMaNGOS server (so since you are running VMaNGOS on the same machine as the authentication server, 127.0.0.1 is fine here).

address is the address it tells the WoW client (so that should be the public IP of your server, unless you are running the server on the same machine you are running the client on).

So in your particular case, you can just enter the LAN IP of your server into address; e.g., in my case, the LAN IP of my home server is 192.168.178.110 (I'm using a FRITZ!Box router which uses 192.168.178.0/24 for LAN addresses).

steathy commented 3 years ago

Database realmd is missing the following migrations: 20210519212944`.

The new database release actually moved that file it's complaining about to old_migrations, meaning it should be unused because that data is already in the new database release. So I don't know why it would be complaining here about the missing data, unless you are using a commit older than vmangos/core@11fe48f? To use that new database release, you have to use at least that commit.

Another question is regarding the realmlist table, I guess that I need to put my public ip in the address column and my server address 192.168.1.xxx in the localAddress column.(ofc I need to setup port forwarding in my router) However, if I only want to play with my family within home network, do I simply put server ip address in both address and localAddress columns?

You generally only need to change address.

From my understanding, localAddress tells the authentication server (realmd) where it can find the VMaNGOS server (so since you are running VMaNGOS on the same machine as the authentication server, 127.0.0.1 is fine here).

address is the address it tells the WoW client (so that should be the public IP of your server, unless you are running the server on the same machine you are running the client on).

So in your particular case, you can just enter the LAN IP of your server into address; e.g., in my case, the LAN IP of my home server is 192.168.178.110 (I'm using a FRITZ!Box router which uses 192.168.178.0/24 for LAN addresses).

I checked my core files. They were downloaded on 06/11, just before the new release...

So do I need to start over and rebuild the whole thing from the very beginning?

mserajnik commented 3 years ago

So do I need to start over and rebuild the whole thing from the very beginning?

You have to rebuild, yes. That's just the nature of compiled languages like C++.

But you don't have to start from the beginning and redo everything (that would be silly if every update required that), it should just be running cmake and make as documented here.

On a sidenote, I've just published a Docker-based setup that simplifies installing, updating and managing VMaNGOS a lot; on a Linux-based machine, all it requires is Docker and Docker Compose, so no need to manually install any other dependencies.

It's also what I'm personally using (I generally used containerized solutions for all my server applications).

If you want to check it out, you can find it here. The README should provide detailed enough instructions to get started.

steathy commented 3 years ago

So do I need to start over and rebuild the whole thing from the very beginning?

You have to rebuild, yes. That's just the nature of compiled languages like C++.

But you don't have to start from the beginning and redo everything (that would be silly if every update required that), it should just be running cmake and make as documented here.

On a sidenote, I've just published a Docker-based setup that simplifies installing, updating and managing VMaNGOS a lot; on a Linux-based machine, all it requires is Docker and Docker Compose, so no need to manually install any other dependencies.

It's also what I'm personally using (I generally used containerized solutions for all my server applications).

If you want to check it out, you can find it here. The README should provide detailed enough instructions to get started.

Thank you! I have rebuilt the core and run cmake, make -j4 and make install. Now the realmd sever is working. However, the world server is still getting errors:

Database mangos is missing the following migrations: 20210615223353 20210618144718 20210619111607

I am very excited as it's getting very close now. Also a very silly question: how do I create accounts? Use INSERT INTO account info in mysql directly?

I LOVE the idea of putting it into docker. While waiting for your help on the above issue, I am gonna give it a try on the docker version. By the way, is it possible to push it to docker hub?

mserajnik commented 3 years ago

However, the world server is still getting errors

Ah, you'll also have to run migrations. See here. You can use that provided merge.sh script to merge all the migrations for each database into one SQL file, which you can then just import. Here is how I do that in my Docker setup. You can basically just copy the commands here and run them with adjusted paths to the SQL migration files. E.g.:

[ -e ./sql/migrations/world_db_updates.sql ] && mysql -u root -p'YourMysqlPassword' mangos < ./sql/migrations/world_db_updates.sql
[ -e ./sql/migrations/characters_db_updates.sql ] && mysql -u root -p'YourMysqlPassword' characters < ./sql/migrations/characters_db_updates.sql
[ -e ./sql/migrations/logon_db_updates.sql ] && mysql -u root -p'YourMysqlPassword' realmd < ./sql/migrations/logon_db_updates.sql
[ -e ./sql/migrations/logs_db_updates.sql ] && mysql -u root -p'YourMysqlPassword' logs < ./sql/migrations/logs_db_updates.sql

The [ -e ./sql/migrations/world_db_updates.sql ] check if the file exists before the mysql command only gets executed. E.g., currently there aren't any characters, realmd (they use logon as prefix instead of realmd for the migrations for some reason) or logs migrations.

Edit: I also found this repository which might be useful in general if you want to build and run VMaNGOS not using Docker. It's for Ubuntu 16.04, but that shouldn't matter here (I wouldn't use the compilation instructions from that repo though; just stick to the instructions in the VMaNGOS Wiki for that). And especially the section about importing and updating the database should be helpful.

how do I create accounts? Use INSERT INTO account info in mysql directly?

Running mangosd will give you an interactive console. Here, you can create accounts like this:

account create <account name> <account password>
account set gmlevel <account name> <account level>

See here for the different account levels; for an administrator account you'll usually want 6, I don't think it's intended to use 7 for user accounts.

By the way, is it possible to push it to docker hub?

In theory, yes, but that would require a lot of changes. This setup is more intended as a toolbox that makes it easier to build and run VMaNGOS. I do usually like providing prebuilt images, if it makes sense. But due to the nature of VMaNGOS, I can't really think of a way of doing that that plays well with the configuration at compile time (e.g., it has to be compiled with the desired client version set; that can't be configured later); so it's not something I'm personally interested in pursuing.

That said, I have published it under AGPL-3.0-or-later, so anyone can just fork the project and adjust it to their needs.

On a related note, I know that AzerothCore (a 3.3.5a server emulator) is providing prebuilt Docker images, so it's certainly doable if you are willing to live limited configurability1.


  1. AzerothCore also provides a Docker setup where you have to build the images yourself, but it's very convenient to use and provides far more flexibility that the prebuilt images (especially since they have optional modules that have to be compiled with the core if you want to use them).
steathy commented 3 years ago

Thank you very much for your kind help! I finally got it set up now! Turns out the new release also changed the database structures. I had to re-create all databases and then apply migrations.

I still got some warnings though:

WARNING! Database mangos has the following extra migrations: 20210620002718 Visibility.Distance.BG can't be greater 532.333313 Spell 6346 listed in spell_proc_event has exactly same proc flags as in spell.dbc, field value redundant Spell 25918 listed in spell_threat as custom rank has same data as Rank 1, so redundant

  1. Do I need to & How to remove the extra migration 20210620002718?
  2. Is it possible to run auth server and world server in the same SSH session? I am currently opening two SSH windows to run each of them separately. (If that's the way it was supposed to be, I am fine with that) Or maybe use Screen to put them in separate sessions?
  3. For your docker version, I followed the instructions exactly and encountered an error on the 7th step:

    Running hooks in /etc/ca-certificates/update.d... done. Removing intermediate container 5dffd6ddb062 ---> 3b6771faec37 Step 6/13 : RUN mkdir -p /opt/vmangos && chown -R ${VMANGOS_USER_ID}:${VMANGOS_GROUP_ID} /opt/vmangos ---> Running in dc9f41bcb844 Removing intermediate container dc9f41bcb844 ---> 7432553179ae Step 7/13 : COPY ./vmangos/bin/realmd /opt/vmangos/bin/realmd COPY failed: file not found in build context or excluded by .dockerignore: stat vmangos/bin/realmd: file does not exist ERROR: Service 'vmangos_realmd' failed to build : Build failed

Looks like the realmd file was missing.

mserajnik commented 3 years ago

Visibility.Distance.BG can't be greater 532.333313 Spell 6346 listed in spell_proc_event has exactly same proc flags as in spell.dbc, field value redundant Spell 25918 listed in spell_threat as custom rank has same data as Rank 1, so redundant

I think these warnings I fine; I do at least remember seeing the first one here myself.

Do I need to & How to remove the extra migration 20210620002718?

That migration is interesting, because its date would suggest it's from today: 20210620. But looking at the current commit, the latest migration is from yesterday.

So I'm not really sure where you might've gotten that one from or what would be the best way to remove it (I never looked into removing extraneous migrations because I've never encountered that issue myself).

Is it possible to run auth server and world server in the same SSH session? I am currently opening two SSH windows to run each of them separately. (If that's the way it was supposed to be, I am fine with that) Or maybe use Screen to put them in separate sessions?

Yes, I would suggest to use a screen (or tmux) session for each. If you don't do something like this and instead just run the servers directly after SSHing into the machine, the servers will stop once your SSH connection breaks up (so then you couldn't for example reboot the machine makes these to the server via SSH).

For your docker version, I followed the instructions exactly and encountered an error on the 7th step

We probably shouldn't hijack this thread for an issue with third party software, so If this takes longer to debug, I suggest opening a ticket here instead.

But just briefly:

Does ./vmangos/bin/realmd exist in the repository? Otherwise, there was probably a problem during the compilation/installing the executable (which might've happened as a result of misconfiguration or a UID/GID mismatch between your host user and the container user).

Primary things to check:

  1. Did you modify any configuration after running ./00-create-or-reset-config-files.sh? If yes, what exactly did you change?
  2. Did you make sure that the default UID/GID (1000/1000) of the container user matches that of your host user? If no, did you change the UID/GID as explained in the README accordingly?
  3. Were there any visible errors in prior steps of running ./00-install? It might be easiest to just redirect the output of it into a file and look through it afterwards: ./00-install.sh >> ~/Downloads/vmangos_docker_build_log.txt or something like that Edit: Actually, to get all the output, you'll have to modify ./00-install.sh:

Add the following to the top of ./00-install.sh (after the #!/bin/sh):

exec > ~/Downloads/vmangos_docker_build_log.txt 2>&1

And then you can just run ./00-install.sh normally and you'll find all the output in ~/Downloads/vmangos_docker_build_log.txt. Adjust the path as you wish, of course.

steathy commented 3 years ago

2. Did you make sure that the default UID/GID (1000/1000) of the container user matches that of your host user? If no, did you change the UID/GID as explained in the README accordingly?

I believe that's the problem... I forgot it was not compiled under my default user. No wonder I had to do sudo ./00-install.sh in the first place.

I'll move further docker related questions to sourcehut. Thank you very much for your help in the past weeks! I really learned a lot here and had much fun reading different tutorials, just like exploring Azeroth about 15 years ago.

mserajnik commented 3 years ago

I believe that's the problem... I forgot it was not compiled under my default user. No wonder I had to do sudo ./00-install.sh in the first place.

Oh yeah, that won't work; the sudo won't apply to the commands run in the Docker containers, so those will still just run with the configured UID/GID. And if the UID/GID doesn't match, it won't be possible to create/delete the files on the host (and that's probably why ./vmangos/bin/realmd was missing for you).

I'm glad I was able to help; don't forget to close this issue. I think your remaining problem (Do I need to & How to remove the extra migration 20210620002718?) might be something that warrants opening a new issue (and I'd probably open that in vmangos/core instead too since it's not really a Wiki issue), since I can't really help with that. And I doubt that anyone else would read through this whole thread at this point.