首页 > 系统相关 >linux安装nginx

linux安装nginx

时间:2023-12-18 11:25:22浏览次数:33  
标签:http temp -- module nginx linux path 安装

  1. 安装依赖
//一键安装四个依赖环境
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
  1. 上传压缩包并解压

上传nginx压缩包到/usr/local/nginx目录下

tar xvf nginx-1.24.0.tar.gz

  1. 安装nginx
cd nginx-1.24.0
#指定nginx安装的目录
./configure --prefix=/usr/local/nginx
#执行make命令  编译
make
#执行make install命令  安装
make install
ln -s /usr/local/nginx/sbin/* /usr/local/bin/
  1. 检查版本
nginx -v
  1. 启动nginx
nginx
#检查nginx服务
ps -ef|grep nginx

configure arguments:

configure arguments: 
--prefix=/etc/nginx  # 指定安装路径
--sbin-path=/usr/sbin/nginx  # 程序文件位置
--modules-path=/usr/lib64/nginx/modules  # 模块路径的位置
--conf-path=/etc/nginx/nginx.conf  # 主配置文件的位置
--error-log-path=/var/log/nginx/error.log # 错误日志位置
--http-log-path=/var/log/nginx/access.log   # 访问日志位置
--pid-path=/var/run/nginx.pid  # 程序PID
--lock-path=/var/run/nginx.lock  # 锁路径,防止重复启动nginx
--http-client-body-temp-path=/var/cache/nginx/client_temp   # 缓存 
--http-proxy-temp-path=/var/cache/nginx/proxy_temp  # 代理缓存
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp   # php缓存
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp  # python缓存位置
--http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx  # 用户
--group=nginx  # 组
--with-compat # 启动动态模块兼容
--with-file-aio  # 提高性能
--with-threads   # 多线程模块
--with-http_addition_module  #  响应之前或者之后追加文本内容
--with-http_auth_request_module  # 认证模块,比如登录密码
--with-http_dav_module #  增加上传PUT,DELETE,MKCOL:创建集合,COPY和MOVE方法)默认情况下为关闭
--with-http_flv_module # NGINX添加MP4、FLV视频支持模块

--with-http_gunzip_module  # 压缩模块
--with-http_gzip_static_module  # 压缩模块
--with-http_mp4_module  # 支持多媒体
--with-http_random_index_module  # 随机主页
--with-http_realip_module  # nginx获取真实ip模块
--with-http_secure_link_module  # nginx安全下载模块
--with-http_slice_module  # nginx中文文档
--with-http_ssl_module  # 网站加密
--with-http_stub_status_module  # 访问状态
--with-http_sub_module  # nginx替换响应内容
--with-http_v2_module  # web2.0技术

# 邮局
--with-mail  # 邮件
--with-mail_ssl_module 

# 负载均衡反向代理模块
--with-stream 
--with-stream_realip_module 
--with-stream_ssl_module 
--with-stream_ssl_preread_module 

# CPU优化参数等
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

标签:http,temp,--,module,nginx,linux,path,安装
From: https://www.cnblogs.com/yufou/p/17910632.html

相关文章

  • 安装docker
    卸载docker删除docker所在目录rm-rf/etc/dockerrm-rf/run/dockerrm-rf/var/lib/dockershimrm-rf/var/lib/docker删除docker进程ps-ef|grepdockerkill-9pid卸载docker相关包yumlistinstalled|grepdockeryumremovecontainerd.io.x86_......
  • docker安装nginx
    下载nginx镜像dockerpullnginx:1.24.0简易启动nginxdockerrun-p81:80-d--namesimple-nginxnginx:1.24.0创建本地挂载文件夹#创建四个文件夹conf,log,html,conf.dmkdir-p/home/nginx/{conf,logs,html,conf.d}复制简易nginx中的文件到挂载目录中#复制......
  • 【python】浏览器自动化Selenium安装WebDriver最新Chrome驱动
    selenium 是浏览器自动化测试框架,原本被用于网页测试。但到了爬虫领域,它又成为了爬虫的好帮手。selenium 可以控制你的浏览器,模仿人浏览网页,从而获取数据,自动操作等。首先打开 Chrome浏览器,依次点击浏览器右上角的 三个点 - 帮助 - 关于GoogleChrome查看浏览器版本信......
  • Linux服务器快速安装MongoDB-5.0
    最近开始体验FastGPT开源知识库问答系统,用他们试着开发调试一些小助手。这中间需要使用到MongoDB,就在自己服务器上进行了安装,特此记录下。环境说明:阿里云ECS,2核8G,X86架构,CentOS7.9操作系统。选择版本1.打开MongoDB社区版下载页面,选择我们想要安装的版本、操作系统、和包类型,......
  • 在linux中,用-r还是-p处理递归的文件夹
    在Linux中,递归处理文件夹用-r还是-p选项1.使用-r:-r来表示递归,例如cp和rm。例如:-r通常用于表示递归操作,例如在复制目录或删除目录时使用。示例:复制目录及其内容:cp-rsource_directorydestination_directory递归删除目录及其内容:rm-rdirectory递归地移动目......
  • linux Slab高处理
    SLAB是Linux操作系统的一种内存分配机制。其工作是针对一些经常分配并释放的对象,您可以看看哪些应用进程的slab占用的内存比较多,是否这些应用需要频繁的请求和释放内存,比如进行一些小文件的读写。如果都是应用的正常使用,可以考虑升级服务器内存,如果内存不足影响业务,需要临时释放一......
  • mysql 5.7和8.0 yum安装
    安装环境Centos7.61.下载mysql源安装包$wgethttp://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm2.安装mysql源$yumlocalinstallmysql57-community-release-el7-8.noarch.rpm3.检查mysql源是否安装成功$yumrepolistenabled|grep"mysql.-comm......
  • helm v3 部署 ingress-nginx
    1、部署helmv3略...()2、添加源并更新[root@master1ingress]#helmrepoaddingress-nginxhttps://kubernetes.github.io/ingress-nginx[root@master1ingress]#helmrepoupdate3、拉取镜像[root@master1ingress]#helmpullingress-nginx/ingress-nginx4、解压并修改......
  • k8s安装metrics-server
    KubernetesMetricsServer:KubernetesMetricsServer是Cluster的核心监控数据的聚合器,kubeadm默认是不部署的。MetricsServer供Dashboard等其他组件使用,是一个扩展的APIServer,依赖于APIAggregator。所以,在安装MetricsServer之前需要先在kube-apiserver中开启API......
  • kubernetes1.18.2安装kube-prometheus
    注:使用kube-prometheus安装非常方便,前面的prometheus+grafana+metrics-server都不用安装,已经集成在里面。1、clonegithub地址gitclonehttps://github.com/coreos/kube-prometheus.gitcdkube-prometheus2、查看manifest路径下所有的yaml文件[root@master1manifests]#lltotal......