Linux Nginx安装
来源:互联网 发布:centos 7 安装desktop 编辑:程序博客网 时间:2024/06/05 20:00
Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器.其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。下面就来说明一下它的安装步骤。
1、下载压缩包
http://nginx.org/
2、上传到Linux
我是使用rz/sz命令把下载好的压缩包上传到目录.
/carl/data/program/
创建nginx的安装目录,与源码目录区分开。
/carl/data/program/nginx
3、解压nginx
tar -zxvf nginx-1.10.3.tar.gz
然后
cd nginx-1.10.3
4、安装nginx
安装nginx到指定目录,就也就第二步创建的目录。
./configure --prefix=/carl/data/program/nginx
注意:可能出现以下错误。‘
1)缺少gcc
checking for OS + Linux 3.10.0-327.el7.x86_64 x86_64checking for C compiler ... not found./configure: error: C compiler cc is not found
使用下面命令安装
yum -y install make gcc gcc-c++ ncurses-devel
2)缺少pcre
./configure: error: the HTTP rewrite module requires the PCRE library.You can either disable the module by using --without-http_rewrite_moduleoption, or install the PCRE library into the system, or build the PCRE librarystatically from the source with nginx by using --with-pcre=<path> option.
使用下面命令安装
yum install -y pcre-devel
3)缺少zlib
./configure: error: the HTTP gzip module requires the zlib library.
使用以下命令安装:
yum -y install zlib zlib-devel
5、编译
make&&make install
6、启动Nginx
/carl/data/program/nginx/sbin/nginx [-c nginx.conf]
访问虚拟机地址:
7、nginx命令总结
1) 启动命令
NGINX_HOME/sbin/nginx -c nginx.conf
2) 停止服务
NGINX_HOME/sbin/nginx -s stop
3) 检验配置文件语法格式
NGINX_HOME/sbin/nginx -t
4) 重要加载配置文件
NGINX_HOME/sbin/ -s reload
0 0
- nginx--linux下安装nginx
- linux 下nginx安装
- nginx-linux安装说明
- Linux下安装Nginx
- linux nginx svn 安装
- 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
- Ubuntu使用源安装jdk以及jdk切换
- 数字三角形:顺推法(一维数组)
- 车牌号
- background-position的详细用法
- 在myeclipse中编辑javascript脚本时增加提示功能
- Linux Nginx安装
- hdu 4374 One hundred layer (DP+单调队列)@
- 《哲学家们都干了些什么》读书笔记
- 有序数列中找特定数
- 《effective c++》条款二:尽量以enum,const,inline替换#define
- 第七章-更加抽象——python基础教程(第二版)笔记
- 未完成题目
- 八卦基督教和穆斯林(转)
- python3 ORM重难点