EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Linux Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=588)
-   -   EQEmu on Debian 6 within vSphere 5.0 (ESXi) 12-17-2011 (https://www.eqemulator.org/forums/showthread.php?t=34631)

braindisconnect 12-18-2011 12:50 AM

EQEmu on Debian 6 within vSphere 5.0 (ESXi) 12-17-2011
 
Installing EQEmu on Debian 6 within vSphere 5.0 (ESXi)

Thanks to all the posters of linux and windows guide where a lot of this info came from.
Much came from Sikkun's guide "Debian Linux Install Guide 5/28/2011"
I made some custom one line scripts to make the process a little easier.

Get the Debian 6 ISO
  1. Download the Debian 6 i386 netinst CD image from http://www.debian.org/releases/stable/debian-installer/
  2. Upload the ISO to your ESX host.
    The revision at the time of this guide was 6.0.3

Static DNS Entry
Create a static DNS entry ahead of time for your new EQEmu VM.

Router Setup
Setup your router to forward the following protocols and ports to your server:
UDP 7000-7100
TCP 9000

Creating the VM
  1. Right click your ESX host and create a new VM
  2. Use the Typical option
  3. enter the host name
  4. Select desired datastore
  5. Choose Linux and select Debian 6 (32-bit)
  6. You need one NIC with E1000 (Debian won't recognize the VMXNET3 adapter)
  7. Change storage to 100GB with Thin Provision
  8. Select Edit the virtual machine settings before creating option
  9. Change memory to at least 6GB
  10. Change CPU to at least 2 virtual sockets and 2 cores per socket
  11. Point then DVD to your Debian 6 32 bit ISO and select connect at power on
  12. Remove the floppy drive
  13. Click finish and power on VM when the process completes.

Right click your VM and open a console or click on the console tab
  1. Choose Install
  2. Choose your language
  3. Choose your country
  4. Choose your keyboard layout
  5. Enter host name
  6. Enter domain
  7. Enter root password
  8. Enter full name for user; EQEmu
  9. Enter username; eqemu
  10. password for eqemu
  11. Choose your timezone
  12. hit return on partioning
  13. hit return on disk to partition
  14. hit return on finish partitioning
  15. Write changes to disk? tab to yes and hit return (this took a few minutes)
  16. Wait for it to install the base system...
  17. Select your country
  18. Select the default which should be ftp.<country code>.debian.org
  19. Configure your proxy if you need to
  20. Select no on the package survey
  21. Package Install
    • De-select the Graphical Desktop Environment
    • Select SSH Server
    • Select Standard system utilities
  22. Hit enter on grub loader; yes
  23. Hit enter on fishing the installation; Continue

Post Install
  1. Login as root through VM console
  2. Verify that your interface is static
    Code:

    more /etc/networks/interfaces
  3. If the iface eth0 says iface eth0 init dhcp, configure it for static:
  4. edit /etc/networks/interfaces with your favorite editor
  5. change iface eth0 init dhcp to (change the information for your network):
    Code:

    iface eth0 inet static
          address 192.168.1.10
          netmask 255.255.255.0
          network 192.168.1.0
          broadcast 192.168.1.255
          gateway 192.168.1.1

  6. Exit and save
  7. Install packages for Higher Memory Support, VMware Tools, and EQEmu
    Code:

    apt-get -y install linux-image-2.6.32-5-686-bigmem linux-headers-2.6.32-5-686-bigmem make
  8. reboot once its done

VMware Tools Install
  1. Right click your VM, select Guest, and then Install/Upgrade VMware Tools
  2. Login as root to your VM via SSH
  3. Mount your cdrom:
    Code:

    mount /dev/cdrom /mnt
  4. Copy the tools to root's home directory, extract, and run (change the version to match):
    Code:

    cp /mnt/VMwareTools-<version>.tar.gz ./
    tar -zxvf VMwareTools-<version>.tar.gz
    ./vmware-tools-distrib/vmware-install.pl -d

  5. Once it has completed, remove the archive and directory:
    Code:

    rm VMwareTools-<version>.tar.gz
    rm -rf vmware-tools-distrib

  6. reboot

Packages for EQEmu
  1. Login as root to your VM via SSH, from now on everything is done via SSH.
    Code:

    apt-get -y install gcc g++ make libio-stringy-perl libperl-dev unzip mysql-server subversion
  2. Enter a password for MySQL root
    Code:

    apt-get -y install libmysqlclient15-dev


Getting the Sources
  1. Sudo to eqemu:
    Code:

    su - eqemu
  2. Make directories:
    Code:

    mkdir eqemu source peq server maps quests
  3. Grab the SVN's:

Compile EQEmu
  1. Still as eqemu
    Code:

    cd source
    cp -r ../eqemu/trunk/EQEmuServer/* ./

  2. If you want Bots, now is the time:
    • Edit zone/makefile and add -DBOTS to DFLAGS.
    • Edit zone/makefile.common and add both bot.o and botspellsai.o
    • Edit world/makefile and add -DBOTS to DFLAGS.
  3. Compile:
    Code:

    make
You will see many warnings... don't panic...
If make stops with an error, then you can panic. Trace the steps and correct what you missed.


Copying and Linking Files to the server Directory
  1. Go back to root:
    Code:

    exit
  2. Copy libEMuShareMem to lib dir:
    Code:

    cp /home/eqemu/source/EMuShareMem/libEMuShareMem.so /usr/lib/
  3. edit /etc/sysctl.conf and add a new line with your fovorit editor:
    Code:

    kernel.shmmax = 134217728
  4. save, exit, and chmod
    Code:

    chmod 444 /etc/sysctl.conf
  5. Execute sysctl to effect the changes
    Code:

    /sbin/sysctl -p
  6. Sudo back to eqemu
    Code:

    su - eqemu
  7. Change to server dir, copy and create links
    Code:

    cd server
    cp -r ../source/utils/defaults/* ./
    cp ../source/utils/patch_* ./
    cp ../source/utils/opcodes.conf ./
    cp ../source/utils/cleanipc ./
    cp ../source/world/world ./
    cp ../source/zone/zone ./
    cp ../source/eqlaunch/eqlaunch ./
    rm -rf Maps plugins quests
    ln -s ../maps Maps
    ln -s ../quests/plugins plugins
    ln -s ../quests quests


Database Setup Part 1
  1. Still as eqemu, unzip the database changing the rev number to yours:
    Code:

    cd /home/eqemu/peq
    gunzip peqdb_rev<rev number>.sql.gz

  2. Remember the rev number...
  3. Create a file called sourceme putting the following lines in changing the rev number to match your file remove the bots line if you did not compile bots:
    Code:

    create database peq;
    use peq
    source peqdb_rev<rev number>.sql
    source load_player.sql
    source load_bots.sql
    exit

  4. Then run:
    Code:

    mysql -u root -p < sourceme
    Take a break. This is going to take a a few minutes... This is why the few commands were scripted :-)

Database Setup Part 2
Ok.. time for the last part of the database...
  1. Change to the source sql directory:
    Code:

    cd /home/eqemu/source/utils/sql/svn
  2. Create a new filed called sourceme and add use peq to it:
    Code:

    echo "use peq" > sourcesql
  3. If you compiled bots run these commands in order:
    Code:

    ls -la bot*.sql | tr -s " " | cut -d " " -f9 | sort -n | sed  's/^/source /' | sort -r >> sourcesql
    ls -la [0-9]*bot*.sql | tr -s " " | cut -d " " -f9 | sort -n | sed  's/^/source /' >> sourcesql

  4. Run this command and change 2082 to whatever version your database rev number is minus 1. My version was 2083.
    Code:

    ls -la [0-9]* | tr -s " " | cut -d " " -f9 | sort -n | awk -F'_' '$1 > 2082' | sed  's/^/source /' >> sourcesql
  5. Remove the duplicates and create the sourceme file:
    Code:

    cat sourcesql | uniq > sourceme
  6. Now source it in with mysql:
    Code:

    mysql -u root -p < sourceme
    If you get errors, search the forums to see if you need to correct them or not.

Getting your Login Server Account
  1. Go to the Main Page of EqEmu http://www.eqemulator.org/
  2. Click on the Loginserver Accounts link.
  3. Click on Create New Worldserver Account
  4. Create your Server account. The username and password is needed for your config file.

Edit Your Config file
  1. Still as eqemu
    Code:

    cd /home/eqemu/server
    mv eqemu_config.xml.full eqemu_config.xml

  2. edit eqemu_config.xml with your favorite editor
    1. In the world section change the longname and short name to your EQ world name.
    2. In the world, loginserver section put your loginserver username and password.
    3. In the world section change the key to a string for your launcher.
    4. In the zones section change the defaultstatus to 0
    5. In the database section, change username and password to your mysql credentials.
    6. In the database section, change db to peq.
  3. Save and exit

Create your Server start and stop files
  1. Still as eqemu
    Code:

    cd /home/eqemu/server
  2. Create your start, copy and paste into your terminal:
    Code:

    cat > start << EOD6
    #!/bin/bash
    # Auto generated by EQEmu Installer v$EQEMU_INSTALLER_VER on $EQEMU_INSTALL_DATE

    # Include our configuration.
    #source eqemu.conf

    #ulimit -c 99999999

    # Start the login server.
    if [ \$USE_LOGIN_SERVER ]; then
      ./EQEmuLoginServer 2>&1 > logs/loginserver &
    fi

    # Remove any shutdown files.
    rm -f .zone_shutdown
    rm -f .world_shutdown

    # Print commands and their arguments as they are executed.
    set -x

    # Launcher name.
    LNAME="zone"
    if [ "\$1" = "test" ]; then
      LNAME="test"
    fi

    # Set our library path.
    P=`pwd`
    export LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:\$P"

    # Make sure we have a place to log.
    mkdir -p logs 2>&1 > /dev/null

    # Clear out old logs, if both are stopped.
    if [ ! -e .lock-zones -a ! -e .lock-world ] ; then
      for f in logs/eqemu_*.log
      do
        # Keep the commands_zone log.
        if [ "\$f" = "logs/eqemu_commands_zone.log" ]; then
          continue;
        fi
        rm -f \$f
      done
    fi

    # Boot up world.
    if [ ! -e .lock-world ] ; then
      # Create our lock file.
      touch .lock-world
     
      # Determine how to run the world server.
      if [ \$USE_PERSIST_WORLD ]; then
        ./persist_world 2>&1 > logs/world &
      else
        ./world 2>&1 > logs/world &
      fi
     
      # wait for shared memory to load
      sleep 15
    fi

    # Start up the official launcher.
    if [ ! -e .lock-launcher ]; then
      # Create our lock file.
      touch .lock-launcher
     
      # Launch!
      ./eqlaunch \$LNAME 2>&1 > logs/launcher &
    fi

    # Determine if we should start the chat server.
    if [ \$USE_CHAT_SERVER ]; then
      ./chatserver 2>&1 > logs/chatserver &
    fi

    # Determine if we should start the mail server.
    if [ \$USE_MAIL_SERVER ]; then
      ./mailserver 2>&1 > logs/mailserver &
    fi
    EOD6

  3. Create the persist_world file, copy and paste the following into your terminal:
    Code:

    cat > persist_world << EOD8
    #!/bin/bash

    #ulimit -c 99999999

    while true
    do
      ./world "\$@"
      if [ -r ".world_shutdown" ]; then
        exit 0
      fi

      echo `date` " - World crashed." >> crashlog
      sleep 2
    done
    EOD8

  4. Create your stop file, copy and paste the following into your terminal:
    Code:

    cat > stop << EOD7
    #!/bin/bash
    # Auto generated by EQEmu Installer v$EQEMU_INSTALLER_VER on $EQEMU_INSTALL_DATE

    # Include our configuration.
    #source eqemu.conf

    # Create our shutdown files.
    touch .zone_shutdown
    touch .world_shutdown

    targets="world eqlaunch zone"

    # Login Server Check
    if [ \$USE_LOGIN_SERVER ]; then
      targets="\$targets EQEmuLoginServer"
    fi

    # Chat Server Check
    if [ \$USE_CHAT_SERVER ]; then
      targets="\$targets chatserver"
    fi

    # Mail Server Check
    if [ \$USE_MAIL_SERVER ]; then
      targets="\$targets mailserver"
    fi

    killall \$targets

    # Small pause here.
    sleep 3

    # If world/zone/eqlaunch is stuck we'll 'kill -9' them here.
    if ps ax | grep -e 'w[o]rld' -e 'z[o]ne' -e 'eq[l]aunch' > /dev/null; then
      killall -9 world zone eqlaunch
      sleep 2
    fi

    # Run our IPC cleaning.
    ./cleanipc

    # Remove any lock files.
    rm -f .lock-zones .lock-world .lock-login .lock-launcher
    EOD7

  5. Make start, persist_world, and stop executable:
    Code:

    chmod 750 start
    chmod 750 persist_world
    chmod 750 stop


Thats it, startup your server and login with your player account.

If you get errors, then you missed something, trace your steps through the guide and fix anything you missed. Otherwise search the forums.

Additional
You can edit your database after you logged in to make your character the server admin, by changing the status to 200 on your account.
Code:

mysql -u root -p
use peq
UPDATE account SET status=200 WHERE name='youraccountname';
exit

You can increase the number of zones that can be active at a time, the default is 5;
Code:

mysql -u root -p
use peq
UPDATE launcher SET dynamics=5 where name='zone';
exit


braindisconnect 12-18-2011 12:51 AM

Reserved - Reserving this for later use

braindisconnect 12-19-2011 06:46 PM

Oops.. guess they don't allow editing after a set time... anyway, correction to the Router Setup section:

Router Setup
Setup your router to forward the following protocols and ports to your server:
UDP 7000-7100
TCP & UDP 9000

It may just be UDP 9000, but I see both ports listening on linux. Also a good idea to setup iptables to harden your linux box.

trevius 12-20-2011 12:00 AM

Looks like a nice guide. It would be best if you just add it to the wiki though. Then you can edit it all you like and others can edit it as well if needed.

One quick note from glancing through is that you should really just use ucs instead of chatserver and mailserver. The ucs (universal chat server) replaced both of them and works for all clients.

braindisconnect 01-02-2012 08:27 AM

@Trevius

I have added this to the wiki: http://www.eqemulator.net/wiki/wikka...nLinuxOnVMware

The chat server and mail server options aren't enabled by the start script, but are leftover from the time when they existed. The scripts are old and I didn't update them.

I may update them later.

Gem 01-16-2012 03:40 AM

problem using start script
 
I'm having the following problem when trying to run the start script. Have you seen this before, or have any idea what the problem could be?

eqemu@eqserver:~/server$ ./start
+ LNAME=zone
+ '[' '' = test ']'
+ P=/home/eqemu/server
+ export LD_LIBRARY_PATH=:/home/eqemu/server
+ LD_LIBRARY_PATH=:/home/eqemu/server
+ mkdir -p logs
./start: line 39: syntax error near unexpected token `then'
./start: line 39: `* * if [ "$f" = "logs/eqemu_commands_zone.log" ]; then'

Noport 01-16-2012 06:12 AM

could be missing log.ini blank file needs to be placed in server directory.

Gem 01-16-2012 04:17 PM

The blank log.ini does exist in the server directory.

It seems like this problem is only happening with the nested if statements. There are 2 nested if statements in the script, and both get the same error.

Gem 01-16-2012 05:12 PM

After I replaced the whitespace which indented these blocks of code, the problem stopped... strange. I deleted the whitespace and indented with the same number of spaces.

braindisconnect 01-20-2012 01:24 AM

@Gem
You've peaked my curiosity with the white space issue. I want to see if I can duplicate the issue. I will work on cleaning up the scripts and removing deprecated portions.

Are you running on bare metal or VMware?

Did you copy the scripts from the Wiki or the forum?

How were you copying and pasting the script? Directly to a console/terminal or using notepad or another editor.

Where you on the console or using Putty or another terminal emulation program from Windows?

Thanks in advanced!

hayward6 06-07-2012 04:53 PM

I've got to ask this, because it's probably been the only reason I ever install the gui when setting up Debian Linux... How do you copy the spells.txt and spells.en files from windows? Your guide says to do it, but not how... In the past Iv'e used webmin, but in this guide you never set that up. Is it as simple as using ftp to put them there? Just curious as to how everyone else does this.

I'm thinking about opening my server back up, and I would love to drop the gui!

Thanks

Vexyl 06-07-2012 06:15 PM

Mount the windows partition and copy them to the appropiate folder.

Take a look at the `mount` and `cp` commands. If you have a GUI desktop you may be able to simply mount them by simply double clicking on the windows partition (possibly showed on the desktop) and supplying the root password.

Alternatively you could just boot into windows and put the files on a flash drive and then boot back into Debian.

hayward6 06-08-2012 08:21 AM

Quote:

Originally Posted by Vexyl (Post 210043)
Mount the windows partition and copy them to the appropiate folder.

Take a look at the `mount` and `cp` commands. If you have a GUI desktop you may be able to simply mount them by simply double clicking on the windows partition (possibly showed on the desktop) and supplying the root password.

Alternatively you could just boot into windows and put the files on a flash drive and then boot back into Debian.

Yeah with the gui most of the steps to setting up a server are easier... Thats why I run my server with the gui enabled. I would love to be able to cut down on the size of the vm by eliminating it, but it just doesn't seem worth it.

Vexyl 06-08-2012 03:00 PM

@hayward6
Once you get comfortable with the command-line, it's very powerful and even sometimes fun.

That said, for a simple EQEmu setup I don't think a desktop GUI will affect performance all that much.
Either way you have access to the command-line (through a terminal emulator) which can be very helpful.

braindisconnect 07-22-2012 12:24 AM

Added information to the Wiki page for connecting to a Linux box without a GUI. Basically if you're on a Windows machine you have to use terminal emulation by using Putty or SecureCRT. For transferring files without setting up samba use WinSCP, Putty-SCP, Putty-SFTP, or SecureFX.

sorvani 07-22-2012 07:22 PM

I like Bitvise Tunnlier for connecting to a headless Linux box as it includes both an SSH terminal session and SSH file transfer.

revloc02c 09-21-2012 07:30 PM

Quote:

Originally Posted by braindisconnect (Post 205420)
Also a good idea to setup iptables to harden your linux box.

What does this mean?

sorvani 09-22-2012 12:30 AM

iptables is a firewall. always a good idea to have a solid firewall configured.

revloc02c 09-22-2012 02:57 PM

ah, thanks sorvani

Quote:

Originally Posted by braindisconnect (Post 205396)
Edit zone/makefile.common and add both bot.o and botspellsai.o

In zone/makefile.common I see a "SF=" with a whole list of .o files in it, but they look like directories.
Code:

...
SF= .obj/EQPacket.o .obj/EQStream.o .obj/EQStreamFactory.o .obj/CRC16.o \
  ../common/timer.o  ../common/packet_dump.o ../common/packet_functions.o \
  ../common/unix.o ../common/packet_dump_file.o ../common/Mutex.o ../common/MiscFunctions.o \
  zone.o entity.o mob.o client.o client_process.o npc.o net.o spawn2.o attack.o hate_list.o \
...

So is this list where bot.o and botspellsai.o go?

And if so, do I just add them on the end of the list?

lerxst2112 09-22-2012 04:22 PM

The last line you posted doesn't include any directories. They are filenames. You add the two bot filenames in that list, anywhere you like as long as you follow the rules for how makefiles work. I recommend right after QuestParserCollection.o, put a single space between each name and do not add a carriage return anywhere.

revloc02c 09-24-2012 10:43 PM

Thanks lerxst, I appreciate you guys answering my linux questions.

When I run this:
Code:

apt-get -y install linux-image-2.6.32-5-686-bigmem linux-headers-2.6.32-5-686-bigmem make
I get this:
Code:

E: Unable to locate package linux-image-2.6.32-5-686-bigmem
E: Couldn't find any package by regex 'linux-image-2.6.32-5-686-bigmem'
E: Unable to locate package linux-headers-2.6.32-5-686-bigmem
E: Couldn't find any package by regex 'linux-headers-2.6.32-5-686-bigmem'

I tried Google to just learn more about it, but my search-fu was not powerful enough (I am trying to really learn it, as opposed to just getting quick plug and play answers).

Anyway, can someone please help me here.

lerxst2112 09-24-2012 11:30 PM

Since this guide was written a while ago it refers to an old version of the kernel. You would want whatever the current version is.

Dylan1994 05-16-2014 10:45 AM

Permission Denied?
 
Compile EQEmu
Still as eqemu
Code:
cd source
cp -r ../eqemu/trunk/EQEmuServer/* ./


When trying to run the cp -r command it's giving me a bunch of Permission denied.... And I am su'ed so I'm kinda confused on why.

Trubles 05-16-2014 12:57 PM

r u root
/ten

hayward6 07-17-2014 08:13 PM

make
 
It's been a long time since I have gone through a new server setup, but this is the guide I always followed. I have tried several times today and I keep getting stuck at the compile stage. The error is this
Code:

make: *** No targets specified and no makefile found.  Stop.

joligario 07-17-2014 08:22 PM

Sounds like your cmake process didn't create the needed files. Looking at the date of this guide, I don't think it has the cmake instructions.

hayward6 07-18-2014 10:44 AM

Quote:

Originally Posted by joligario (Post 231980)
Sounds like your cmake process didn't create the needed files. Looking at the date of this guide, I don't think it has the cmake instructions.

Yeah, the guide doesn't use cmake so cmake hasn't even been installed... I will try that out, but I might be in rough shape if I have to start deviating from the guide at all. That guide used to be perfect.

bensode 08-08-2014 09:07 PM

Updated for CMAKE?
 
Any luck with using this guide with CMake? Recent post as of last month so I would hope someone could point in the right direction :D

Actually I found what I was looking for if someone wants to update the Wiki and post ...

#aptitude install cmake

$ cmake -G "Unix Makefiles" -Wno-dev -i .

[ accepted all the defaults ]

$ make

hayward6 08-09-2014 09:57 AM

Quote:

Originally Posted by bensode (Post 232685)
Any luck with using this guide with CMake? Recent post as of last month so I would hope someone could point in the right direction :D

Actually I found what I was looking for if someone wants to update the Wiki and post ...

#aptitude install cmake

$ cmake -G "Unix Makefiles" -Wno-dev -i .

[ accepted all the defaults ]

$ make

You want this guide right here!

http://wiki.eqemulator.org/p?EQEmu_o...n_7_Virtualbox


All times are GMT -4. The time now is 05:24 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.