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

centos7安装nginx

时间:2022-12-04 10:55:26浏览次数:54  
标签:启动 local centos7 nginx usr install 安装

  1. 下载解压

    • 官网地址: nginx: download

    • 下载稳定版中的,Linux版本

    • 解压缩
      tar -zxvf nginx-1.22.1.tar.gz

  2. 安装依赖

    yum install -y openssl* &
    yum -y install ncurses-devel

  3. 打开解压缩的nginx目录,配置编译
    cd /nginx-1.22.1
    ./configure
    make
    make install

  4. 检查nginx 默认安装路径,如下图安装在 /usr/local/nginx 路径下

    whereis nginx

  5. cd /usr/local/nginx 这里面可以配置和启动 ngxin

    配置文件位于:config/redis.conf

    启动: sbin/nginx

  1. 建立开机启动文件
    vi /etc/systemd/system/nginxd.service
[Unit]
Description=redis-server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
PrivateTmp=true

[Install]
WantedBy=multi-user.target
  1. 加入开机启动
    systemctl enable nginxd

标签:启动,local,centos7,nginx,usr,install,安装
From: https://www.cnblogs.com/cxygg/p/16949508.html

相关文章

  • LINUX安装openssl
    openssl官网下载​​https://www.openssl.org/source/old/​​1、解压openssl包:tar-xzfopenssl-1.1.1n.tar.gz2、得到openssl-1.1.1n目录,然后进入openssl-1.1.1n目录中......
  • centos6通过源码安装sysstat 12.1.3或者rpm包安装sysstat 12.1.3
    sysstat包含了常用的Linux性能工具,用来监控和分析系统的性能。我们的案例会用到这个包的两个命令mpstat和pidstat。mpstat是一个常用的多核CPU性能分析工具,用来实......
  • 为 centos7 编译 nginx
    通过yum安装的nginx版本多数是1.22.x,已经被暴露出有一个高危的安全漏洞(CVE-2022-3638)。需要自行编译安装最新的1.23.2以修复这个安全问题。源码好下载,编译命令也简......
  • Haproxy源码安装
    Haproxy源码安装目录Haproxy源码安装了解haproxy安装Haproxy1、解决lua环境2、安装Haproxy3、验证Haproxy版本4、创建配置文件5、启动haproxy6、查看haproxy的状态页面了......
  • UML语法 - 插件的安装和使用
    UML介绍https://plantuml.com/zh/sequence-diagramPlantUML是一个可以让你快速编写UML图的组件,语法可以直接参考这个网站的语法示例画图。在线UML方便快捷:http://www......
  • Winform程序在VS中打包成安装程序(带卸载)
    场景在VS中进行Winform开发时,可以直接在项目上右击选择生成  则会在项目的bin目录下直接生成exe等文件,此时将这个文件夹直接整个复制到别的地方就可以运行。 ......
  • git-lab安装
    进入官网https://packages.gitlab.com/gitlab/gitlab-ce/选择相应的版本下载  安装相关的依赖yuminstallcurlopenssh-serveropenssh-clientspostfixpolicyc......
  • 关于i3-8100安装黑群晖无核显问题
    本人引导是1.04bds918+ 群晖版本6.2.31.操作方法https://www.zxbblog.com/?id=138(需要diskgeniuspro版本,去网上随便下一个)2.补丁下载地址:点我下载 提取码:kox4(DS......
  • Centos7.9编译php 5.3 make时出现错误
    问题1:make:***[libphp5.la]Error1解决:yuminstalllibtool-ltdl-devel问题2:/bin/ld:ext/standard/dns.o:undefinedreferencetosymbol'__dn_sk......
  • WEB IDE Code Server 安装及使用
    概述Coder是VSCode的WebIDE,分CodeServer和Coder,CodeServer安装在服务器上,Coder是一个WEB版的VSCode,但目前多数的VSCode插件无法使用。VSCode:https://code.visua......