logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
HOWTO: Compile & run nwnx2-core-2.8 on 64bit Debian/Ubun

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Mon Jun 13, 2011 11:29    Post subject: HOWTO: Compile & run nwnx2-core-2.8 on 64bit Debian/Ubun Reply with quote

To properly run nwserver with the newest plugins & addons on a 32bit distribution, you need to provide all dynamic linking requirements (like libmysqlclient). This is easy, because you just need to apt-get install them (and the ./install.sh script tells you which ones).

nwnx2 however, does not compile against or run with native 64bit libraries, due to intrinsic details (nwserver being purely 32bit among them).

This "howto" assumes a few crucial things and prequisites:
- You actually want to build nwnx2 yourself and not use the prebuilt binaries.
- You are running Debian or Ubuntu 64bit (will not apply to other distros like RHEL or CentOS). This here is NOT neccessary if you run a 32bit distribution. You can just use ./install.sh there. You can check your distribution by typing uname -m. x86 is 32bit, x86_64 is 64bit respectively.
- You have root access.
- Your nwn server runs as it's own distinct user. This is VERY STRONGLY recommended, alone from a security standpoint.
- You know how to use ssh, edit files and install packages without breaking anything.

The easiest way, on Debian, Ubuntu and similars, is to compile & run nwnx2 inside a chroot. A chroot system is a complete system distribution living inside a subdirectory below your root (/), which you can "change root" into.

This will be a very brief and hopefully useful guide to setting up such a chroot for nearly transparent usage.

As usual, commands pefixed with # are meant to be run as root, $ as the user your NWN runs with.

First, you need to create a chroot:
Code:
# debootstrap --arch i386 squeeze /nwx86


Please note the "squeeze", which is the current stable distribution of debian. If you're using Ubuntu server, you'll be using one of the ubuntuified version names (maverick, for example). The above command will install your new chroot into /nwx86 (you can change it, but if you do, change it everywhere).

After downloading and unpacking a few hundred megabytes, your chroot is basically ready. However, you need to make it useable for your nwserver user. There's a little tool called "schroot", which you will install now:
Code:
# apt-get install schroot


And, after installing, configure schroot by pasting this into the bottom of /etc/schroot/schroot.conf (take care not to add comments in front, and replacing the username with your nwserver user):

Code:

[default]
directory=/nwx86
users=INSERT_YOUR_NWN_USER_HERE
personality=linux32


Now it's as simple as typing:
Code:
# schroot ls

To run a command inside the chroot.

However, we're not done yet. We need to somehow map the directory where all your nwn-related files reside into the chroot environ.
Code:
# mount --bind /home /nwx86/home

This howto assumes that your nwserver code resides inside /home, and the above command will simply mount a "link" to your regular /home inside the chroot.

If you want this done automatically on the next host reboot, add the following to /etc/fstab in a new line (pay particular attention here, breaking this file might render your system non-bootable):
Code:

/home /nwx86 none bind 0 0


Now all that is left will be installing all the required dependant libraries. You can do that by using schroot as root, for example:

Code:
# schroot apt-get install autoconf make build-essential gcc g++ zlib1g-dev
(and any others ./install.sh will later on moan about).

Switch to your nwserver user, and check out the nwnx2 code:

Code:
$ git clone https://github.com/NWNX/nwnx2-linux.git


Code:

$ cd nwnx2-linux
$ schroot ./install.sh


If it complains about your regular user not being allowed to enter the chroot, you didn't adjust the config in /etc/schroot/schroot.conf as directed above.

This should get you started. It will ask a few questions, direct you to install further packages (which you will need to install as root via schroot apt-get install ..) and finally and hopefully build libraries.

When everything is said and done, you will probably have to run the server itself inside a chroot too. This is as simple as doing schroot ./nwstartup.sh.

(Typed down tersely in one go. Comments & improvements welcome, of course)


Last edited by elven on Sun Feb 16, 2014 20:10; edited 3 times in total
Back to top
View user's profile Send private message
Epitaffio



Joined: 13 Jul 2010
Posts: 29
Location: Italy

PostPosted: Mon Jun 13, 2011 16:51    Post subject: Reply with quote

Thanks man! I love it!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group