首页 > 系统相关 >Linux Nginx安装以及可能出现错误

Linux Nginx安装以及可能出现错误

时间:2023-02-01 11:13:02浏览次数:42  
标签:configure Nginx module nginx yum library install Linux 安装

一、编译安装


make
make install
make的过程是把各种语言写的源码文件,变成可执行文件和各种库文件;
make install是把这些编译出来的可执行文件和库文件复制到合适的地方。

二、可能出现错误

1、在配置信息./configure --prefix=/usr/local/nginx 的时,出现错误:/configure: error: the HTTP rewrite module requires the PCRE library.


解决方法:安装pcre
yum -y install pcre pcre-devel
-y 是跳过所有需要手动确认的环节

2、缺少ssl错误,错误信息如下:


./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library. You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=<path> options.
解决方法:安装openssl
yum -y install openssl openssl-devel

3、缺少编译器,错误信息如下:


./configure: error: C compiler cc is not found
解决方法:安装gcc-c++
yum -y install gcc-c++ autoconf automake
autoconf是自动配置,automake是自动编译

4、缺少zlib包,错误信息如下:


./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using –without-http_gzip_module
option, or install the zlib library into the system, or build the zlib
library
statically from the source with nginx by using –with-zlib=<path> option.
解决方法:安装zlib
yum install -y zlib-devel

5、确实libxml2,错误信息如下:


./configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.
解决方法:
yum -y install libxml2 libxml2-dev
yum -y install libxslt-devel

6、http_image_filter_module是nginx提供的集成图片处理模块,需要gd-devel的支持,错误信息如下:


./configure: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.
解决方法:
yum -y install gd-devel

7、缺少ExtUtils,错误信息如下:


./configure: error: perl module ExtUtils::Embed is required
解决方法:
yum -y install perl-devel perl-ExtUtils-Embed

8、缺少GeoIP,错误信息如下:


./configure: error: the GeoIP module requires the GeoIP library.
You can either do not enable the module or install the library.
解决方法:
yum -y install GeoIP GeoIP-devel GeoIP-data
安装完成后启动安装成功后 /usr/local/nginx 目录下如下
fastcgi.conf koi-win nginx.conf.default
fastcgi.conf.default logs scgi_params
fastcgi_params mime.types scgi_params.default
fastcgi_params.default mime.types.default uwsgi_params
html nginx uwsgi_params.default
koi-utf nginx.conf win-utf

三、启 动


确保系统的 80 端口没被其他程序占用,运行/usr/local/nginx/nginx 命令来启动 Nginx,
netstat -ano|grep 80
如果查不到结果后执行,有结果则忽略此步骤(ubuntu下必须用sudo启动,不然只能在前台运行)
sudo /usr/local/nginx/nginx
打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to nginx! 则表示 Nginx 已经安装并运行成功。

标签:configure,Nginx,module,nginx,yum,library,install,Linux,安装
From: https://www.cnblogs.com/haolb123/p/17081929.html

相关文章

  • linux服务器运行java项目, 监控查看内存、储存空间和cpu占用率
    服务器部署方式为tomcat中运行war包的方式,有一次重新部署时候发现报异常堆栈溢出了.想要定位到某个war包中通过学习整理出此篇文章以作记录笔记.1.关于内存过高......
  • Linux创建新用户并配置远程连接
    useraddz #创建用户ztail-f/var/log/audit/audit.log#查看登录日志sudovi/etc/sudoers#查看权限,并修改权限  #增加sudo到root权限“#inc......
  • Linux创建文件报错:/bin/bash^M: bad interpreter
    在使用Linux创建好文件shell文件之后,发生了这样一个错误:/bin/bash^M:badinterpreter查找资料后发现:在执行shell脚本时提示这样的错误主要是由于shell脚本文件是dos格式,即......
  • Debian11.6 最小化安装后设置
    一,Debian安装与启用sudo命令刚安装好的Debian默认还没有sudo功能。1.先进入root用户,调用下面的命令后,输入密码$su2.安装sudo#apt-getinstallsudo3.修改/e......
  • 1-安装MySQL数据库
    解压文件,移动到/usr/local/mysql3308目录下tar-zxvfmysql-5.7.35-linux-glibc2.12-x86_64.tar.gzmvmysql-5.7.35-linux-glibc2.12-x86_64/usr/local/mysql3308......
  • 基于Docker安装的Stable Diffusion使用CPU进行AI绘画
    基于Docker安装的StableDiffusion使用CPU进行AI绘画由于博主的电脑是为了敲代码考虑买的,所以专门买的高U低显,i9配核显,用StableDiffusion进行AI绘画的话倒是专门有个......
  • 转载 : Nginx 相关介绍(Nginx是什么?能干嘛?)
    Nginx的产生没有听过Nginx?那么一定听过它的"同行"Apache吧!Nginx同Apache一样都是一种WEB服务器,基于REST架构风格,以统一资源描述符(UniformResourcesIdentifier)URI......
  • Linux服务器中文乱码的问题
    Linux服务器系统的CentOS7文件名是中文全是?的乱码,执行 locale查看编码格式,内容如下[root@iZ2ze3n2wuzr91sx0vgwwdZ~]#localelocale:CannotsetLC_ALLtodefau......
  • linux中memset作用,为什么要用memset
    光脚赤膊于2010-03-2814:36:08发表:“用处是大面积赋值,速度快!”所谓“初始化”,当然是指将你定义的变量或申请的空间赋予你所期望的值,例如语句inti=0;就表明定义了一......
  • 记录解决新电脑安装VMware启动出现蓝屏的情况。
    一般新电脑或者没有用过虚拟机的电脑都会出现启动蓝屏的情况,这种情况是因为默认的系统没有开启虚拟化导致的,需要设置一下系统就可以了。首先查看bios有没有开启虚拟化 ......