{"id":5252,"date":"2014-11-01T15:42:43","date_gmt":"2014-11-01T20:42:43","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=5252"},"modified":"2022-06-03T03:46:35","modified_gmt":"2022-06-03T08:46:35","slug":"install-keystonejs-on-an-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-keystonejs-on-an-ubuntu-14-04\/","title":{"rendered":"Install KeystoneJS on an Ubuntu 14.04"},"content":{"rendered":"
In this blog post we will show you how to install KeystoneJS on an Ubuntu 14.04 VPS with the latest version of Nginx as a reverse proxy. KeystoneJS is a Node.js content management system and web application platform built on MongoDB and Express. This guide should work on other Linux VPS<\/a> systems as well but was tested and written for Ubuntu 14.04 VPS<\/a>.<\/p>\n <\/p>\n We will install the latest nodejs package from Chris Lea’s repo.<\/p>\n We will install the latest mongo package from the official MongoDB repository.<\/p>\n We will install KeystoneJS using the KeystoneJS generator made with Yeoman.<\/p>\n The generator will ask you a few questions, install all npm dependencies and configure and copy all the files into the newly created project.<\/p>\n When the installation is finished, run the following to start the KeystoneJS:<\/p>\n If you see the below message, it means you’ve successfully installed KeystoneJS.<\/p>\n Stop the process with In case you never heard of Forever, it is a tool which ensures that a given script runs forever.<\/p>\n Now you can use forever to start your KeystoneJS instance.<\/p>\n The latest version of Nginx 1.6.2 is not available via the default Ubuntu repositories, so we will add the “nginx\/stable” PPA, update the system and install the nginx package.<\/p>\n Create a new Nginx server block with the following content<\/p>\n Test the Nginx configuration and restart the server<\/p>\n That’s it. Now open your browser and type the address of your website ex: For more information about how manage your KeystoneJS application ,please refer to the official KeystoneJS website.<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.<\/p>\n PS<\/span><\/strong>. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this blog post we will show you how to install KeystoneJS on an Ubuntu 14.04 VPS with the latest … <\/p>\nLogin to your VPS via SSH<\/h4>\n
ssh user@myVPS<\/pre>\n
Update the system and install necessary packages.<\/h4>\n
user@myVPS:~# sudo apt-get update && sudo apt-get -y upgrade\r\nuser@myVPS:~# sudo apt-get install python-software-properties<\/pre>\n
Install Node.js<\/h4>\n
user@myVPS:~# sudo add-apt-repository ppa:chris-lea\/node.js\r\nuser@myVPS:~# sudo apt-get update\r\nuser@myVPS:~# sudo apt-get install nodejs<\/pre>\n
Install MongoDB<\/h4>\n
user@myVPS:~# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10\r\nuser@myVPS:~# echo 'deb http:\/\/downloads-distro.mongodb.org\/repo\/ubuntu-upstart dist 10gen' | sudo tee \/etc\/apt\/sources.list.d\/mongodb.list\r\nuser@myVPS:~# sudo apt-get update\r\nuser@myVPS:~# sudo apt-get install -y mongodb-org<\/pre>\n
Install KeystoneJS<\/h4>\n
user@myVPS:~# sudo npm install -g generator-keystone\r\nuser@myVPS:~# mkdir ~\/myKeystoneApp\r\nuser@myVPS:~# cd ~\/myKeystoneApp\r\nuser@myVPS:~# yo keystone\r\n<\/pre>\n
user@myVPS:~# node keystone<\/pre>\n
------------------------------------------------\r\nKeystoneJS Started:\r\nMy Site is ready on default port 3000\r\n------------------------------------------------<\/pre>\n
Control-C<\/code> and continue with the Forever installation.<\/p>\n
user@myVPS:~# sudo npm install forever -g<\/pre>\n
user@myVPS:~# cd ~\/myKeystoneApp\r\nuser@myVPS:~# forever start keystone.js<\/pre>\n
Install and Configure Nginx<\/h4>\n
user@myVPS:~# sudo add-apt-repository ppa:nginx\/stable\r\nuser@myVPS:~# sudo apt-get update\r\nuser@myVPS:~# sudo apt-get install nginx<\/pre>\n
user@myVPS:~# sudo nano \/etc\/nginx\/conf.d\/myKeystoneApp.com<\/pre>\n
server {\r\n server_name myKeystoneApp.com;\r\n listen 80;\r\n\r\n access_log \/var\/log\/nginx\/myKeystoneApp-access.log;\r\n error_log \/var\/log\/nginx\/myKeystoneApp-error.log;\r\n\r\n location \/ {\r\n proxy_set_header X-Real-IP $remote_addr;\r\n proxy_set_header Host $http_host;\r\n proxy_pass http:\/\/127.0.0.1:3000;\r\n }\r\n \r\n}\r\n<\/pre>\n
user@myVPS:~# sudo nginx -t\r\nuser@myVPS:~# sudo \/etc\/init.d\/nginx restart<\/pre>\n
http:\/\/myKeystoneApp.com<\/code>.<\/p>\n
\n