博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nodejs 环境安装
阅读量:6488 次
发布时间:2019-06-24

本文共 3678 字,大约阅读时间需要 12 分钟。

参考网站http://www.runoob.com/nodejs/nodejs-http-server.htmlhttps://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_64npm -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;}

 

转载于:https://www.cnblogs.com/liuyoushui/p/7280487.html

你可能感兴趣的文章
基于haddop的HDFS和Excel开源库POI导出大数据报表(一)
查看>>
在树莓派 3 上构建 Swift 3.0
查看>>
Docker实战指南(三):Docker镜像
查看>>
A C Programming Language Puzzle
查看>>
NDK开发-ReleaseStringUTFChars调用的坑
查看>>
《30天自制操作系统》中文源码
查看>>
nodejs debug
查看>>
SegmentFault 助力 RTC Hackathon,一场别样的 Mini Hackathon
查看>>
Scala 编程风格指南[Databricks ]
查看>>
创业公司的高性价比运维
查看>>
custom-dns-for-internal-network
查看>>
Ajax跨域
查看>>
[练习]JS鼠标拖拽(DnD)操作
查看>>
jFinal路由解析源码分析
查看>>
webpack自动刷新
查看>>
Validate Binary Search Tree leetcode
查看>>
review 工具流程
查看>>
GitLab 发布安全修复版本 11.9.7, 11.8.7 和 11.7.11
查看>>
jQ实例篇--ajax请求json数据案例
查看>>
angular 指令简述
查看>>