{"id":3364,"date":"2014-03-22T15:57:57","date_gmt":"2014-03-22T20:57:57","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=3364"},"modified":"2022-12-16T05:33:58","modified_gmt":"2022-12-16T11:33:58","slug":"install-the-sails-js-framework-on-an-ubuntu-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-the-sails-js-framework-on-an-ubuntu-vps\/","title":{"rendered":"Install the Sails.js framework on an Ubuntu VPS"},"content":{"rendered":"
Sails.js is a real-time MVC Framework for Node.js, which makes it easy to build custom, enterprise-grade Node.js apps. Sails.js is database agnostic, automatically generates a RESTful JSON API for your app, provides basic security and role-based access control by default, has automatic asset minification and many more.<\/p>\n
In this blog post we will show you how to install the Sails.js framework on a Ubuntu VPS<\/a> with Nginx as a reverse proxy.<\/p>\n <\/p>\n The following command will install all necessary packages<\/p>\n Install the the latest version of Nginx<\/strong><\/p>\n Install the latest version of Nodejs <\/strong> Install the latest stable release of Sails <\/strong> Create a new Sails project<\/strong><\/p>\n To start the server, run:<\/p>\n By default the server is listening on 127.0.0.1:1337<\/p>\n Create a new nginx virtual host<\/strong><\/p>\n That’s it. Now open your browser and navigate to your domain.<\/p>\n For more info about the Sails.js framework please go to: http:\/\/sailsjs.org\/#!documentation<\/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 install this for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS<\/strong><\/span>. 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 <\/p>\n","protected":false},"excerpt":{"rendered":" Sails.js is a real-time MVC Framework for Node.js, which makes it easy to build custom, enterprise-grade Node.js apps. Sails.js is … <\/p>\nsudo apt-get update\r\nsudo apt-get install -y python-software-properties python g++ make<\/pre>\n
sudo add-apt-repository ppa:nginx\/stable\r\nsudo apt-get update && sudo apt-get install nginx<\/pre>\n
\n<\/strong><\/p>\nsudo add-apt-repository ppa:chris-lea\/node.js\r\nsudo apt-get update && sudo apt-get install nodejs<\/pre>\n
\n<\/strong><\/p>\nsudo npm -g install sails<\/pre>\n
cd && sails new projectName<\/pre>\n
cd projectName && sails lift &<\/pre>\n
vim \/etc\/nginx\/sites-available\/your_domain.com<\/pre>\n
server {\r\n listen 80;\r\n server_name your_domain.com;\r\n location \/ {\r\n proxy_pass http:\/\/localhost:1337\/;\r\n proxy_set_header Host $host;\r\n proxy_buffering off;\r\n }\r\n }<\/pre>\n
\r\nln -s \/etc\/nginx\/sites-available\/your_domain.com \/etc\/nginx\/sites-enabled\/your_domain.com\r\n\/etc\/init.d\/nginx restart<\/pre>\n