-
Notifications
You must be signed in to change notification settings - Fork 5
Creating the OpenSprites Server
James edited this page Aug 9, 2016
·
9 revisions
- Create a new 64bit Ubuntu Server LTS installation. This guide assumes the server is remote and SSH has already been installed.
- Log in via SSH into the root account.
- Update packages using
apt-get updateandapt-get upgrade. - Change the hostname with
hostname openspritesand edit/etc/hostname, and then reboot. - Create a new non-root user to work with:
useradd osuser,mkdir /home/osuser,mkdir /home/osuser/.ssh,chmod 700 /home/osuser/.ssh. - Create a strong password for the non-root user with
passwd osuser. - Open the sudoers file by running
visudo. Add the lineosuser ALL=(ALL) ALL. - On your local machine, use
ssh-keygen -t rsato generate a new RSA key for authentication. - You will now need to copy id_rsa.pub to the server with
ssh-copy-id osuser@<host>. - Open the SSH server configuration file with
nano /etc/ssh/sshd_configand use CTRL-W to findPermitRootLoginandPasswordAuthentication. Set the values for both tono. To save, press CTRL-X and then type y followed by enter to confirm. - Restart the SSH server for the changes to come into effect using
service ssh restart. - Allow the following ports through the firewall with
ufw allow 22,ufw allow 80,ufw allow 443, and finally,ufw enable. - Close the root SSH session and continue using the non-root account.
##Installing OpenSprites-Next
- Install build essential and the GNU C++ compiler using
sudo apt-get install build-essential g++. - Make sure you are in
/home/osuserbefore downloading node.js 6.2.2 withwget https://nodejs.org/download/release/v6.2.2/node-v6.2.2.tar.gz. - Extract the archive with
tar -xvf node-v6.2.2.tar.gzand then delete it to save space by runningrm node-v6.2.2.tar.gz. - Using
cd, enter the new directory. - Run
./configure, followed bymakeand finallysudo make install. This may take a while. - Install the libcap2-bin if you have not already with
sudo apt-get install libcap2-bin. - Allow node.js to run on port 80 with
sudo setcap cap_net_bind_service=+ep /usr/local/bin/node. - Install MongoDB from the Ubuntu repository by executing
sudo apt-get install mongodb. MongoDB should now start with Ubuntu automatically. - Run
mongoto open the shell. Create the OpenSprites-next database withuse next. MongoDB creates databases on the fly, so create a temporary collection to retain it by executingdb.createCollection('temp'). - Create the database user with
db.createUser( {user: 'databaseuser', pwd: 'databasepassword' } ). Remember the username and password for later. Exit the shell with CTRL-C. - Download the OpenSprites Next with
git clone https://github.com/OpenSprites/OpenSprites-next.git opensprites-next, before entering the directory withcd opensprites-next. - Install node-gyp by executing
npm install -g node-gyp. - Install node-canvas with
sudo apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev, followed bynpm install canvas. - Check Python 2.7 is installed by running
sudo apt-get install python2.7. - Install Sound eXchange using
sudo apt-get install sox. - Create a new file in with
nano .envand copy in the config file. - Replace the database username an password with the MongoDB credentials made earlier. Change the hostname to the IP address or domain where the website is being hosted.
- Run
npm install, followed bynpm run build, and finallynpm startto run the server.
##Errors If you get errors during install, try running the following commands.
npm rebuild lwip
npm rebuild bcrypt
npm rebuild canvas