Difference between revisions of "Installation"

From Mineserver Wiki
Jump to navigation Jump to search
m
==Binary Packages==
==Binary Packages==
−
This will be written up when there are binary releases available.
+
Currently we have binaries for Windows.
 +
Download from here: http://mineserver.be/downloads/ and install using installer.
==Source Distributions==
==Source Distributions==
 
===Prerequisites===
===Prerequisites===
−
Mineserver requires 3 external libraries: zlib, libevent and libnoise. The method of obtaining these libraries may differ system to system, so consult your operating system's manual.
+
Mineserver requires 3 external libraries: zlib, libevent and libnoise (possibly from [https://github.com/qknight/libnoise https://github.com/qknight/libnoise]). The method of obtaining these libraries may differ system to system, so consult your operating system's manual.
===General===
===General===
 
====Windows====
====Windows====
−
(needs to be filled in)
+
Prerequisites can be found at http://www.mineserver.be/downloads buildpack or you can compile those yourself. For that you will need VS2010 or mingw (no supported). Visual Studio 2008 Express (C++ version) works as well, but you need to create project files manually (for now, until we have a CMake fix)
====Debian and Similar====
====Debian and Similar====
 
====CentOS and Red Hat====
====CentOS and Red Hat====
−
CentOS, and RHEL do not provide support for libnoise natively. As such we will need to manually compile and install the library.
+
Most dependancies can be installed with the following commands:
 +
  # Install EPEL (Extra Packages for Enterprise Linux) 
 +
  sudo su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm' 
 +
  sudo yum install git libevent libevent-devel zlib zlib-devel
 +
 +
However CentOS, and RHEL do not provide support for libnoise natively. As such we will need to manually compile and install the library.
 +
  wget http://prdownloads.sourceforge.net/libnoise/libnoisesrc-1.0.0.zip?download -O libnoisesrc-1.0.0.zip
  wget http://prdownloads.sourceforge.net/libnoise/libnoisesrc-1.0.0.zip?download -O libnoisesrc-1.0.0.zip
  unzip libnoisesrc-1.0.0.zip; cd noise
  unzip libnoisesrc-1.0.0.zip; cd noise
  less README # Read this 
  less README # Read this 
  make
  make
−
cp -R include /usr/local/include/libnoise
+
sudo cp -R include /usr/local/include/noise
−
cp lib/* /usr/local/lib
+
sudo cp lib/* /usr/local/lib
−
ln -s /usr/local/lib/libnoise.so.0.3 /usr/local/lib/libnoise.so.0
+
sudo ln -s /usr/local/lib/libnoise.so.0.3 /usr/local/lib/libnoise.so.0
−
ln -s /usr/local/lib/libnoise.so.0.3 /usr/local/lib/libnoise.so
+
sudo ln -s /usr/local/lib/libnoise.so.0.3 /usr/local/lib/libnoise.so
  sudo echo "/usr/local/lib" > /etc/ld.so.conf/user.conf
  sudo echo "/usr/local/lib" > /etc/ld.so.conf/user.conf
  sudo /sbin/ldconfig
  sudo /sbin/ldconfig
−
All other dependancies can be installed with the following commands:
+
You also have to copy the contents of the src folder of the libnoise package into a folder called libnoise within the mineserver src directory:
−
# Install EPEL (Extra Packages for Enterprise Linux)
+
change directory to your mineserver src directory
−
sudo su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm'
+
mkdir libnoise
−
sudo yum install git libevent libevent-devel zlib zlib-devel
+
cp -R /path/to/libnoise/src/* ./
 +
  make
 +
====BSD Variants====
 +
Due to a problem with the libnoise package, you may need to create the proper link for the libnoise shared object file:
 +
 +
  ln -s /usr/local/lib/libnoise.so.0 /usr/local/lib/libnoise.so
 +
====Arch Linux====
====Arch Linux====
You can obtain and install the required [http://aur.archlinux.org/packages.php?ID=39041 libnoise] package through [https://wiki.archlinux.org/index.php/Arch_User_Repository AUR].
You can obtain and install the required [http://aur.archlinux.org/packages.php?ID=39041 libnoise] package through [https://wiki.archlinux.org/index.php/Arch_User_Repository AUR].
−
Arch Linux stores the development headers in ''/usr/local/include/noise'' and not ''/usr/local/include/libnoise'' like the minesever build script thinks it will.
+
Run the <code>make</code> command.
−
 
−
You can either change it in the mineserver source code - or - move it to the right location.
 
====OS X====
====OS X====
 +
 +
To install third party libraries on OS X, some convenient ways exist.
 +
Note that zlib ships with OS X by default.
 +
 +
===== MacPorts or Fink =====
 +
You can install zlib and libevent using Macports:
You can install zlib and libevent using Macports:
−
sudo port install zlib libevent
+
sudo port install libevent
−
You will need to build libnoise yourself. On OS X, this is best done by using qknight's unofficial branch. First install the libnoise prerequisities:
+
or Fink:
 +
 sudo apt-get install libevent1
 +
 +
Either way, you will need to build libnoise yourself. On OS X, this is best done by using qknight's unofficial branch. First install the libnoise prerequisities:
 +
 sudo port install cmake doxygen
 sudo port install cmake doxygen
 +
or Fink:
 +
 +
 sudo apt-get install cmake doxygen
 +
Now you can get the code:
Now you can get the code:
 
 sudo make install
 sudo make install
−
Finally, we need to create a symlink so that Mineserver finds the header files where it expects them (this saves us using sed on the source code):
+
===== Homebrew =====
−
sudo ln -s /usr/local/include/noise /usr/local/include/libnoise
+
With homebrew installed, you can just install libevent:
−
===== Change the source code =====
+
brew install libevent
−
If you want to replace all instances of 'libnoise' with 'noise' in the source code, you can simply run the <code>sed</code> application (it's usually released with all major distributions), like so:
 
−
  sed -i 's:libnoise:noise:g' mapgen.{h,cpp}
+
A formular for libnoise can be found on [http://github.com/krono/homebrew krono’s homebrew fork].
 +
Using that, you can install libnoise just the same way:
−
You can then proceed to run the <code>make</code> command.
+
brew install libnoise
 +
It does not depend on cmake and doxygen.
 +
===Building Mineserver===
===Building Mineserver===
 
====GNU/Linux====
====GNU/Linux====
−
To build the mineserver binary, use the following commands. The output should be very similar to that here:
+
To build the mineserver binary, use the following commands. The output should be very similar to that below.
−
# Change to the source directory
+
# Run cmake to generate makefile
−
user@workstation:~/mineserver$ cd src
+
user@workstation:~/mineserver$ cmake .
−
# Run make to build the binary
+
# Run make all to build the binary
−
user@workstation:~/mineserver/src$ make
+
user@workstation:~/mineserver/src$ make all
−
g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o mineserver.o mineserver.cpp
+
(Lots of compile output here)
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o map.o map.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o chat.o chat.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o commands.o commands.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o config.o config.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o constants.o constants.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o logger.o logger.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o mapgen.o mapgen.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o nbt.o nbt.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o packets.o packets.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o physics.o physics.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o sockets.o sockets.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o tools.o tools.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o user.o user.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o noiseutils.o noiseutils.cpp
 
−
  g++  -I. -I/usr/Local/include -I/usr/include -L/usr/local/lib   -c -o mersenne.o mersenne.cpp
 
−
  g++ -L/usr/local/lib -L/usr/lib -lpthread -levent -lz -lnoise  mineserver.o map.o chat.o commands.o
 
−
  config.o constants.o logger.o mapgen.o nbt.o packets.o physics.o sockets.o tools.o user.o
 
−
  noiseutils.o mersenne.o   -o mineserver
 
  # Done!
  # Done!
−
user@workstation:~/mineserver/src$
+
# Run make install to move all necessary files to bin
 +
  user@workstation:~/mineserver/src$ make install
If you receive errors referring to missing files like this:
If you receive errors referring to missing files like this:
 
Ensure that you have all the prerequisites installed. <code>zlib.h</code> is zlib, <code>event.h</code> is libevent and <code>noise.h</code>, <code>interp.h</code> or <code>mathconsts.h</code> are libnoise.
Ensure that you have all the prerequisites installed. <code>zlib.h</code> is zlib, <code>event.h</code> is libevent and <code>noise.h</code>, <code>interp.h</code> or <code>mathconsts.h</code> are libnoise.
 +
=====Arch Linux (This might be outdated?)=====
 +
 +
To install the latest development version of mineserver, you can download the [http://aur.archlinux.org/packages.php?ID=44017 mineserver-git] package from [https://wiki.archlinux.org/index.php/Arch_User_Repository AUR].
 +
 +
Example on how to install the package:
 +
 +
  user@host ~ % wget http://aur.archlinux.org/packages/mineserver-git/mineserver-git.tar.gz
 +
  user@host ~ % tar xfz mineserver-git.tar.gz
 +
  user@host ~ % cd mineserver-git
 +
  user@host ~/mineserver-git % makepkg
 +
  user@host ~/mineserver-git % sudo pacman -U mineserver-git-*.pkg.tar.xz
 +
 +
And you're done. You can run the server with <code>mineserver /usr/share/mineserver/config.cfg</code>
 +
 +
''Note: if you want to change the default configuration, you will have to copy them into another directory.''
 +
 +
This is an example on how you copy all the configuration files to the ~/minecraft-server directory which you then can change to your preferences.
 +
 +
  user@host ~ % mkdir minecraft-server && cd minecraft-server
 +
  user@host ~ % cp /usr/share/minecraft/* .
 +
  user@host ~ % ls
 +
  admin.txt  banned.txt  config.cfg  item_alias.cfg  motd.txt  rules.txt  whitelist.txt
 +
 +
You can then run the server by issuing <code>mineserver</code>, without specifying the configuration file location, since mineserver will look for it in the current directory.
 +
====OS X====
====OS X====
−
Firstly, until batterseapowers patches are merged, you need to change these lines in src/Makefile:
+
===== Macports =====
−
LDFLAGS = -L/usr/local/lib -L/usr/lib -levent -lz -lnoise $(LFLAGS)
+
You can build, ensuring that you point the compiler to any Macports-installed headers and libraries:
−
 CXXFLAGS = $(DFLAGS) -I. -I/usr/Local/include -I/usr/include
 
−
To these:
+
  cd src
 +
  CXXFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib make
−
 LDFLAGS += -L/usr/local/lib -L/usr/lib -levent -lz -lnoise $(LFLAGS)
+
===== Fink =====
−
 CXXFLAGS += $(DFLAGS) -I. -I/usr/Local/include -I/usr/include
 
−
This just allows us to supply some extra LDFLAGS and CXXFLAGS on the command line. Now you can build, ensuring that you point the compiler to any Macports-installed headers and libraries:
+
You can build, ensuring that you point the compiler to any Fink-installed headers and libraries:
−
 cd src
+
  cd src
−
 CXXFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib make
+
  CXXFLAGS=-I/sw/include LDFLAGS=-L/sw/lib make
 +
 +
===== Homebrew =====
 +
 +
Homebrew installs in a System-Known location, so you just have to make.
 +
  cd src
 +
  make
 +
===Editing the Config===
===Editing the Config===
This part is nice and easy. Grab the default config files from the <code>bin</code> directory in the distribution and view the [[configuration]] article to get accustomed with the options available.
This part is nice and easy. Grab the default config files from the <code>bin</code> directory in the distribution and view the [[configuration]] article to get accustomed with the options available.
 +
 +
==Directory Structure==
 +
 +
{| class="wikitable" style="font-size:90%"
 +
|-
 +
!
 +
! Unix install
 +
! Unix distribution
 +
! Windows
 +
|-
 +
! Install Prefix
 +
| <code>$HOME</code> or <code>~</code>
 +
| <code>/usr</code>
 +
| <code>C:\Program Files\mineserver</code>
 +
|-
 +
! Configuration<sup>1</sup>
 +
| <code>$HOME/.mineserver</code>
 +
| <code>/etc/mineserver</code>
 +
| <code>%AppData%\.mineserver</code>
 +
|-
 +
! Working Directory<sup>2</sup>
 +
| <code>$HOME/.mineserver</code>
 +
| <code>/var/lib/mineserver</code>
 +
| <code>%AppData%\.mineserver</code>
 +
|-
 +
! Binaries
 +
| colspan="2" | <code>$PREFIX/bin</code>
 +
| <code>%PREFIX%\bin</code>
 +
|-
 +
! Plugins
 +
| colspan="2" | <code>$PREFIX/lib/mineserver</code>
 +
| <code>%PREFIX%\bin</code>
 +
|-
 +
! Resources
 +
| colspan="2" | <code>$PREFIX/share/mineserver</code>
 +
| <code>%PREFIX%\share</code>
 +
|-
 +
|}
 +
* <sup>1</sup> Specified through the [[Command Line]] arguments
 +
* <sup>2</sup> Specified in [[Configuration]] file