zoukankan      html  css  js  c++  java
  • nginx编译文件配置(原)

    1、在根目录的opt下创建文件夹software并wget一个nginx包进行解压,/opt/software/,解压后需要对软件包文件进行授权

    2、cd到nginx目录输入id nginx 未安装插件的需要进行  sudo useradd nginx

    3、在/opt/software/nginx-1.15.8路径下执行以下配置文件

    ./configure 
    --prefix=/usr 
    --sbin-path=/usr/sbin/nginx 
    --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/nginx.pid 
    --lock-path=/var/lock/nginx.lock 
    --user=nginx 
    --group=nginx 
    --with-http_ssl_module 
    --with-http_flv_module 
    --with-http_stub_status_module 
    --with-http_gzip_static_module 
    --http-client-body-temp-path=/var/tmp/nginx/client/ 
    --http-proxy-temp-path=/var/tmp/nginx/proxy/ 
    --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ 
    --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi/ 
    --http-scgi-temp-path=/var/tmp/nginx/scgi/ 
    --with-pcre
    

    4、如果编译失败需要确认下安装编译器没有

    输入which gcc

    安装gcc编译器指令 sudo yum install gcc gcc-c++ automake pcre pcre-devel zlip zlib-devel openssl openssl-devel 

    gcc为GNU Compiler Collection的缩写,可以编译C和C++源代码等,它是GNU开发的C和C++以及其他很多种语言 的编译器(最早的时候只能编译C,后来很快进化成一个编译多种语言的集合,
    如Fortran、Pascal、Objective-C、Java、Ada、 Go等。)   gcc 在编译C++源代码的阶段,只能编译 C++ 源文件,而不能自动和 C++ 程序使用的库链接(编译过程分为编译、链接两个阶段,注意不要和可执行文件这个概念搞混,
    相对可执行文件来说有三个重要的概念:编译(compile)、链接(link)、加载(load)。源程序文件被编译成目标文件,多个目标文件连同库被链接成一个最终的可执行文件,可执行文件被加载到内存中运行)。
    因此,通常使用 g++ 命令来完成 C++ 程序的编译和连接,该程序会自动调用 gcc 实现编译。   gcc-c++也能编译C源代码,只不过把会把它当成C++源代码,后缀为.c的,gcc把它当作是C程序,而g++当作是c++程序;后缀为.cpp的,两者都会认为是c++程序,注意,虽然c++是c的超集,
    但是两者对语法的要求是有区别的。   automake是一个从Makefile.am文件自动生成Makefile.in的工具。为了生成Makefile.in,automake还需用到perl,由于automake创建的发布完全遵循GNU标准,所以在创建中不需要perl。
    libtool是一款方便生成各种程序库的工具。   pcre pcre-devel:在Nginx编译需要 PCRE(Perl Compatible Regular Expression),因为Nginx 的Rewrite模块和HTTP 核心模块会使用到PCRE正则表达式语法。   zlip zlib-devel:nginx启用压缩功能的时候,需要此模块的支持。   openssl openssl-devel:开启SSL的时候需要此模块的支持。

      

    5、执行上面的配置文件报错nginx 安装时候报错:make: *** No rule to make target `build', needed by `default'. Stop.

    需要安装对应依赖库

    yum install -y pcre pcre-devel  zlib zlib-devel openssl openssl-devel

    6、安装完依赖库后在执行3的脚本后sudo make

    注意:要不关闭防火墙,要不然放不了nginx页面

  • 相关阅读:
    自定义View的ToolBar布局报错Error:(2) No resource identifier found for attribute 'context' in package 'c
    在学git之主分支 branch
    获取发布版SHA1
    关于开启线程与UI的操作
    播放音频和视频(VideoView控件)
    通知栏Notification的应用
    Android 真机调式 Installation failed with message 远程主机强迫关闭了一个现有的连接。. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing. WA
    运行程序申请危险权限
    mysql乐观锁总结和实践
    Nginx配置文件nginx.conf中文详解
  • 原文地址:https://www.cnblogs.com/jackzz/p/10218683.html
Copyright © 2011-2022 走看看