PDA

View Full Version : [Guide]Compile & Configure a 3.3.2 compatible evo-X server under Debian/Ubuntu



skinlayers
07-02-10, 07:01 AM
Hey all.

Just two days after I found this forum via TRM's Repack, I'm writing consolidated instructions for compiling evo-X-core.
Figures. Note: I built mine on a debian lenny 64-bit system. The instructions should be the same for 32-bit. Ubuntu will have a couple of extra dependencies they need to install. Also note that I'm doing this from pure command line. If you are using a GUI then gedit is going to be a much faster way to edit the text files.

The first part is lifted from the mangos wiki. Ubuntu requires a few different packages, so I'll post both apt-get lines here. If anyone can help me clean this up, I'd appreciate it! They list two different sets of packages for Ubuntu, so I've mixed them together. Let me know if I'm missing anything!
http://getmangos.com/wiki/Compile_MaNGOS_On_Linux
UPDATE 8: Renamed evoxlinux.patch to evox-core-sd2linux.patch.
UPDATE 9: Updated for evo-X-core 490. Added link to patches folder.
UPDATE 10: Added work around for Core 491/Branch 59 by rolling back to Branch 58.
UPDATE 11: Created my own repo based off evo-X Core 492 with linux fixes applied.

Getting started...


Open a Terminal window

sudo apt-get update

Debian:
sudo apt-get install gcc g++ automake autoconf make patch libmysql++-dev libtool libssl-dev subversion zlibc libc6 git git-core mysql-server pkg-config unrar-free

Ubuntu:
sudo apt-get install build-essential gcc g++ cpp automake autoconf make patch libmysql++-dev libtool libcurl4-openssl-dev libssl-dev grep binutils subversion zlibc libc6 nano git-core mysql-server pkg-config unrar-free

Note: I've upgraded mysql-server to 5.1 by adding the dotdeb.org line for it to my repos.
When I tested this on my Ubuntu install, mysql-server already installs 5.1 by default.
More details later.
Note: When mysql-server installs you should be prompted for a root password.
IT IS VERY IMPORTANT THAT YOU REMEMBER THIS PASSWORD! You'll need it later...

Install OpenSSL 0.8.9k:
From the mangos wiki-
"As of right now, the libopenssl that Ubuntu/Debian supplied was 0.9.8g and realmd requires 0.9.8k..."

For 32-bit
wget http://ftp.de.debian.org/debian/pool/main/o/openssl/libssl0.9.8_0.9.8k-8_i386.deb http://ftp.de.debian.org/debian/pool/main/o/openssl/libssl-dev_0.9.8k-8_i386.deb http://ftp.de.debian.org/debian/pool/main/o/openssl/openssl_0.9.8k-8_i386.deb
sudo dpkg -i libssl0.9.8_0.9.8k-8_i386.deb libssl-dev_0.9.8k-8_i386.deb openssl_0.9.8k-8_i386.deb

For 64-bit
wget http://ftp.de.debian.org/debian/pool/main/o/openssl/libssl0.9.8_0.9.8k-8_amd64.deb http://ftp.de.debian.org/debian/pool/main/o/openssl/libssl-dev_0.9.8k-8_amd64.deb http://ftp.de.debian.org/debian/pool/main/o/openssl/openssl_0.9.8k-8_amd64.deb
sudo dpkg -i libssl0.9.8_0.9.8k-8_amd64.deb libssl-dev_0.9.8k-8_amd64.deb openssl_0.9.8k-8_amd64.deb

Pull down the current source via git, and patch source code for linux compile.
git clone git://github.com/skinlayers/evo-X-Core.git
cd evo-X-Core
Or for evo-X Branch
git clone git://github.com/skinlayers/evo-X-Branch.git
cd evo-X-Branch/evo-X-Core-3.3.2

Custom patches
I've build a couple of common patches against evo-X Core 491, and linked them here for convenience.
I can't promise they'll stay up to date, but they work as of evo-X Core 491: AHbot, playerbot,
and throw patches are in here as well as the SD2 patch above.
http://skinlayers.net/evoxpatches/


Configure and compile source, then install the compiled binaries and related files


Run autoreconf against the source,
create a working directory for your compiled binaries, and
then configure the source with your install options:

autoreconf --install --force
mkdir objdir
cd objdir
../configure --prefix=/opt/evox --sysconfdir=/opt/evox/etc --enable-cli --enable-ra --datadir=/opt/evox
Note: you can replace /opt/evox with whatever path you want evo-x-core to be installed to.

Compile the source:

make (single proc/core)
or
make -j # (multi-proc/core)
Replace # with number of processors/cores you have.
From the mangos wiki-
"If you have a quad core CPU then "-j 4" is what you would use, dual core "-j 2".
With experience compiling source, for each core, add about 375MB of ram usage,
at 4 cores, compiling uses up to 1.5GB of RAM, if your server runs out of ram during
the compile process make WILL fail, be aware of this."

Install your binaries and related files, clean out objdir directory,
and copy default realmd and mangosd config files into place:

sudo make install
make clean
cd ..
rm -r objdir
sudo cp /opt/evox/etc/mangosd.conf.dist /opt/evox/etc/mangosd.conf
sudo cp /opt/evox/etc/realmd.conf.dist /opt/evox/etc/realmd.conf

Acquire sql dumps. Create, install, and update databases


Create folder for database files:

mkdir db_files
cd db_files
wget https://sd2-acid.svn.sourceforge.net/svnroot/sd2-acid/trunk/wotlk/3.0.3/3.0.3_acid.sql --no-check-certificate
wget http://europe-wow.eu/evo-X-Downloads/evo-X%20Database/evo-X%20Titan%20Database%20(0.0.9)%20for%20evo-X%20Core%20rev.%20425%20+%20with%20SD2%20SQL%20for %20rev.%201573.rar
Note: If you've donated and have access to the 0.1.0 Gold database
(as I do), then use that instead!

Unrar the database files. Normally this would be unrar-free e evo-X*.rar,
but it fails for me so I decompressed it under windows and then moved it back.
I'm guessing it would work with the non-free version of unrar for Ubuntu/Debian

Next, setup your mysql databases, load the structures, and import the evo-x, SD2, and SD2-ACID databases.
While the names of the databases don't really matter, I believe the script to install the
mysql database updates expects the mangos naming scheme. You can always use your own names
but you'll have to apply each update manually.
Note: You'll be prompted for your mysql root password.
This is the one you picked when you installed mysql-server:

mysql -u root -p < /opt/evox/mangos/sql/create_mysql.sql
mysql -u root -p < /opt/evox/scriptdev2/sql/scriptdev2_create_database.sql
mysql -u root -p scriptdev2 < /opt/evox/scriptdev2/sql/scriptdev2_create_structure_mysql.sql

mysql -u root -p mangos < /opt/evox/mangos/sql/mangos.sql
mysql -u root -p characters < /opt/evox/mangos/sql/characters.sql
mysql -u root -p realmd < /opt/evox/mangos/sql/realmd.sql
mysql -u root -p scriptdev2 < /opt/evox/scriptdev2/sql/scriptdev2_script_full.sql

mysql -u root -p mangos < ./evo-X\ Titan\ Database\ \(0.0.9\)\ for\ evo-X\ Core\ rev.\ 425\ +\ with\ SD2\ SQL\ for\ rev.\ 1573.rar.sql
or for 0.1.0 Gold
mysql -u root -p mangos < ./evo-X\ Gold\ Database\ \(0.1.0\)\ for\ evo-X\ Core\ rev.\ 459\ +\ with\ SD2\ SQL\ for\ rev.\ 1573.rar.sql
mysql -u root -p mangos < ./3.0.3_acid.sql
mysql -u root -p mangos < /opt/evox/scriptdev2/sql/mangos_scriptname_full.sql

Connect to mysql realmd database and setup your realm.
Note: Replace RealmName and Hostname_or_IP with your settings.
Be sure to leave the single quotes ( ' ) around them:

mysql -u root -p
use realmd;
UPDATE realmlist SET name = 'RealmName' WHERE id = 1;
UPDATE realmlist SET address = 'Hostname_or_IP' WHERE id = 1;
exit

Finishing touches


Go back to your db_files folder. Copy the dbc, maps, or vmaps you extracted from
a Windows WoW install to here. You can also get dbc and maps from
http://evo-x-project.com/evo-X-Downloads/evo-X%20Tools/Maps-Vmaps-DBCs/:
Note: vmaps take a while to generate and are optional, but HIGHLY recommended.

sudo mv dbc /opt/evox/bin/
sudo mv maps /opt/evox/bin/
sudo mv vmaps /opt/evox/bin/

Edit your config files.
Again, you can use different database names here.
They just have to match the ones you created and populated earlier:

sudo nano /opt/evox/etc/realmd.conf
Find:
LoginDatabaseInfo = "127.0.0.1;3306;root;mangos;realmd"
Change the first mangos after root to your mysql root password
Find:
BindIP = "0.0.0.0"
Replace 0.0.0.0 with your IP or hostname

Save & exit

sudo nano /opt/evox/etc/mangosd.conf
Find:
LoginDatabaseInfo = "127.0.0.1;3306;root;mangos;realmd"
WorldDatabaseInfo = "127.0.0.1;3306;root;mangos;mangos"
CharacterDatabaseInfo = "127.0.0.1;3306;root;mangos;characters"
Change the first mangos after root to your mysql root password
Find:
BindIP = "0.0.0.0"
Replace 0.0.0.0 with your IP or hostname

Save & exit

Run mangos-realmd & mangos-worldd in seperate screens in the background
Also learn how to attach to the screen to issue commands or bring the servers down


cd /opt/evox/bin
screen -mS evox
./mangos-realmd
ctrl-a followed by c to create a new screen
./mangos-worldd
ctrl-a followed by d
will detach you from the screen, leaving mangos-realmd and mangos-worldd running in the background.

To quit evo-X-core, first, if you're not already at the mangos> prompt, attach the to screen with:
screen -r
Then:
ctrl-c (to stop mangos-worldd)
exit (this will take you back to mangos-realmd)
ctrl-c (to stop mangod-realmd)
exit

Create an account and set account access:
Again, if you are not at the mangos> prompt type:
screen -r

To create an account enter:
account create USERNAME PASSWORD
Replace USERNAME and PASSWORD with the desired cridentials.

Set number of authorized expansions:
account set addon USERNAME #
Replace # with 0=None, 1=TBC, 2=WotlK

Optional- Set GM Level (if you want to give them GM privs):
account set gmlevel USERNAME #
Replace # with 0, 1, 2, or 3

I'll add more detail later.

Thank you:
Atomic, Salja, notagain, Viste, TRM, Chemmyone, 3raZar3, and all the other devs!

skinlayers

skinlayers
07-02-10, 07:35 AM
evoxlinux.patch
UPDATED for post-mangos code merge.
NOTE: Use evox-sd2linux.patch (below) until the evo-X devs decide to include config.h.in in their version of SD2.


diff -rupN a/configure.ac b/configure.ac
--- a/configure.ac 2010-02-12 05:12:36.000000000 -0800
+++ b/configure.ac 2010-02-12 05:18:11.000000000 -0800
@@ -297,7 +297,11 @@ AC_CONFIG_FILES([
src/mangosd/Makefile
src/mangosd/mangosd.conf.dist
src/bindings/Makefile
- src/bindings/universal/Makefile
+ src/bindings/scriptdev2/Makefile
+ src/bindings/scriptdev2/scriptdev2.conf.dist
+ src/bindings/scriptdev2/config.h
+ src/bindings/scriptdev2/sql/Makefile
+ src/bindings/scriptdev2/sql/Updates/Makefile
])

## Configure ACE, if needed
diff -rupN a/src/bindings/.gitignore b/src/bindings/.gitignore
--- a/src/bindings/.gitignore 2010-02-12 05:12:37.000000000 -0800
+++ b/src/bindings/.gitignore 2010-02-12 05:17:55.000000000 -0800
@@ -11,4 +11,4 @@
#
# Scripting projects
#
-#universal
+scriptdev2
diff -rupN a/src/bindings/Makefile.am b/src/bindings/Makefile.am
--- a/src/bindings/Makefile.am 2010-02-12 05:12:37.000000000 -0800
+++ b/src/bindings/Makefile.am 2010-02-12 05:18:40.000000000 -0800
@@ -14,4 +14,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

-SUBDIRS = universal
+SUBDIRS = scriptdev2
diff -rupN a/src/mangosd/Makefile.am b/src/mangosd/Makefile.am
--- a/src/mangosd/Makefile.am 2010-02-12 05:12:37.000000000 -0800
+++ b/src/mangosd/Makefile.am 2010-02-12 05:19:37.000000000 -0800
@@ -34,7 +34,7 @@ mangos_worldd_SOURCES = \

## Link world daemon against the shared library
mangos_worldd_LDADD = \
- ../bindings/universal/libmangosscript.la \
+ ../bindings/scriptdev2/libmangosscript.la \
../game/libmangosgame.a \
../shared/Database/libmangosdatabase.a \
../shared/Config/libmangosconfig.a \
@@ -45,7 +45,7 @@ mangos_worldd_LDADD = \
../../dep/src/sockets/libmangossockets.a \
../../dep/src/g3dlite/libg3dlite.a

-mangos_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/g3dlite -L../bindings/universal/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic
+mangos_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/g3dlite -L../bindings/scriptdev2/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic

## Additional files to include when running 'make dist'
# Include world daemon configurationskinlayers

P1raten
08-02-10, 01:23 AM
Nice guide. +rep

Apple
08-02-10, 01:33 AM
yeah reall nice +rep

treetree
08-02-10, 04:04 PM
nice guide and ubunto
information, It will be
awhile before i figure
this out :)

tree :)

skinlayers
08-02-10, 07:50 PM
nice guide and ubunto
information, It will be
awhile before i figure
this out :)

tree :)

Ok. A patch was created by notagain to fix evo-X's SD2. I've created a new patch files called evoxlinux2.patch that combines the other patches need to compile it under linux with notagain's SD2 fix. I've updated and tested the instructions. I'll attempt to keep this one as well as the master copy of my Guide on the evo-X forums updated as the source changes over time.

skinlayers

treetree
09-02-10, 06:13 AM
nice I will be following
this and nice work keep it up,,

tree :)

skinlayers
11-02-10, 05:07 AM
No longer needed. Use updated evox-sd2linux.patch

skinlayers

skinlayers
17-02-10, 09:12 PM
Hehe... I'm never going to get any rep for just editing the same post over and over ;)

Contents of updated evox-sd2linux.patch


diff -rupN a/configure.ac b/configure.ac
--- a/configure.ac 2010-02-17 18:49:07.000000000 -0800
+++ b/configure.ac 2010-02-17 18:49:50.000000000 -0800
@@ -297,7 +297,11 @@ AC_CONFIG_FILES([
src/mangosd/Makefile
src/mangosd/mangosd.conf.dist
src/bindings/Makefile
- src/bindings/universal/Makefile
+ src/bindings/scriptdev2/Makefile
+ src/bindings/scriptdev2/scriptdev2.conf.dist
+ src/bindings/scriptdev2/config.h
+ src/bindings/scriptdev2/sql/Makefile
+ src/bindings/scriptdev2/sql/Updates/Makefile
])

## Configure ACE, if needed
diff -rupN a/src/bindings/.gitignore b/src/bindings/.gitignore
--- a/src/bindings/.gitignore 2010-02-17 18:49:08.000000000 -0800
+++ b/src/bindings/.gitignore 2010-02-17 18:49:50.000000000 -0800
@@ -11,4 +11,4 @@
#
# Scripting projects
#
-#universal
+scriptdev2
diff -rupN a/src/bindings/Makefile.am b/src/bindings/Makefile.am
--- a/src/bindings/Makefile.am 2010-02-17 18:49:08.000000000 -0800
+++ b/src/bindings/Makefile.am 2010-02-17 18:49:50.000000000 -0800
@@ -14,4 +14,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

-SUBDIRS = universal
+SUBDIRS = scriptdev2
diff -rupN a/src/bindings/scriptdev2/config.h.in b/src/bindings/scriptdev2/config.h.in
--- a/src/bindings/scriptdev2/config.h.in 1969-12-31 16:00:00.000000000 -0800
+++ b/src/bindings/scriptdev2/config.h.in 2009-08-03 05:59:25.000000000 -0700
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SC_CONFIG_H
+#define SC_CONFIG_H
+
+#include "Platform/CompilerDefs.h"
+#include "revision.h"
+
+// Format is YYYYMMDDRR where RR is the change in the conf file
+// for that day.
+#define SD2_CONF_VERSION 2009040501
+
+#ifdef WIN32
+ #define MANGOS_DLL_EXPORT extern "C" __declspec(dllexport)
+#elif defined( __GNUC__ )
+ #define MANGOS_DLL_EXPORT extern "C"
+#else
+ #define MANGOS_DLL_EXPORT extern "C" export
+#endif
+
+#ifndef _VERSION
+ #define _VERSION "Revision [" REVISION_ID "] " REVISION_DATE " " REVISION_TIME
+#endif
+
+// The path to config files
+#ifndef SYSCONFDIR
+ #define SYSCONFDIR ""
+#endif
+
+#if PLATFORM == PLATFORM_WINDOWS
+ #ifdef _WIN64
+ #define _FULLVERSION _VERSION " (Win64)"
+ #else
+ #define _FULLVERSION _VERSION " (Win32)"
+ #endif
+ #define _SCRIPTDEV2_CONFIG "scriptdev2.conf"
+#else
+ #define _FULLVERSION _VERSION " (Unix)"
+ #define _SCRIPTDEV2_CONFIG SYSCONFDIR"scriptdev2.conf"
+#endif
+
+#endif
diff -rupN a/src/mangosd/Makefile.am b/src/mangosd/Makefile.am
--- a/src/mangosd/Makefile.am 2010-02-17 18:49:08.000000000 -0800
+++ b/src/mangosd/Makefile.am 2010-02-17 18:49:50.000000000 -0800
@@ -34,7 +34,7 @@ mangos_worldd_SOURCES = \

## Link world daemon against the shared library
mangos_worldd_LDADD = \
- ../bindings/universal/libmangosscript.la \
+ ../bindings/scriptdev2/libmangosscript.la \
../game/libmangosgame.a \
../shared/Database/libmangosdatabase.a \
../shared/Config/libmangosconfig.a \
@@ -45,7 +45,7 @@ mangos_worldd_LDADD = \
../../dep/src/sockets/libmangossockets.a \
../../dep/src/g3dlite/libg3dlite.a

-mangos_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/g3dlite -L../bindings/universal/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic
+mangos_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/g3dlite -L../bindings/scriptdev2/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic

## Additional files to include when running 'make dist'
# Include world daemon configurationskinlayers

StickyIcky
17-02-10, 09:12 PM
Nice guide
+repx3

skinlayers
20-02-10, 08:07 AM
Updated for evo-X 490 (based on MaNGOS 9415).

The SD2 folder is a little messed up. Parts of it are in scriptdev2, and other parts are in Scriptdev2. Windows users won't notice. Since their OS is case-insensitive it will effectively merge the folders together. The commands in red are a temporary work around until this gets fixed. src/bindings/scriptdev2/config.h.in is still missing and must be downloaded from the SD2 svn.

skinlayers

kekr
22-02-10, 03:31 PM
i needed that..:D...ty:)

skinlayers
25-02-10, 03:08 PM
After being frustrated for weeks at having to apply the same fixed for linux compiles over and over, I decided to create my own repo and fix them there. Both Core & Branch contain updated AHbot and playerbot branches as well as a combined branch that has both.Though my repo was create with linux users in mind, it should work just fine for Windows users as well.

http://github.com/skinlayers

evo-X-Core is exactly the same as the beleko repo, except for I've added Branch commit 65. This fixes the compile errors that was breaking building the source under linux.

evo-X-Branch is a little different. I have no real interest in 3.3.3 until the client is officially released. I want to maintain compatibility with the current 3.3.2 client. So what I've done is fork evo-X-Branch at commit 59 (the last to support 3.3.2), and back ported Branch commits 60 - 82 (83 was a 3.3.3 PTR specific update). That way, I can have 3.3.2 clients but also have all of the updates up to Branch 83.


For evo-X-Core 492

After cloning my repo with:

git clone git://github.com/skinlayers/evo-X-Core.gitFor AHbot:

cd evo-X-Core
git checkout origin/ahbot
git checkout -b ahbotFor playerbot:

cd evo-X-Core
git checkout origin/playerbot
git checkout -b playerbotFor both AHbot & playerbot:

cd evo-X-Core
git checkout origin/combined
git checkout -b combined
For evo-X-Branch 82/83

After cloning my repo with:

git clone git://github.com/skinlayers/evo-X-Branch.gitFor AHbot:

cd evo-X-Branch
git checkout origin/ahbot
git checkout -b ahbot
cd evo-X-Core-3.2.2For playerbot:

cd evo-X-Branch
git checkout origin/playerbot
git checkout -b playerbot
cd evo-X-Core-3.2.2For both AHbot & playerbot:

cd evo-X-Branch
git checkout origin/combined
git checkout -b combined
cd evo-X-Core-3.2.2Enjoy!
skinlayers

Dimman
16-03-10, 11:09 AM
Evo-x is a private core now right ? I think sajja closed it because people shared it without credits sad but true. lol