badzy.blogg.se

Nodejs centos install
Nodejs centos install





nodejs centos install nodejs centos install

express_example]# forever restart 1 express_example]# forever restartall express_example]# forever stop 1 express_example]# forever stopall Use -w option to restart app automatically after changes. express_example]# forever start app.js Listing express_example]# forever list info: Forever processes running data: uid command script forever pid logfile uptime data: NcMN /usr/bin/node test.js 2110 2112 /root/.forever/NcMN.log 0:0:1:29.91 data: xYL8 /usr/bin/node app.js 2134 2136 /root/.forever/xYL8.log 0:0:0:4.775 Restarting and stopping using their ID. sample]# forever start test.js Starting sample express example app. express_example]# npm install forever -g Starting test app created earlier ( Step 4 ). Additionally install forever tool to run the code in the background. express_example]# node app.js Express server listening on port 3000 Step 10 » Open on your browser. sample]# cd express_example/ express_example]# npm install Step 9 » launching the site. sample]# yum install git sample]# git clone Step 8 » Now install site modules using npm command. Step 7 » Now We can check some complete example site. Disable firewall ( Iptables ) » ~]# service iptables stop ~]# chkconfig iptables off

nodejs centos install

if you are not getting the page, Disable Iptables service on your server. sample]# node test.js Server running at port 2000 Step 6 » Now your test application is running on port 2000. Step 5 » Now run the code using node command. ~]# mkdir sample ~]# cd sample sample]# vim test.js Add the below code to that file.( About the code )Ĭonsole. Create a directory (optional 🙂 ) and a file. Step 4 » Let’s try a “hello world” web application.

nodejs centos install

~]# node > console.log("Hello world") Hello world undefined Great!! your installation is perfect. Now check your installation with a simple “hello world” example in the command prompt. ~]# yum install npm -enablerepo=epel Step 3 » That’s it, installation is over. ~]# rpm -ivh Step 2 » Now start installing node.js and dependencies. Find the latest release file from EPEL 6 repository and install using rpm command. Step 1 » You need to enable EPEL repository which contains node.js packages and dependencies. Let’s start, Installing node.js on centos 6 is very simple. In this article, we can see about installing node.js on centos 6 and running a sample application. it uses an event-driven function which is very useful for hosting real-time applications. Node.js is a platform that works on V8 JavaScript Engine.







Nodejs centos install