Compiling: Linux

From ArcEmu-Wiki
(Difference between revisions)
Jump to: navigation, search
(Initial Setup)
(MySQL Setup)
Line 31: Line 31:
<source lang="bash"> sudo apt-get install mysql-server mysql-client libmysqlclient16-dev </source>
<source lang="bash"> sudo apt-get install mysql-server mysql-client libmysqlclient-dev </source>

Revision as of 19:56, 1 June 2011

ArcEmu currently ONLY supports: 3.3.5a 12340 June 29, 2010

Ico info.png Its better to learn your operating system before jumping into it, set up a virtual machine with Ubuntu or your targeted OS before you buy some fancy virtual server to play with. (As many of our users DO buy them, and don't know a thing about using them or troubleshooting them.)


Basic Linux Setup

Please note: this guide has been written with the objective of setting up a Linux server running a generic kernel/OS, like Ubuntu. This help file has been written with strict use of the console in mind. Linux was made to run command line, so there isn't an easier, quicker way to do things than the way we are about to do them. Please note, as I write this guide for Ubuntu that Aptitude is the default package manager, other operating systems may have a different package manager.

The only part of an ubuntu desktop system GUI we can use is the subversion downloader(Speaking about RabbitVCS which you should have found on a page before this), everything else must be done via the command line or script.

Of course Ubuntu is not the only Linux distribution available. For example if you have CentOS you should follow our CentOS guide: Compiling:CentOS

Initial Setup

First, having presumably installed a fresh copy of Linux, we need to update our server so that we can compile ArcEmu. This will require several different packages. For the following commands, log in as the Linux root administrator.

 sudo apt-get install g++ subversion cmake

 sudo apt-get install zlib1g-dev libssl-dev libpcre3-dev

MySQL Setup

First we need to install MySQL into Linux as well as make sure that we have the correct libraries to properly operate it.

 sudo apt-get install mysql-server mysql-client libmysqlclient-dev

In order to make your MySQL server available to other computers aside from your host (this is generally a good idea), comment out the following line:

 vi /etc/mysql/my.cnf
 '''#'''bind-address =
 (save and exit)
 /etc/init.d/mysql restart

Next we have to setup the root account for MySQL so that the server isn't compromised. This step is absolutely imperative. Please choose a secure password.

 mysqladmin -u root password new-password-here
  mysqladmin -h root@hostname -u root password the-pass-you-just-chose

Substitute hostname for the hostname you chose when installing linux. That's it! Setting up MySQL is pretty straight forward.

Security and Accounts

Once that is complete, we have the right environment in Linux to compile the server. Before we can compile though we need to address some very serious security issues. Whatever distro you are using, whether your server is private or public, please do NOT run your ArcEmu server using your root account--you might as well just castrate yourself.

Having said that, lets move on to create a basic account in linux from which you will run ArcEmu. You can name this account anything you would like, but for the sake of standardization, we will name ours arcemu. While still in your root account type:

Add the user

 useradd -m -s /bin/bash arcemu

After you type in this command you will need to specify what password you will use for the account.

Set the password

 passwd arcemu

Once you have added the arcemu user, you will have a new directory in /home/arcemu/. This will be the working root directory for your installation and eventually, for running the server.

Server Compilation

Getting the Files

First, make sure you logout of the root account and then login to your arcemu account, or whatever account you just created. Next, we need to download the arcemu files to compile them. Lets make sure we are in the home directory:

 cd /home/arcemu/

I am a fan of organization, so lets make some directories and organize this mess. We will create an installer, server, and arcmenu directory so that we can keep all of our files straight. The installer directory may seem like a waste for now, but it will come into play later when we install the database.

 mkdir /home/arcemu/installer
 mkdir /home/arcemu/installer/arcemu
 mkdir /home/arcemu/server

As you may have guessed, the installer directory will contain the arcemu files, and the server directory will contain the actual compiled files (like the libraries and binaries) to run the server. The next step is to download the files, so we will change to our installer/arcemu directory and use svn to get the files.

cd /home/arcemu/installer/arcemu
svn co


Start Compiling

Once we have the files we can start compiling ArcEmu. The first step is to create the configuration file that will be used to pass the variables to the make file so that ArcEmu will compile properly.

cd /home/arcemu/installer/arcemu/trunk/cmake

cmake -DCMAKE_INSTALL_PREFIX=/home/arcemu/server

Ico info.png This will configure Arcemu to be built using the default configuration, which is fine for most people, however if you'd like to customize it more take a look at CMake

Ico info.png Luabridge is broken on 64bit Linux. X64 users will have to wait for a fix to be able to use Luabridge. You will have to build without LuaBridge to be able to use Arcemu, please check the above link for details about how to do that.

Then we now simply invoke make and make install to install to the prefix directory

make && make install

Also, if you have a multicore machine, then you can substitute that final command with this one, where x is equal to the number of processors + 1. For example, with 2 processors x would be 3.

If you want to use all your processors just use a large number like 15.

 make -j x && make install

This will not effect your server, this will only tell "make" to compile using all of your available CPU power

If this last step is successful then you are ready to configure your server and get on your way.


DBC and map files

Next you will transfer the DBC and map files over to your server.

Ico info.png DBC Extraction is now on its OWN page. Please come back to THIS page when you are done extracting DBCs!

To extract DBCs, follow the guide on the page below.


Use Wine if you must but preferably a windows machine to extract the DBCs, maps.

mkdir /home/arcemu/server/DBC
mkdir /home/arcemu/server/maps

Place the DBC and map files in their respective directories above.

Config Files

All that is left to do is create the /etc/ directory and move the configuration files into it, and make the ArcEmu binaries executable.

 cd /home/arcemu/server
 $ mkdir etc
 $ mv /home/arcemu/installer/arcemu/svn/trunk/configs/*.conf /home/arcemu/server/etc
 $ cd /home/arcemu/server
 $ chmod a+x arcemu-logonserver
 $ chmod a+x arcemu-world

Now your configuration files are in the .../etc folder ready to be edited, and used by the ArcEmu server and your ArcEmu binaries are executable.

MySQL Setup

The first step in setting up the database will be setting up a mysql user and databases to interact with ArcEmu. Please change the respective usernames and passwords to your own unique variants! Note, when it asks for your password, please enter your root mysql password.

 $ mysql -u root -p
 CREATE USER 'username'@'%' IDENTIFIED BY 'password';
 GRANT USAGE ON * . * TO 'username'@'%' IDENTIFIED BY 'password' 
 CREATE DATABASE `arcemu-world` ;
 GRANT ALL PRIVILEGES ON `arcemu-world` . * TO 'username'@'%';
 CREATE DATABASE `arcemu-acct` ;
 GRANT ALL PRIVILEGES ON `arcemu-acct` . * TO 'username'@'%';

After we have setup the database, its time to start downloading the files.

Get a world database


This concludes the compile section of the Wiki. You should now have a fully functioning copy of ArcEmu. Refer to the sections below for information on how to startup and perform basic administrative functions.

Configuration Files

Use an editor of your choice, in this example it'll be nano. Make sure to read all files at least once, so you know what configuration is where and you don't end up with an administrator account with default password you didn't know about ;)

  cd /home/arcemu/server/etc
  nano logonserver.conf
  nano optional.conf
  nano realms.conf
  nano world.conf

The configuration is documented in Server Configuration, but the configuration files are richly documented, too. You should be fine :)

Starting the Server

Using Screen

~ This article has been consolidated here Screen

Please return to this page for the next step in the process after reading about Screen and how to use it to launch ArcEmu.


You're now ready to move on to Server configuration

Personal tools