linux下安装nginx
2017-09-09 23:37
316 查看
第一步:从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是把这些编译出来的可执行文件和库文件复制到合适的地方)
错误为:./configure: error: the HTTP rewrite module requires the PCRE library.
安装pcre-devel解决问题
yum -y install pcre-devel
还有可能出现:
错误提示:./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
错误 :
make: * No targets specified and no makefile found. Stop.
解决办法:
yum update
4、 安装后在linux下启动和关闭nginx:
启动操作
/usr/nginx/sbin/nginx
(/usr/nginx/sbin/nginx -t 查看配置信息是否正确)
转载连接:http://www.cnblogs.com/kunhu/p/3633002.html
第二步:解压 tar -zxvf nginx-1.5.9.tar.gz
第三步:设置一下配置信息 ./configure –prefix=/usr/local/nginx ,或者不执行此步,直接默认配置
第四步:
make 编译 (make的过程是把各种语言写的源码文件,变成可执行文件和各种库文件)
make install 安装 (make install是把这些编译出来的可执行文件和库文件复制到合适的地方)
错误为:./configure: error: the HTTP rewrite module requires the PCRE library.
安装pcre-devel解决问题
yum -y install pcre-devel
还有可能出现:
错误提示:./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
错误 :
make: * No targets specified and no makefile found. Stop.
解决办法:
yum update
4、 安装后在linux下启动和关闭nginx:
启动操作
/usr/nginx/sbin/nginx
(/usr/nginx/sbin/nginx -t 查看配置信息是否正确)
转载连接:http://www.cnblogs.com/kunhu/p/3633002.html
相关文章推荐
- lnmp (linux+nginx+mysql+php) 环境安装脚本
- Linux 安装nginx 1.8.1 及配置
- Linux nginx安装
- Linux服务中Nginx安装及配置
- Nginx在Linux和windows下的安装使用
- linux下安装keepalived (nginx高可用)
- Linux:在已安装nginx情况下安装nginx模块
- linux下nginx安装
- Linux 安装 nginx注意
- linux nginx轻量级服务器 - 安装篇
- linux 安装nginx
- linux 安装了memcache模块,phpinfo加载不了 & Nginx和PHP-FPM的启动/重启脚本
- linux 下安装nginx
- linux系统下nginx安装目录和nginx.conf配置文件目录
- Linux下Tomcat+Nginx服务器环境安装配置的简明教程
- linux下nginx安装
- linux安装nginx
- linux下怎么安装nginx
- Linux下Nginx安装/启动/重启/停止
- linux下安装nginx服务器