nodejs 环境安装
参考网站
http://www.runoob.com/nodejs/nodejs-http-server.html https://github.com/nodesource/distributions #安装
curl -sL https://rpm.nodesource.com/setup_6.x | bash -
yum install -y nodejs
#查看版本
node --version #查看安装路径
rpm -qa 'node|npm'
rpm -ql nodejs-6.11.2-1nodesource.el6.x86_64
npm -v #编辑服务文件
vim server.js
[root@bj default]# cat server.js
var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n');
}).listen(8080); console.log('Server running at http://0.0.0.0:8080/'); #运行
node server.js #访问
http://0.0.0.0:8080/
yum -y install -y zlib* zlib-devl* openssl openssl-devel pcre*
wget http://nginx.org/download/nginx-1.10.3.tar.gz
tar -xf nginx-1.10.3.tar.gz;cd nginx-1.10.3
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-cc-opt=-O3 --with-stream
echo $?
make
echo $?
make install
echo $?
useradd nginx -s /sbin/nologin -M
user nginx nginx;
worker_processes 4;
error_log logs/error.log crit;
pid logs/nginx.pid;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 51200;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 256;
client_header_buffer_size 64k;
large_client_header_buffers 4 64k;
client_max_body_size 80m;
sendfile on;
tcp_nopush on;
keepalive_timeout 120;
send_timeout 360;
proxy_ignore_client_abort on;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_buffer_size 512k;
proxy_buffers 16 512k;
charset utf-8;
gzip on;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_static on;
gzip_min_length 1k;
gzip_buffers 4 32k;
gzip_http_version 1.0;
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";
gzip_comp_level 6;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
ssi on;
ssi_silent_errors off;
ssi_types text/shtml;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
log_format main '$time_iso8601 $remote_addr $query_string';
log_format normal '$remote_addr - $remote_user $time_iso8601 "$request_method $scheme://$host$request_uri $server_protocol" '
'$status $bytes_sent $request_length "$http_referer" "$http_user_agent" '
'"$http_x_forwarded_for" $request_time $upstream_response_time';
log_format logstash_json '{ "log_time": "$time_local", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"status": "$status", '
'"request": "$request", '
'"request_method": "$request_method", '
'"http_referrer": "$http_referer", '
'"body_bytes_sent":"$body_bytes_sent", '
'"http_x_forwarded_for": "$http_x_forwarded_for", '
'"http_user_agent": "$http_user_agent" } ';
include vhost/*.conf;
access_log logs/access.log normal;
}
nodejs 环境安装的更多相关文章
- CentOS7配置Nodejs环境安装记录
今天购买了阿里云服务器,系统选的是CentOS7,下面记录下在它上面安装Nodejs环境的过程,本次操作是直接连接的阿里云服务器的管理终端. 1.由于是纯净的环境,先通过以下命令安装nodejs编译及 ...
- nodejs环境安装
centos7安装nodejs环境 原文地址: https://www.cnblogs.com/MY0101/p/6625344.html 下载地址: https://nodejs.org/dist/ ...
- ubuntu下用nvm配置好nodejs环境
cd ~mkdir .gitcd .gitgit clone https://github.com/creationix/nvm.git 这样先把nvm下载过来,然后安装 ./install.sh c ...
- Meteor环境安装配置
在本教程中,我们将展示如何在windows操作系统安装Meteor .在我们开始学习使用Meteor 之前,我们将需要NodeJS.如果你还没有安装它,则可以点击下表中的链接. 必须条件 Meteor ...
- Linux环境下NodeJS的安装配置(HelloWorld)
Linux环境下NodeJS的安装配置(HelloWorld) 最简单的环境安装,测试helloworld.给初学者!! 安装脚本,请仔细阅读逐行执行: #!/bin/bash #检查是否已经安装 r ...
- Mac安装搭建sublimeText3开发Nodejs环境
原文] [基本环境 安装Nodejs 这个直接就可以去官网下载就可以了.Nodejs官网 根据自己的PC系统类型选择对应的版本下载之后就可以了. 安装SublimeText3 这个也是直接去Subli ...
- webstorm+nodejs环境中安装淘宝镜像
用过nodejs的人都知道,从node的官方模板库下载依赖包的时候,经常会遇到“假死”(页面静止不动)的状态,这种速度简直要逼死焦急地等待下班的人.还好咱们万能的淘宝提供了淘宝镜像这么一个不要更好用的 ...
- nodejs windows环境安装
相信对于很多关注javascript发展的同学来说,nodejs已经不是一个陌生的词眼.有关nodejs的相关资料网上已经铺天盖地.由于它的高并发特性,造就了其特殊的应用地位. 国内目前关注最高,维护 ...
- 【原】nodejs全局安装和本地安装的区别
来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...
随机推荐
- centos6.5环境安装zookeeper-3.4.5
1.将zookeeper-3.4.5.tar.gz压缩包拷贝到/usr/local/src, 并用如下命令解压 tar -xzf zookeeper-3.4.5.tar.gz 2.在zookeepe ...
- java知识点4
架构篇 分布式 数据一致性.服务治理.服务降级 分布式事务 2PC.3PC.CAP.BASE. 可靠消息最终一致性.最大努力通知.TCC Dubbo 服务注册.服务发现,服务治理 分布式数据库 怎样打 ...
- Kivy折腾笔记
最近想用Python开发APP,选择kivy,记录过程 首先是源码安装,各种蛋疼的报错放弃了.cython高版本有问题. python3 -m pip install cython==0.23 pyt ...
- 原生js的开发笔记
1.基本的dom操作 var a=document.getElementById('ma1').innerHTML;/获取html代码 alert(document.getElementById('m ...
- mysql进制之间的转换
1.十进制转换成二进制 select bin(5); 2.十进制转换成八进制 select oct(5); 3.十进制转换成十六进制 select hex(5); 4.二进制转换成十进制 select ...
- Linux目录结构以及文件操作
Linux目录结构 UNIX 是以目录为主的,Linux 也继承了这一优良特性. Linux 是以树形目录结构的形式来构建整个系统的,可以理解为树形目录是一个用户可操作系统的骨架.虽然本质上无论是目录 ...
- mysql导入sqlserver数据库表
原文:https://zhidao.baidu.com/question/1114325744502691499.html 在Navicat for MySQL 管理器中,创建目标数据库(注意:因为是 ...
- 022_applescript快速入门教程
基础语法 一.这部分介绍注释,发出声音,弹窗 (1)简单入门 <1>多行注释 (* this is multi comment *) <2>发出响声 beep 3 (2) #表 ...
- Ubuntu18系统qt生成程序无法双击运行问题
1.Ubuntu18 安装qt编译生成的程序文件类型为application/x-sharedlib,无法双击直接运行.文件类型应该为x-executable. 2.解决方法 在.pro文件中添加下面 ...
- ansible笔记(8):常用模块之系统类模块(二)
ansible笔记():常用模块之系统类模块(二) user模块 user模块可以帮助我们管理远程主机上的用户,比如创建用户.修改用户.删除用户.为用户创建密钥对等操作. 此处我们介绍一些user模块 ...