I've acquired a hostgator vps level 1 account to use with node.js development. But when it comes to servers I'm a bit of a noob so I was wondering if the more experienced developer could give me suggestion of to setup my new account to work best with node.js. What would you recommend me to install. Apache? Python? Php? and so on?
Would you recommend me to use Haraka as an email server?
I'm planning to use this server for websites and services with node.js as the backend.
Any suggestions would be appreciated and could possible be good for other getting the same type of account. =)
PHP and Python have no relation to Node.js/Javascript. Remember that, unlike PHP apps which rely on a third party web server (i.e. Apache/Nginx/IIS), Node.js apps act as their own web server. If you don't need Apache, don't install it. It takes up resources and will most likely be listening on port 80 (preventing your node app from doing so).
Node requires only a very minimal environment. You should install Node.js, and probably a C++ compiler. Other than that, it simply depends on what you need for your particular app.
There are lots of resources for how to get started with node. For example: https://stackoverflow.com/a/5511507/2210128
Related
I want to purchase shared hosting with node js support. Can you provide us company name which support nodejs on shared server.
Thanks in advance.
You have many options out there. It depends on what you want to do but I would go for:
Heroku: It has a free option and it's compatible with integration testing tools like Travis. You can easily configure databases and also create environment variables easily
Glitch: It's also for free and you can just start programming because the server is already configured. I usually use this service when I want to try some small projects on node.js and I need a server to share what I'm doing.
I'm just starting to learn more about the Node.js paradigm and finding it hard to grasp basic concepts. I'm familiar with front-end tools (HTML, CSS, JS) and have been using PHP with Apache server and mySQL db to deploy websites until now.
It seems to be that node is it's own server, and I would then need a SaaS platform like Heroku, or AWS (I'm not even sure if i'm understanding the purpose of these) if someone could explain the difference?
Is the database managed inside this service?
Is the website being hosted there?
In steps how would you get the node app to be served onto your domain name?
For Scalability purposes I understand how having dedicated big infrastructure can help, but if building a low traffic website with small number of members is there even a point in using node?
normal hosting services cost between $4-20 usd. per month and AWS or Heroku seem to start at a MUCH higher price. Is Node only to be used for large scale scaling business model?
Thank you for any answers or good recent external resources (websites or books) you could point me to.
You could easily host a low traffic website built with node.js absolutely for free on Heroku.
To see how easy that is, just go through the Getting Started With Node.js Heroku tutorial, in which you will do just that.
When you build your website with node.js, your own code that your write is the web server. You have no separate web server to configure and interact with (such as Apache). So what you see (or code...) is exactly what you get.
You will probably want to use a framework such as Express to build your web server functionality in your node.js app.
As for NoSQL databases, the way to do this on Heroku is to use an appropriate "add-on" from the Heroku Elements Marketplace. For example, you could easily add Heroku Redis or MongoLab. These are just some of the NoSQL "Database as a Service" options. That means that the Database is itself hosted somewhere in the cloud, and your app simply interacts with it. You don't need to worry about database maintenance, security upgrades etc. You just need to concentrate on your app's interaction with the DB.
Almost all add-ons in the Heroku Elements Marketplace feature a free-tier, that may suffice for your needs, at least initially. So you might be able to get your low-traffic website (including the DB) up and running completely for free, at least initially.
One thing you will need to understand is how Heroku free dyno hours work.
If you need your website to be continuously available 24/7, you may need to verify your Heroku account with a credit card (even though no charges would be incurred as long as you deploy only 1 free web dyno and are on a free-tier plan of your NoSQL DB as a Service). For further details, see this answer.
You also need to consider whether you can tolerate dyno sleeping in your low-traffic app. If not, you would need to prevent your web app from sleeping, which can also be done completely for free. For tips on how to do that see here.
As for serving your Heroku node.js app website from your own domain name, see here. Note that for this too you will need to verify your Heroku account with a credit card, although this too does not incur any charges.
Node.js is supported by many web hosting already, especially for those who use Plesk or cPanel as their web hosting control panel. Here is guide about how to setup a Node.js website via Plesk control, https://www.bisend.com/blog/how-to-set-up-a-node-js-site-in-plesk. As you said, it's very easy to host your website with a cheap shared web hosting.
Here's a noob question. I made a small app in node.js and to see it I have to go to localhost:4000 in my web browser. How can I publish it in an actual website that everybody can see? I already have a domain name and a hosting service.
Thanks in advance
Your hosting service may not actually support Node. If it doesn't let you install and run your own software then you may be out of luck.
Generally you have few options:
You can host it yourself on your own machine but it will not be as easy and efficient as using a service for hosting, unless you have a high quality symmetric internet connection with low latency and high bandwidth.
You can host it cheaply on a VPS using Digital Ocean, Vultr or AWS in which case you will have to configure Node yourself and install all of the databases and other software that you need.
Or you can use managed platforms like Heroku for Node (and Compose for databse like Mongo that you will probably also need) in which case the price will be higher but everything will be taken care of for you.
It depends on what costs are you willing to take, both in terms of service fees and your time and expertise needed to configure and maintain different layers of the system.
IMO the simplest way to deploy a Node app is with Heroku. You can find the documentation here.
It's free, and basically just requires that you create an app and then push your code to Heroku. It takes care of the rest for you!
I have build an chat application using nodejs with mysql database. I have developed on my windows system and it works fine.
Now I want to make it live on a server to check its real time performance, As a beginner I don't know which server hosting should I choose to develop nodejs application, so someone please suggest me a hosting for nodejs application?
If you want something relatively easy to test on, Heroku will provide you with a free instance.
I can also recommend Azure over Amazon for a simple nodejs based app. The main reason is that Azure has a very simplified interface for deploying node apps after a little bit of minor setup. Amazon offers similar capabilities, but the last time I looked at them they aren't quite as simple to get up and running. Again, they're competitive in cost and reliability, this is just a subjective opinion on what I think will be easier for a dev to get up and running without prior experience.
I use Dokku, an open source solution for a Heroku like PaaS. Either of those are great for doing git style deployments. Heroku has better documentation, and doesn't require your own server so I would start with them.
https://www.heroku.com
http://dokku.viewdocs.io/dokku
I made a small website on nodejs, without using any framework, just including simple modules, only for the needs of the site.
And now, when the time for deploy has come - all the hosting variants I can find require express.
Do you know any that doesn't?
EDIT: I forgot to mention that it uses mysql, so I'll need mysql, and also uses imagemagick. But of course, I can check these two on the specific hosting providers ... just have to overcome the first obstacle - the requirement of express.
Try http://nodejitsu.com, It has more features than Heroku or other nodejs hosting sites.
You can go for a paid VPS (Virtual Private Server)
and Setup the environment as you want.
There are plenty of those out there like digitalocean, Amazon AWS,etc.
Did you try heroku ?
Or you can buy a server by Amazon AWS or Rackspace.
Depends on how much work you want to do and the price. if you don't mind setting up a VPS there's linode.com. If you want simple (PaaS) there's nodejitsu.com, nodester.com or nodesocket.com.