##This is a guide to install HabitRPG on an Uberspace.
###Installation
First you have to create a folder which is accessable from the web (e.g. habitrpg.yourdomain.com) and then move to it. In this folder execute
git clone https://github.com/HabitRPG/habitrpg.git .
After that, you have to download some dependencies with:
npm install grunt-cli bower phantomjs
npm install
Now you have all necessary files on your server.
###Configuration
To configure HabitRPG for uberspace you have to copy the config.json.example
to config.json
with
cp config.json.example config.json
Now look for a free port between 61000 and 65536. (Node apps need a specific port, where they can listen). To check which ports are used you can issue this command:
netstat -tulpen | column -t | grep ':6[1-5][0-9]\{3\}'
Of course we need to redirect the traffic from your domain to the port your app will be running on. So create a file called .htaccess
and put the following in it (remember to correct the port to the one, you've chosen):
RewriteEngine On
RewriteRule ^(.*) http://localhost:<YOUR_PORT>/$1 [P]
We also need a database. HabitRPG uses mongodb, so we have to set up a mongodb instance. On an Uberspace that's a no-brainer. ;) Just hit
uberspace-setup-mongodb
Keep the data wherever you want, but keep it. (You can check the mongo instance with mongo admin --port <YOUR_MONGO_PORT> -u '<YOUR_MONGO_USERNAME>' -p '<YOUR_MONGO_PASSWORD>'
[replace the <YOUR_MONGO_*>
-tags with the output from uberspace-setup-mongodb
]. Ctrl-C to exit.)
Ok, lets open the config.json file and edit following lines:
- The PORT to the port you've chosen
- The NODE_DB_URI to
"mongodb://<YOUR_MONGO_USERNAME>:<YOUR_MONGO_PASSWORD>@localhost:<YOUR_MONGO_PORT>/db?authSource=admin"
(replace the<YOUR_MONGO_*>
-tags with the data fromuberspace-setup-mongodb
. - The SESSION_SECRET to a random key with 50 characters (alphanumeric)
If you want, you can change the remaining configurations later, but for now it's enough to get HabitRPG running.
###Bring it to life
npm install
(Nothing more to say)
######Have fun!
Yeah, unfortunately this doesn't work for me either.