linux系统(centos7)安装node_html


使用  wget 复制的地址链接(下载完之后是gz格式)

解压  tar -zxvf  压缩包名

cd  node-v0.10.29

./configure

make

make install

linux系统(centos7)安装node_html_02

查看有没有安装成功(两个都有证明安装成功)



[root@localhost ~]# cd /var/www/html/

[root@localhost html]# vim dome.js


var http = require('http');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/plain'});
res.end('Hello World\n');
}).listen(1337,'192.168.100.50');
console.log('Server running at http://192.168.100.50:1337/');




[root@localhost html]# firewall-cmd --zone=public --add-port=1337/tcp --permanent  防火墙可以访问1337端口
success
[root@localhost html]# systemctl restart firewalld.service 重启防火墙
[root@localhost html]# node dome.js
Server running at http://192.168.100.50:1337/