源码安装nginx env
源码安装nginx
1. For ubuntu:18.04
apt -y install build-essential libtool libpcre3 libpcre3-dev zlib1g-dev openssl net-tools curl wget
wget -P /tmp http://nginx.org/download/nginx-1.18.0.tar.gz
tar -xf /tmp/nginx-1.18.0.tar.gz -C /usr/local/src
cd /usr/local/src/nginx-1.18.0 && ./configure --prefix=/usr/local/nginx
make && make insatll
增强性能或功能需要优化或使用其他方案
2. For Centos7
yum -y install gcc pcre-devel openssl-devel zlib-devel
useradd -s /sbin/nologin nginx -M
wget -P /tmp http://nginx.org/download/nginx-1.18.0.tar.gz
tar -xf /tmp/nginx-1.18.0.tar.gz -C /usr/local/src
cd /usr/local/src/nginx-1.18.0
./configure --prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-pcre \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module
make && make install
chown -R nginx.nginx /usr/local/nginx
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/
# cat /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStart=/usr/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
[Install]
WantedBy=multi-user.target
# systemctl daemon-reload
# systemctl enable --now nginx
PS:
源码安装nginx env的更多相关文章
- 源码安装nginx以及平滑升级
源码安装nginx以及平滑升级 ...
- Linux之源码安装nginx,并按照作业一描述的那样去测试使用
作业五:源码安装nginx,并按照作业一描述的那样去测试使用 [root@localhost nginx]# yum install gcc-* glibc-* openssl openssl-dev ...
- 源码安装Nginx以及用systemctl管理
一.源码安装Nginx: 先安装gcc编译器(安装过的可以忽略) [root@localhost ~]# yum -y install gcc gcc-c++ wget 进入src目录 [root@l ...
- linux源码安装nginx
任务目标:源码安装nginx,作为web服务修改配置文件,让配置生效,验证配置 首先要去官网nginx.org下载一个tar包: tar xvf 解包 进入到解包出来的目录,对configure进行配 ...
- 工作笔记-- 源码安装nginx
源码安装nginx 1.安装nginx的依赖包 [root@localhost ~]# yum -y install gcc gcc-c++ openssl openssl-devel pcre pc ...
- 源码安装nginx 方法二
yum 仓库不能用大写字母 [root@oldboy conf.d]# gzip * 压缩当前目录下的所有文件 gzip ./* gzip . gzip./ # 关闭防火墙和selinux [root ...
- redhat 5下源码安装nginx服务
首先确保机器中已安装 gcc c++,libtool等工具,保证可执行源码安装 A.为了确保能在 Nginx 中使用正则表达式进行更灵活的配置,安装之前需要确定系统是否安装有 PCRE(Perl Co ...
- centos7 中源码安装nginx
使用nginx有一段时间了,还是有很多东西不懂的,在这里做一下自己学习过程中的一些整理,能使自己得到提升. 1.环境:centos7 1511 最小化安装 2.下载nginx,可以在系统中下载,也可 ...
- nginx使用-1(源码安装nginx)
Nginx概述 Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Ramb ...
随机推荐
- try - with - resource
本文详细介绍了自 JDK 7 引入的 try-with-resources 语句的原理和用法,以及介绍了 JDK 9 对 try-with-resources 的改进,使得用户可以更加方便.简洁的使用 ...
- Json文件转换为Excel文件!涉及读文件,时间戳转化,写文档
一. 思路 今天接到个小任务,让把json文件转换成excel文件,按照列展开. 思路:既然json已经都已经是现成的,那直接将json文件做读操作,在通过不同的key,找到对应的信息,在存到单元格中 ...
- 生活随笔:Furious 7:人生的路口,你先向西,但终点只有一个
FOR PAUL It's never goodbye see you again "他永远都是我们的家人."Dom起身准备离开 Letty问他,你打算不告而 ...
- BLDC有感FOC算法理论及其STM32软硬件实现
位置传感器:旋转编码器 MCU:STM32F405RGT6 功率MOS驱动芯片:DRV8301 全文均假设在无弱磁控制的情况下 FOC算法理论 首先,我们要知道FO ...
- hdu3338 最大流
题意: 给你一个N*M的网格,上面有的有一些数字,要求填充数字,满足的规则是这样: 答案不唯一,只要满足和的关系就可以,还有就是只能用1--9之间的数字填充,而且每一行或一列可 ...
- DVWA之Reflected XSS(反射型XSS)
目录 Low Medium High Impossible Low 源代码: <?php header ("X-XSS-Protection: 0"); // Is ther ...
- Win64 驱动内核编程-23.Ring0 InLineHook 和UnHook
Ring0 InLineHook 和UnHook 如果是要在R0里hook,作者的建议是InLine HOOK,毕竟SSDT HOOK 和 SHADOW SSDT HOOK比较麻烦,不好修改.目前R3 ...
- springmvcdemo
项目点击属性 2.3 转换成2.5 已经变成一个网站项目了 报错消失 pom.xml <project xmlns="http://maven.apache.or ...
- JS String总结
String常用总结 1.字符 length属性:表示字符串包含多少16位码元 charAt():方法返回给定索引位置的字符 charCodeAt() :可以查看指定码元的字符编码 String.fr ...
- 容器进阶:OCI与容器运行时
Blog:博客园 个人 什么是容器运行时(Container Runtime) Kubernetes节点的底层由一个叫做容器运行时的软件进行支撑,它负责比如启停容器 这样的事情.最广为人知的容器运行时 ...