点赞
评论
收藏
分享
举报
Linux下安装nginx
发表于2020-09-01 09:46

浏览 822

  1. 下载安装pcre库
    pcre是一个正则表达式库,nginx的rewrite模块需要依赖该库。
    下载地址:http://www.pcre.org/

    wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz
    tar -zxvf pcre-8.40.tar.gz
    cd pcre-8.40
    ./configure 
    make
    sudo make install
  2. 下载安装nginx
    下载地址:http://nginx.org/

    wget http://nginx.org/download/nginx-1.8.1.tar.gz
    tar -zxvf nginx-1.8.1.tar.gz
    cd nginx-1.8.1
    ./configure
    make    
    sudo make install 
  3. 验证安装是否成功
    默认安装路径:/usr/local/nginx
    建立软链接:

    sudo ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/nginx

    执行nginx命令验证是否安装成功:

    sudo 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: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

    建立相应的软链接然后重试:

    sudo ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 #64位系统
    sudo ln -s /lib/libpcre.so.0.0.1 /lib64/libpcre.so.1   #32位系统
已修改于2023-03-04 18:55
创作不易,留下一份鼓励
守望

暂无个人介绍

关注



写下您的评论
发表评论
全部评论(0)

按点赞数排序

按时间排序

关于作者
守望
这家伙很懒还未留下介绍~
89
文章
0
问答
17
粉丝
相关文章
安装所需插件1、安装gccgcc是linux下的编译器在此不多做解释,感兴趣的小伙伴可以去查一下相关资料,它可以编译 C,C++,Ada,ObjectC和Java等语言命令:查看gcc版本 gcc-v一般阿里云的centOS7里面是都有的,没有安装的话会提示命令找不到,安装命令:yum-yinstallgcc2、pcre、pcre-devel安装pcre是一个perl库,包括perl兼容的正则表达式库,nginx的http模块使用pcre来解析正则表达式,所以需要安装pcre库。安装命令:yuminstall-ypcrepcre-devel3、zlib安装zlib库提供了很多种压缩和解压缩方式nginx使用zlib对http包的内容进行gzip,所以需要安装安装命令:yuminstall-yzlibzlib-devel4、安装opensslopenssl是web安全通信的基石,没有openssl,可以说我们的信息都是在裸奔。。。。。。安装命令:yuminstall-yopensslopenssl-devel安装nginx1、下载ng
点赞 5
浏览 5.2k
✨ NGINXConfigNGINXissomuchmorethanjustawebserver.Youalreadyknewthat,probably.WeloveNGINX,because:lowmemoryusagehighconcurrencyasynchronousevent-drivenarchitectureloadbalancingreverseproxyingFastCGIsupportwithcaching(PHP)amazingfasthandlingofstaticfilesTLS/SSLwithSNIAlotoffeatureswithcorrespondingconfigurationdirectives.Youcandeepdiveintothe NGINXdocumentation rightnowORyoucanusethistooltocheckhowNGINXworks,observehowy
点赞 1
浏览 1.8k
感谢您参加NGINX开源社区技术专题系列课程(安全专题),以下为本系列培训的课件和录像,希望您能通过此培训学有成果,祝学习进步!> 课程演讲稿下载:-11月05日密码学:利用TLS协议最大限度地保障信息安全-11月12日TLS卸载:用NGINX搭建高性能TLS服务器-11月19日TLS装载:用NGINX实现高效、安全的跨IDC通讯-11月26日国密标准:NGINX上选择加密算法的原则> 视频回顾:-11月05日密码学:利用TLS协议最大限度地保障信息安全-11月12日TLS卸载:用NGINX搭建高性能TLS服务器-11月19日TLS装载:用NGINX实现高效、安全的跨IDC通讯-11月26日国密标准:NGINX上选择加密算法的原则 > 访问NGINX开源社区:nginx.org.cn>NGINX 官方微信群(扫码入群) > 后续活动推荐主题:使用ModSecurity/AppProtect模块构建NGINXWAF时间:11月25日下午2-3点讲师:NGINX解决方案架构师邹俊 企业需要迅速将服务和应用
点赞 1
浏览 2.1k