1、第一步:获取nginx的安装包

wget http://nginx.org/download/nginx-1.7.8.tar.gz

2、解压安装包
tar -xvf nginx-1.7.8.tar.gz

3、执行./configure --prefix=/usr/local/nginx命令报如下错误

报错:./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

解决之法:
yum -y install pcre-devel

4、执行./configure --prefix=/usr/local/nginx命令报如下错误

报错:./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.

解决之法:
yum -y install pcre-devel openssl openssl-devel

5、执行如下命令:
./configure --prefix=/usr/local/nginx

6、执行如下命令:
make

7、执行如下命令:
make install

8、启动nginx

启动代码格式:nginx安装目录地址 -c nginx配置文件地址

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

9、访问nginx

curl nginx所在后台的IP地址:端口(默认80)

eg:

表示nginx安装成功

10、强制停止nginx

pkill -9 nginx

11、更改nginx的端口

修改配置文件路径:/usr/local/nginx/conf/nginx.conf

修改为你需要的端口:

重启nginx生效

12、同一linux后台安装多个nginx服务

1)重复步骤5

./configure --prefix=/usr/local/nginx2

ps:prefix必须指定新的nginx安装目录

2)执行:make && make install

3)修改配置文件如下3个地方

(1)赋予root权限,在nginx.conf开头增加如下内容:

(2)修改访问端口

(3)修改访问路径

4)启动nginx

/conf/nginx.conf

linux系统下安装nginx的更多相关文章

  1. 在Linux系统下安装nginx教程

    最近学习了nginx,就打算nginx安装在Linux系统下,于是我就把安装步骤记录下来了,分享给大家,希望能对大家有帮助! 我的博客地址:https://www.cnblogs.com/themys ...

  2. tony_nginx_01_如何在linux系统下安装nginx、pcre、zlib、openssl工具

    nginx可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g++ 开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译环 ...

  3. linux/centos下安装nginx(rpm安装和源码安装)详细步骤

    Centos下安装nginx rpm包                                                                                 ...

  4. 在Linux系统下安装大于mysql5.5版本的数据库

    linux下mysql 5.5的安装方法: 1.安装所需要系统库相关库文件      gcc等开发包,在安装linux系统的时候安装. 2.创建mysql安装目录 # mkdir -p /usr/lo ...

  5. Linux 系统下安装 rz/sz 命令及使用说明

    Linux 系统下安装 rz/sz 命令及使用说明 rz/sz命令,实现将本地的文件上传到服务器或者从服务器上下载文件到本地,但是很多Linux系统初始并没有这两个命令,以下为安装和使用的具体步骤: ...

  6. Linux 系统下安装 python-skimage

    Linux 系统下安装 python-skimage 安装必须的依赖 // python-mumpy // python-scipy // python-matplotlib $ sudo apt-g ...

  7. Linux系统下安装Redis和Redis集群配置

    Linux系统下安装Redis和Redis集群配置 一. 下载.安装.配置环境: 1.1.>官网下载地址: https://redis.io/download (本人下载的是3.2.8版本:re ...

  8. Linux系统下安装Gitlab

    Linux系统下安装Gitlab 一.简介 GitLab是利用 Ruby on Rails 一个开源的版本管理系统,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目.它拥有与 ...

  9. 在虚拟机的Linux系统下安装wineqq

    |   版权声明:本文为博主原创文章,未经博主允许不得转载. 本文参考教程:http://www.ubuntukylin.com/ukylin/forum.php?mod=viewthread& ...

随机推荐

  1. 『编程题全队』Alpha阶段发布说明

    1. 这一版本的功能 (1)管理个人的任务事项,管理用户的提醒事项,提供一个简洁的操作界面,将其分类为全部.今天.明日.最近七天.更远.还有已完成,方便用户进行事务管理和整理. (2)提供一个便捷的备 ...

  2. 部分机器进入bios 的 方法

  3. 2013长春网赛1005 hdu 4763 Theme Section(kmp应用)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4763 题意:给出一个字符串,问能不能在该串的前中后部找到相同的子串,输出最长的字串的长度. 分析:km ...

  4. linux课外命令

    1.要知道linux是多少位的 在命令行输入 getconf LONG_BIT 返回32就是32位,返回64就是64位的. 2.CentOS-7-x86_64-DVD-1708.iso 这种代表64位 ...

  5. MT【172】内外圆

    $P,Q$是两个定点,M为平面内一个动点,且$\dfrac{|MP|}{|MQ|}=\lambda(\lambda>0,\lambda\ne1)$, 点M的轨迹围成的区域面积为S , 设$S=f ...

  6. MT【111】画图估计

    评:此类方程是超越方程,一般情况下无法解出具体的解,常见手段:1.画图  2.猜根.此处可以取特殊值a=2.5,b=3.5,容易知道此时$x=2.5\in(2,3)$

  7. CRM 常用SQL 脚本

    1. 查询角色.用户 SELECT DISTINCT DomainName,        u.FullName ,         u.FirstName,         u.InternalEM ...

  8. 【转】SPI总线协议

    SPI总线协议 By Xiaomin | April 17, 2016| 技术 概述 SPI(Serial Peripheral Interface)总线是主要应用于嵌入式系统内部通信的串行同步传输总 ...

  9. POJ 3436 ACM Computer Factory (网络流,最大流)

    POJ 3436 ACM Computer Factory (网络流,最大流) Description As you know, all the computers used for ACM cont ...

  10. easyui form 提交问题,纠结了很久,有点诡异

    http://www.iteye.com/problems/131602 form 提交,后台运行有时慢,页面就不等后台数据的响应,直接alert("服务器维护中,请稍后再试!") ...