Disclaimer: This is a user contributed How-To, xhost.ch GmbH assumes no warranty whatsoever for any outcome as a result of following this guide.

Multicraft: How to Set This Thing Up For Just 1 Server

by Hylianux

this guide assumes a few things...

1. that you're using ubuntu server 11.04 (i seriously doubt anything will be different if you're using another ubuntu server version... but ya never know)
2. you do NOT have a webserver, and know absolutely nothing about webservers.
3. you don't have a minecraft server yet
4. your knowledge of linux is very limited.
5. your server has access to the internet

alrighty. i'll imagine that you're probably staring at a command line right now, completely lost.

fear not... this is easy. you'll need only to copy and paste some commands. come on, ANYBODY knows how to do that :D

There are lots of things that you're about to be bombarded with... just be patient and keep reading.

first thing's first... opening 2 ports on your router and making sure they redirect to this computer. you can get there by typing 192.168.1.1 into your web browser(if the .1.1 doesn't work, try .0.1, .1.0, or .0.0 as well... some routers are different as to which ip address they listen for requests on). this will bring you to your administration console. usually the username is admin, and the password is also admin. check online for your router make and model to be sure.

in the administration console, there should be an option to click called "port forwarding". once there, add 2 ports: 80, and 25565. these are the default ports for the webserver and for minecraft. you DO have the option to change what ports you want to use, but if you'd rather not type the damn port number in addition to the url into the web nor on minecraft, this is just much easier.

alright, port forwarding complete.

now, you'll need a lamp server. lamp stands for linux, apache, mysql, php/perl. it's a nice hodge-podge of good stuff thrown together if you ever wanted to be a really good web developer. for now, we're just going to use it for the multicraft console.

first:
sudo apt-get update

it's just a good idea. this will rule out every possibility of not finding these packages you're about to download.

next:
sudo apt-get install lamp-server^

that's not a typo... it DOES need that caret(^) at the end

it'll prompt you to change password for your MySQL database. type in a password, and keep going.

done.

time to test it. open a browser, and type in http://ipAddressOfLinuxServer/

you should get a page that says "IT WORKS!"

from here, i'd recommend getting a domain, but you're still more than welcome to use your ip address. remember, this ip address can change (unless you've paid your isp to make it static) so remembering it can also be a hassle. it's a lot easier to remember jimjimmers.com, for example, than 199.5.86.1... especially since jimjimmers.com will always be there while the ip address can change. if the address does change, you just point jimjimmers.com to the new ip. your users are none the wiser.

you can get free domains from www.no-ip.com, www.dyndns.com (recommended), and www.godaddy.com. if you want to BUY a domain, it's entirely up to you; I have no preference.

in all cases, you will be editing what is known as a zone file (otherwise known as a host file). this is a file you'll find through the dns site's manager. the top records should be named something like "A Hosts". there's already an entry there for "@". enter your ip address for "@" so that "@" points to your ip.

now typing jimjimmers.com will bring you to your website (you'll have to wait about an hour after editing the file for changes to take effect.)



installing and getting multicraft to work:

first and foremost, run these commands:

sudo apt-get install sqlite
sudo apt-get install php5-sqlite
sudo a2enmod rewrite
sudo /etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart

and if you haven't already:

sudo bash

next, download multicraft:

Download Multicraft:

64 bit:
# wget http://www.multicraft.org/download?arch=linux64 -O multicraft.tar.gz

(32 bit: # wget http://www.multicraft.org/download?arch=linux32 -O multicraft.tar.gz)

Extract the Multicraft archive:
# tar xvzf multicraft.tar.gz

Change into the extracted directory:

# cd multicraft

Run the setup.sh script:

# ./setup.sh

once setup is run, i just pressed enter for everything through the end. (except for the creation of the user "minecraft", but for everything else, enter spam).



after that setup script has completely finished running, go to /etc/apache2/sites-available
you'll need to copy the default site file to another one for minecraft, so:
cp default minecraft
now edit the minecraft file. i personally use vim, but you can use nano or emacs or whatever other editor of your choosing.
make sure your file looks like this:
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName your.domain.com
    ServerAlias your.domain.com
    DocumentRoot /var/www/multicraft
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/multicraft/>
        Options Indexes FollowSymLinks MultiViews +Includes
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
     ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>
save the file, and you're done.

now go to http://your.domain.com/ and run through the installation process. follow all prompted directions.
and finally, start the daemon with /bin/multicraft -v start
the only other error i got was that there weren't proper permissions set, which meant i had to go to the db file and type
chmod 755 data.db


these instructions were tested and working on a fresh install of ubuntu server 11.10 32-bit.


this script might be useful to anyone confused about updating. Make sure to run this as root:
#!/bin/bash
echo "making temporary installation directory"
mkdir multi_installer
cd multi_installer
echo "downloading latest version"
wget http://www.multicraft.org/download -O multicraft.tar.gz
tar xvzf multicraft.tar.gz
cd multicraft
echo "running setup"
./setup.sh
cd ..
cd ..
echo "cleaning up"
rm -r multi_installer