参考网站
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 环境安装的更多相关文章

  1. CentOS7配置Nodejs环境安装记录

    今天购买了阿里云服务器,系统选的是CentOS7,下面记录下在它上面安装Nodejs环境的过程,本次操作是直接连接的阿里云服务器的管理终端. 1.由于是纯净的环境,先通过以下命令安装nodejs编译及 ...

  2. nodejs环境安装

    centos7安装nodejs环境 原文地址: https://www.cnblogs.com/MY0101/p/6625344.html 下载地址: https://nodejs.org/dist/ ...

  3. ubuntu下用nvm配置好nodejs环境

    cd ~mkdir .gitcd .gitgit clone https://github.com/creationix/nvm.git 这样先把nvm下载过来,然后安装 ./install.sh c ...

  4. Meteor环境安装配置

    在本教程中,我们将展示如何在windows操作系统安装Meteor .在我们开始学习使用Meteor 之前,我们将需要NodeJS.如果你还没有安装它,则可以点击下表中的链接. 必须条件 Meteor ...

  5. Linux环境下NodeJS的安装配置(HelloWorld)

    Linux环境下NodeJS的安装配置(HelloWorld) 最简单的环境安装,测试helloworld.给初学者!! 安装脚本,请仔细阅读逐行执行: #!/bin/bash #检查是否已经安装 r ...

  6. Mac安装搭建sublimeText3开发Nodejs环境

    原文] [基本环境 安装Nodejs 这个直接就可以去官网下载就可以了.Nodejs官网 根据自己的PC系统类型选择对应的版本下载之后就可以了. 安装SublimeText3 这个也是直接去Subli ...

  7. webstorm+nodejs环境中安装淘宝镜像

    用过nodejs的人都知道,从node的官方模板库下载依赖包的时候,经常会遇到“假死”(页面静止不动)的状态,这种速度简直要逼死焦急地等待下班的人.还好咱们万能的淘宝提供了淘宝镜像这么一个不要更好用的 ...

  8. nodejs windows环境安装

    相信对于很多关注javascript发展的同学来说,nodejs已经不是一个陌生的词眼.有关nodejs的相关资料网上已经铺天盖地.由于它的高并发特性,造就了其特殊的应用地位. 国内目前关注最高,维护 ...

  9. 【原】nodejs全局安装和本地安装的区别

    来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...

随机推荐

  1. Debian9 使用 Docker 安装 gitlab完整过程

    一. 安装Docker CE (参考 官网指南) 1. 卸载老版本 sudo apt-get remove docker docker-engine docker.io  2. Update the ...

  2. python中的多重循环

    列表中会经常用到多重循环. if __name__=='__main__': names = ['xiaoming','wangwu','lisi'] ages = ['] for name,age ...

  3. 2018 “百度之星”程序设计大赛 - 初赛(A)

    第二题还算手稳+手快?最后勉强挤进前五百(期间看着自己从两百多掉到494名) 1001  度度熊拼三角    (hdoj 6374) 链接:http://acm.hdu.edu.cn/showprob ...

  4. mysql死锁-查询锁表进程-分析锁表原因【转】

    查询锁表进程: 1.查询是否锁表 show OPEN TABLES where In_use > 0;   2.查询进程     show processlist   查询到相对应的进程===然 ...

  5. linux配置supervisor

    linux配置supervisor 安装 pip install supervisor 生成配置文件 使用 echo_supervisord_conf > /etc/supervisord.co ...

  6. linux shell 之尝试编写 企业级 启动脚本

    企业Shell面试题10:开发企业级MySQL启动脚本 说明: MySQL启动命令为: 1 /bin/sh mysqld_safe --pid-file=$mysqld_pid_file_path 2 ...

  7. 华为Qinq的配置

    作者:邓聪聪 qinq(dot1q in dot1q)是一种二层环境中的二层vpn技术,用于二层ISP网络将相同客户网络中的vlan帧,再打一层vlan-tag的手段实现同一个客户的不同站点之间的数据 ...

  8. C++怎么实现线程安全

    muduo库学习笔记1-C++多线程系统编程 网上都说这本书很适合初学者入门学习, 我今天开始准备从头再来; 第一章线程安全的对象管理 对象的生与死不能由对象自身拥有的mutex(互斥器)来保护; 如 ...

  9. sqlserver 导出数据

    背景 一看到这个标题,还有这个内容,感觉当初记录这个知识点真是记录的太简单了.不过通过这个知识点我还真想起了当初的一些事情.写的题外话可能更有意思,希望每篇文章我都能加个当时的题外记录.当时一直搞or ...

  10. web@h,c小总结

    问题0:元素内联元素,行内元素,行内块元素.        内联: 宽高M,P都有效        行内元素:无宽高,内容撑开,M,P左右有效        行内块元素:可设宽高,内容撑开,M,P都有 ...