随笔 - 366  文章 - 0  评论 - 101  阅读 - 30万

nginx

[root@zzx nginx-1.10.1]# yum install -y openssl openssl-devel zlib pcre           yum安装的pcre版本很低 可以编译安装高版本

yum install -y gcc gcc-c++  编译安装需要gcc

tar zxf pcre-8.39.tar.gz

cd  pcre-8.39

./configure

make

make install

tar 

[root@zzx ~]# tar zxf nginx-1.10.1.tar.gz 

指定用户和组 指定安装位置和安装模块

[root@zzx nginx-1.10.1]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.10.1 --with-http_stub_status_module --with-http_ssl_module           

[root@zzx nginx-1.10.1]# make

[root@zzx nginx-1.10.1]# make install

 [root@nginx application]# ln -sv /application/nginx-1.10.1/ /application/nginx

检查语法发现错误 由于pcre版本太高了 打开共享库的时候找不到这个文件

[root@nginx application]# /application/nginx/sbin/nginx -t
/application/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

[root@nginx application]# find / -name libpcre.so.1
/usr/local/lib/libpcre.so.1

[root@nginx application]# echo "/usr/local/lib" >> /etc/ld.so.conf    编辑文件
[root@nginx application]# ldconfig       使文件立即生效
[root@nginx application]# /application/nginx/sbin/nginx -t   再次检查语法

nginx: the configuration file /application/nginx-1.10.1/conf/nginx.conf syntax is ok
nginx: [emerg] getpwnam("nginx") failed       由于没有创建nginx这个用户
nginx: configuration file /application/nginx-1.10.1/conf/nginx.conf test failed

 

[root@nginx application]# useradd nginx -s /sbin/nologin -M
[root@nginx application]# passwd nginx

[root@nginx application]# /application/nginx/sbin/nginx -t   再次检查就成功了
nginx: the configuration file /application/nginx-1.10.1/conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.10.1/conf/nginx.conf test is successful

[root@nginx application]# /application/nginx/sbin/nginx    回车启动 不需要start

 

posted on   寒星12345678999  阅读(206)  评论(4编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示