博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux下nginx安装方法
阅读量:4571 次
发布时间:2019-06-08

本文共 1315 字,大约阅读时间需要 4 分钟。

因为本人不是很懂linux,所以安装步骤是从网上找的一些资料整合后,才部署成功,现将步骤记录下来

部署安装nainx环境:pcre(作用rewrite)、zlib(作用压缩)、ssl、gcc

yum -y install zlib;
yum –y install pcre;
yum –y install openssl;
yum install gcc gcc-c++ ncurses-devel perl;
2、下载安装nginx-*.tar.gz。     (*号表示版本号
tar –zxvf nginx-*.tar.gz –C ./;     #解压
cd nginx-*;                 #进入目录
./congigure --prefix=/usr/local/nginx;   #配置安装位置 也可不加此参数
make;                       
make install;               #安装  就是将你的解压目录复制到配置文件的指定地点,看执行过程能看出,大部分linux命令执行的是 cp
3、安装完成后执行以下操作验证安装是否成功:

#如果你的安装路径不是这个,那么进入到自己的安装目录下 执行第二条命令

cd  /usr/local/nginx/sbin  
./nginx -t   
结果显示:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
至此,nginx的安装已成功完成。
如果在操作第二步时报错,请按以下方法解决:
1.错误提示:./configure: error: the HTTP rewrite module requires the PCRE library.
安装pcre-devel解决问题:
yum -y install pcre-devel
2.错误提示:./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.
解决办法:
yum -y install openssl openssl-devel
大部分出现问题,都是缺少依赖包导致,如果还有其他的问题,请安装相对应的依赖包;

转载于:https://www.cnblogs.com/bfx-java/p/5109200.html

你可能感兴趣的文章
功能规格说明书
查看>>
JavaScipt30(第七个案例)(主要知识点:数组some,every,findIndex方法)
查看>>
Android 采用HttpClient提交数据到服务器
查看>>
EL表达式概述
查看>>
word中批量修改图片大小
查看>>
Ext4 中 日期和时间的控件
查看>>
最长子序列问题
查看>>
python中一些有用的函数------持续更新中
查看>>
第三次作业—张淑华
查看>>
python 实现字符串的切片功能
查看>>
Centos 文件权限修改
查看>>
使用Amazon Simple Queues Service (SQS)实现与AutoCAD远程交互
查看>>
oracle 游标
查看>>
滚动条滚动到最底部的方法总结
查看>>
想不劳而获的人太多了,而我就是其中一个
查看>>
hexo改造
查看>>
Python模块NumPy中的tile(A,rep) 函数
查看>>
JS实现打开本地文件或文件夹 ActiveXObject
查看>>
python中split函数的使用
查看>>
优化 SQL SELECT 语句性能
查看>>