参考网站
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. 快速了解Hash算法

    hash hashcode java  1.hash 2.hash算法 1.hash Hash,一般翻译做“散列”,也有直接音译为“哈希”的,就是把任意长度的输入(又叫做预映射pre-image)通过 ...

  2. 【Android休眠】之PowerKey唤醒源实现【转】

    转自:https://blog.csdn.net/u013686019/article/details/53677531 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog ...

  3. InstallShield 静默安装

    可能先需要获取安装包参数,安装包参数获取/?或是/HELP InstallScrip工程 1. 在命令行窗口中使用 -R 参数(即record) 运行安装程序. 例如: Setup.exe -R or ...

  4. configparser模块--配置文件

    该模块适用于配置文件的格式与windows ini文件类似,可以包含一个或多个节(section),每个节可以有多个参数(键=值). 创建文件 import configparser config = ...

  5. 【转】C++标准转换运算符static_cast

    static_cast<new_type> (expression) 虽然const_cast是用来去除变量的const限定,但是static_cast却不是用来去除变量的static引用 ...

  6. 029_shell编写工作常用工具类总结

    一.检查命令的执行结果 function check_result() { result=$? flag=$1 if [[ "$result"x == "0"x ...

  7. Linux查看所有用户和组信息

    主要通过以下两个命令: cat /etc/passwd cat /etc/group 步骤一:cat /etc/passwd查看所有的用户信息,详情如下图: 步骤2:cat /etc/passwd|g ...

  8. Laravel 怎么在 blade 视图中将带 HTML 字符原样输出

    ### 感觉这是比较细小的,细节处理问题,很容易就一下子想不起怎么处理 但知道处理方式是那么简单时,真的觉得基础不够扎实 ### 富文本编辑内容: 视图原样输出: 视图模板的标签是这样处理就可以的-- ...

  9. js——事件冒泡与捕获小例子

    布局代码 #outer{ width: 300px; height: 300px; background: red; } #inner{ width: 200px; height: 200px; ba ...

  10. 年底Android面试整理(附答案)

    面试,无非都是问上面这些问题(挺多的 - -!),聘请中高级的安卓开发会往深的去问,并且会问一延伸二.以下我先提出几点重点,是面试官基本必问的问题,请一定要去了解! 基础知识 – 四大组件(生命周期, ...