Centos7 下nginx nginx-1.13.4 安装
环境:CentOS Linux release 7.3.1611 (Core) Linux localhost.localdomain 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
一. 依赖包安装
yum -y install gcc automake autoconf libtool make gcc gcc-c++
二. 下载相关软件包到/usr/local/src/ 目录下并安装
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
# 依赖pcre库是因为nginx的rewrite重写需要
wget https://zlib.net/fossils/zlib-1.2.11.tar.gz
#安装zlib库是因为gzip 模块需要
wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
#安装opensssl库是因为nginx的ssl服务依赖,安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及SSL协议。
wget http://nginx.org/download/nginx-1.13.4.tar.gz
#nginx新版本的包 (稳定版)
cd pcre-8.38
./configure
make && make install
cd ..
#pcre库编译安装
cd openssl-1.0.1t
./configure
make && make install
cd ..
##openssl编译安装
cd zlib-1.2.11
./configure
make && make install
cd ..
#zlib库编译安装
cd nginx-1.13.4
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.38 --with-zlib=/usr/local/src/zlib-1.2.11 --with-openssl=/usr/local/src/openssl-1.0.1t
make && make install
#nginx编译安装
/*
注意如果make报错或者./configure报错应该是少了上面的依赖库,
或者你本机的依赖库版本问题,请安装较新的库。
*/
安装完成后配置文件如下:
[root@localhost nginx-1.13.4]# ll /usr/local/nginx/
total 8084
-rw-r--r-- 1 root root 1077 Aug 14 23:02 fastcgi.conf
-rw-r--r-- 1 root root 1077 Aug 14 23:02 fastcgi.conf.default
-rw-r--r-- 1 root root 1007 Aug 14 23:02 fastcgi_params
-rw-r--r-- 1 root root 1007 Aug 14 23:02 fastcgi_params.default
drwxr-xr-x 2 root root 40 Aug 14 23:02 html
-rw-r--r-- 1 root root 2837 Aug 14 23:02 koi-utf
-rw-r--r-- 1 root root 2223 Aug 14 23:02 koi-win
drwxr-xr-x 2 root root 6 Aug 14 23:02 logs
-rw-r--r-- 1 root root 3957 Aug 14 23:02 mime.types
-rw-r--r-- 1 root root 3957 Aug 14 23:02 mime.types.default
-rwxr-xr-x 1 root root 8215208 Aug 14 23:02 nginx
-rw-r--r-- 1 root root 2656 Aug 14 23:02 nginx.conf
-rw-r--r-- 1 root root 2656 Aug 14 23:02 nginx.conf.default
-rw-r--r-- 1 root root 636 Aug 14 23:02 scgi_params
-rw-r--r-- 1 root root 636 Aug 14 23:02 scgi_params.default
-rw-r--r-- 1 root root 664 Aug 14 23:02 uwsgi_params
-rw-r--r-- 1 root root 664 Aug 14 23:02 uwsgi_params.default
-rw-r--r-- 1 root root 3610 Aug 14 23:02 win-utf
[root@localhost nginx-1.13.4]#
我习惯把默认配置文件放到etc下,不更改也一样。
[root@localhost nginx]# cd /usr/local/nginx/
[root@localhost nginx]# mkdir /etc/nginx
[root@localhost nginx]# cp * /etc/nginx/
三.启动Nginx 并测试
[root@localhost nginx]# /usr/local/nginx/nginx -c /etc/nginx/nginx.conf
[root@localhost nginx]# ps -ef|grep nginx
root 52723 1 0 23:13 ? 00:00:00 nginx: master process /usr/local/nginx/nginx -c /etc/nginx/nginx.conf
nobody 52724 52723 0 23:13 ? 00:00:00 nginx: worker process
root 52726 19602 0 23:13 pts/0 00:00:00 grep --color=auto nginx
[root@localhost nginx]#
测试之前请关闭centos7的防火墙,这个防火墙真的很烦,限制了很多东西。。
[root@localhost nginx]# systemctl stop firewalld.service
[root@localhost nginx]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@localhost nginx]#
输入ip访问~

Centos7 下nginx nginx-1.13.4 安装的更多相关文章
- CentOS7下搭建Nginx+PHP7的安装配置
一.安装编译工具及库文件: yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel 环境要求 nginx是C ...
- CentOS7 下使用 Nginx
update: 2019-03-25 --新增新装 Nginx 的启动.重启.关闭和查看 2019-02-19 --新增 yum 方式快速简单安装 Nginx 2018-09-29 --新增配置文件对 ...
- Linux系统:centos7下搭建Nginx和FastDFS文件管理中间件
本文源码:GitHub·点这里 || GitEE·点这里 一.FastDFS简介 1.基础概念 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件上传 ...
- centos7下部署nginx与php
背景介绍 相信读者在看这篇文章之前已经fastcgi,php-fpm有所了解.大概来讲php语言需要fastcgi程序,即php解释器解释,而php解释器需要php-fpm管理器进行调度. 以下对CG ...
- centos7 下 apache nginx squid https正向代理 代理服务器
apache yum install httpd mod_ssl -y vim /etc/httpd/conf.d/ssl.conf Listen https <VirtualHost *:&g ...
- centos7下采用Nginx+uwsgi来部署django
之前写过采用Apache和mod_wsgi部署django,因为项目需要,并且想比较一下Nginx和Apache的性能,尝试采用Nginx+uwsgi的模式来部署django. 1.安装uwsgi以及 ...
- 在centos7下搭建nginx环境,并配置负载均衡,最终能达到通过域名直接访问的目的
1.关于nginx:个人理解的nginx它的主要用途就是负载均衡,当然可能还有其他一些功能可能我们不长用到,我们通过nginx可以干什么呢?为什么要引入它呢?原因是当有高并发访问服务器时,服务器可能会 ...
- centos7下搭建nginx+php7.1+mariadb+memcached+redis
一.环境准备 1.首先介绍一下环境,以及我们今天的主角们 我用的环境是最小化安装的centos7,mariadb(江湖传言mysql被oracle收购后,人们担心像java一样毁在oracle手上于是 ...
- centos7 下通过nginx+uwsgi部署django应用
1. 安装python3.6 1. 获取 wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz tar -xzvf Python- ...
- centos7下使用mysql离线安装包安装mysql5.7
服务器环境: centos7 x64 需要安装mysql5.7+ 一.卸载CentOS7系统自带mariadb # 查看系统自带的Mariadb [root@CDH-141 ~]# rpm -qa|g ...
随机推荐
- Eclipse中html/js/jsp代码的自动联想
1.打开eclipse→Windows→Preferences→Java→Editor→Content Assist 修改Auto Activation triggers for java的值为:.a ...
- laravel form 表单提交
form表单需要加token,不然会出现419错误,csrf_token不用自己生成,放进去就行,laravel自己会生成 路由: 控制器生成一个:
- asp.net在一般处理程序里面操作Session
1.要在一般处理程序中获取其他页面的session值,需要引用名空间: using System.Web.SessionState; 2.然后继承一个接口:IRequiresSessionState ...
- 【C】switch-case里面,加或不加break的区别
int test; test = ; switch(test) { : test++; printf("value = 0"); // 打印printf,后续没有break代码,系 ...
- 第8天 Java基础语法
第8天 Java基础语法 今日内容介绍 Eclipse开发工具 超市库存管理系统 Eclipse开发工具 Eclipse是功能强大Java集成开发工具.它可以极大地提升我们的开发效率.可以自动编译,检 ...
- react--基本用法
1.安装了babel 但是终端执行 babel src --out-dir build命令时说"babel:command is not found" 经百度,找到solution ...
- 成都Uber优步司机奖励政策(4月2、3日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- 9、Java ConcurrentModificationException异常原因和解决方法
Java ConcurrentModificationException异常原因和解决方法 在前面一篇文章中提到,对Vector.ArrayList在迭代的时候如果同时对其进行修改就会抛出java.u ...
- dubbo之main启动
一.dubbo的main启动在使用上面会简单的多,但是需要做一些简单的配置. dubbo.spring.config=classpath*:META-INF/spring/*.xml 备注:这个是默认 ...
- Android 模拟器 下载、编译及调试
Android 模拟器源码下载 Android 模拟器源码的下载与 Android AOSP 源码库的下载过程类似,可以参考 Google 官方提供的 Android 源码下载文档 来了解这个过程. ...