源码安装nginx

1、安装nginx的依赖包

[root@localhost ~]# yum -y install gcc gcc-c++ openssl openssl-devel pcre pcre-devel zlib zlib-devel

2、解压安装

[root@localhost dxwh8078]# mv nginx-1.15.9.tar.gz /usr/local/src/

[root@localhost dxwh8078]# cd /usr/local/src/

[root@localhost src]# tar zxf nginx-1.15.9.tar.gz

[root@localhost nginx-1.15.9]# ./configure --prefix=/usr/local/nginx

[root@localhost nginx-1.15.9]# make && make install

[root@localhost nginx]# cd /usr/local/nginx/sbin/

[root@localhost sbin]# ./nginx

[root@localhost ~]# cp /usr/local/nginx/conf/nginx.conf{,_`date +%F`.bak}

3、nginx配置

[root@localhost html]# cat /usr/local/nginx/conf/nginx.conf

user  dxwh8078;

worker_processes  2;

#error_log  logs/error.log;

#error_log  logs/error.log  notice;

#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {

worker_connections  1024;

}

http {

include       mime.types;

default_type  application/octet-stream;

#access_log  logs/access.log  main;

sendfile        on;

#tcp_nopush     on;

keepalive_timeout  65;

gzip  on;

server {

listen       80;

server_name  localhost;

charset utf-8;

#access_log  logs/host.access.log  main;

location / {

root   /data/nginx/;

autoindex on;

autoindex_exact_size off;

autoindex_localtime on;

}

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   html;

}

}

工作笔记-- 源码安装nginx的更多相关文章

  1. 源码安装nginx以及平滑升级

                                                           源码安装nginx以及平滑升级                               ...

  2. Linux之源码安装nginx,并按照作业一描述的那样去测试使用

    作业五:源码安装nginx,并按照作业一描述的那样去测试使用 [root@localhost nginx]# yum install gcc-* glibc-* openssl openssl-dev ...

  3. 源码安装Nginx以及用systemctl管理

    一.源码安装Nginx: 先安装gcc编译器(安装过的可以忽略) [root@localhost ~]# yum -y install gcc gcc-c++ wget 进入src目录 [root@l ...

  4. linux源码安装nginx

    任务目标:源码安装nginx,作为web服务修改配置文件,让配置生效,验证配置 首先要去官网nginx.org下载一个tar包: tar xvf 解包 进入到解包出来的目录,对configure进行配 ...

  5. 源码安装nginx 方法二

    yum 仓库不能用大写字母 [root@oldboy conf.d]# gzip * 压缩当前目录下的所有文件 gzip ./* gzip . gzip./ # 关闭防火墙和selinux [root ...

  6. 源码安装nginx env

    源码安装nginx 1. For ubuntu:18.04 apt -y install build-essential libtool libpcre3 libpcre3-dev zlib1g-de ...

  7. redhat 5下源码安装nginx服务

    首先确保机器中已安装 gcc c++,libtool等工具,保证可执行源码安装 A.为了确保能在 Nginx 中使用正则表达式进行更灵活的配置,安装之前需要确定系统是否安装有 PCRE(Perl Co ...

  8. centos7 中源码安装nginx

    使用nginx有一段时间了,还是有很多东西不懂的,在这里做一下自己学习过程中的一些整理,能使自己得到提升. 1.环境:centos7 1511  最小化安装 2.下载nginx,可以在系统中下载,也可 ...

  9. nginx使用-1(源码安装nginx)

    Nginx概述 Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Ramb ...

随机推荐

  1. Linux 内核块 urb

    块 urb 被初始化非常象中断 urb. 做这个的函数是 usb_fill_bulk_urb, 它看来如此: void usb_fill_bulk_urb(struct urb *urb, struc ...

  2. git常用常用操作指令

    GIT操作 1:git init 初始化空的仓库,会在当前文件夹生成一个隐藏.git的文件夹,相当于一个仓库. 2:提交代码的流程:工作代码区-->暂存区 -->主仓库 -->服务器 ...

  3. next-i18next 常见Bug记录

    TypeError: Cannot read property 'wait' of null 此处根本原因为next版本(使用withNamespaces导入命名空间报错) ^5.0.0版本不支持导入 ...

  4. koa2--06.koa-static中间件的使用

    koa-static中间件,主要用于设置静态文件资源的文件路径 首先安装koa-static中间,以下是代码示例 const koa = require('koa'); var router = re ...

  5. CP防火墙排错装逼三件套

    1.tcpdump 通常用来抓包处理经过网卡的交互包 [Expert@BJ-OFFICE-GW:0]# tcpdump -nni any host 10.158.1.100 -w /var/log/t ...

  6. Channel 9视频整理【6】

    GiGi Huang https://channel9.msdn.com/Niners/GiGiHuang

  7. 魅族--魅蓝metal

      评论:金属潮流平民化

  8. ASP.NET MVC API以及.Core API进行安全拦截和API请求频率控制

    安全拦截思路: 根据IP以及请求次数,该IP超过规定请求次数,就有很大可能是非正常用户进行的请求(比如WEB攻击),这时候进行拦截,拦截成功会提示:The allowed number of requ ...

  9. centos curl命令post携带body json数据

    1,接口链接 https://xxx.com/xqAppServer/api/APPBizRest/idfaDuplicateRemove/v1/?sysIdfa=661743D1-A76E-498A ...

  10. 1.1 Lack of free swap space on zabbix_server (zabbix监控报错)

    1.首先看一下内存 free -m 2.然后创建一个分区添加交换文件 mkdir /home/temp dd if=/dev/zero of=/home/temp/swap bs=1024 count ...