linux下安装nginx
来源:互联网 发布:sas数据分析大赛题目 编辑:程序博客网 时间:2024/06/07 12:37
linux系统为Centos 64位
第一步:从http://nginx.org/download/上下载相应的版本(或者wget http://nginx.org/download/nginx-1.5.9.tar.gz直接在Linux上用命令下载)
第二步:解压 tar -zxvf nginx-1.5.9.tar.gz
第三步:设置一下配置信息 ./configure –prefix=/usr/local/nginx ,或者不执行此步,直接默认配置
第四步:
make 编译 (make的过程是把各种语言写的源码文件,变成可执行文件和各种库文件)
make install 安装 (make install是把这些编译出来的可执行文件和库文件复制到合适的地方)
启动方式:
nginx默认安装到/usr/local目录下面
/usr/local/nginx/sbin/nginx
如果在第三步执行了./configure –prefix=/usr/local/nginx,则执行
/usr/nginx/sbin/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= options.
解决方案:
yum -y install openssl openssl-devel
3、如果安装出现在下面的错误是缺少编译环境。安装编译源码所需的工具和库 ./configure: error: C compiler cc is not found
yum install gcc gcc-c++ ncurses-devel perl
4、安装cmake,从http://www.cmake.org下载源码并编译安装
yum -y install make gcc gcc-c++ ncurses-devel yum -y install zlib zlib-devel
5、如果需要ssl功能需要openssl库
yum -y install openssl openssl--devel
- nginx--linux下安装nginx
- linux 下nginx安装
- Linux下安装Nginx
- linux下安装nginx
- linux下安装nginx
- linux下安装nginx
- Linux下安装Nginx
- linux 下安装 nginx
- Linux下Nginx安装
- Linux下安装Nginx
- linux下安装nginx
- Linux下Nginx安装
- linux下nginx安装
- Linux下安装nginx
- linux下安装nginx
- linux下安装nginx
- linux下nginx安装
- linux 下安装nginx
- 使用ant编译Java编程思想出现时 java.lang.UnsupportedClassVersionError: Bad version number in .class问题
- Spring源码学习--Spring事物
- 【怎样写代码】偷窥高手 -- 反射技术(二):窥视内部
- 初创企业如何做高效持续交付
- Linux mysql5.7.18 rpm安装
- linux下安装nginx
- 清除浮动的影响的方法
- SQL中使用where 1=1 和 select * 的坏处
- 让测试/开发/生产环境相分离
- 无言
- react-router 学习笔记之Link带参数传值
- jq 多个《button》 点击事件(含 ajax ,action), 功能版
- TabLayout——浅谈
- mysql 数据库迁移