centos7安装nginx-1.13.6 新手入门,图文解析
系统环境
操作系统:64位CentOS Linux release 7.2.1511 (Core)
安装nginx依赖包
[root@localhost ~]# yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl—devel
必须要安装,时间可能有点久。
下载nginx
下载地址:http://nginx.org/en/download.html
下载最新的nginx-1.13.6(写笔记时,这个版本是最新的),下载好之后,在centos系统中创建/soft目录
[root@localhost ~]# mkdir /soft
利用工具WinSCP,将下载好的nginx包拷贝到centos下的/soft目录
解压nginx
[root@localhost ~]# cd /soft
[root@localhost soft]# tar -zxvf nginx-1.13.6.tar.gz
编译和安装nginx
[root@localhost soft]# cd nginx-1.13.6/
[root@localhost nginx-1.13.6]# ./configure --prefix=/usr/local/nginx
指定安装在/usr/local/nginx目录下,不指定也没关系,默认就是这个目录。
[root@localhost nginx-1.13.6]# make && make install
查看nginx版本号:
[root@localhost ~]# cd /usr/local/nginx/sbin/
[root@localhost sbin]# ./nginx -h
开启80端口
[root@localhost conf]# firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@localhost conf]# firewall-cmd --reload
启动和停止nginx
启动
[root@localhost sbin]# ./nginx
停止
[root@localhost sbin]# ./nginx -s stop
重启
[root@localhost sbin]# ./nginx -s reload
浏览
在浏览器地址栏输入http://192.168.1.100/
参考网址
https://www.cnblogs.com/lxg0/p/6979274.html
简单配置
下面这段配置是最最最简单的负载均衡配置,文件名nginx_fzjh.conf,只要在我们启动nginx的时候,指定这个配置文件就行了([root@localhost sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx_fzjh.conf)
worker_processes 4;
events{
worker_connections 1024;
} http{
server {
listen 80;
server_name myserver; location / {
proxy_pass http://mysite;
}
} upstream mysite {
#ip_hash;
server 10.101.56.52:80;# weight=5;
server 10.101.56.52:8089;# weight=3;
#server x.x.x.x:80 weight=1;
}
}
只看不回复,诅咒你钉钉0.0000000001厘米。
centos7安装nginx-1.13.6 新手入门,图文解析的更多相关文章
- centos7安装kafka_2.11-1.0.0 新手入门
系统环境 1.操作系统:64位CentOS Linux release 7.2.1511 (Core) 2.jdk版本:1.8.0_121 3.zookeeper版本:zookeeper-3.4.9. ...
- linux(centos7) 安装nginx
linux(centos7) 安装nginx 1.14(stable) 版本 Nginx配置文件常见结构的从外到内依次是「http」「server」「location」等等,缺省的继承关系是从外到内, ...
- 【Nginx安装】CentOS7安装Nginx及配置
[Nginx安装]CentOS7安装Nginx及配置 2018年03月05日 11:07:21 阅读数:7073 Nginx是一款轻量级的网页服务器.反向代理服务器.相较于Apache.lighttp ...
- VMware虚拟机中的CentOS7安装Nginx后本机无法访问的解决办法
VMware虚拟机中的CentOS7安装Nginx后本机无法访问的解决办法 在linux上安装nginx 请参考:Linux Centos7 安装 nginx 在虚拟机centos7上安装nginx之 ...
- 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 S ...
- centos7安装nginx的两种方法
第一种方式:通过yum安装 直接通过 yum install nginx 肯定是不行的,因为yum没有nginx,所以首先把 nginx 的源加入 yum 中 运行下面的命令: 1.将nginx放到y ...
- CentOS7 安装Nginx+MySQL
首先我们需要安装nginx的yum源 [root@AD ~]# rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-releas ...
- (转)AIX7.1安装Nginx 1.13的方法
原文:https://blog.csdn.net/lvshaorong/article/details/79401860 https://blog.csdn.net/lvshaorong/articl ...
- Centos7安装Nginx实战
一.背景 最近在写一些自己的项目,用到了nginx,所以自己动手来在Centos7上安装nginx,以下是安装步骤. 二.基本概念以及应用场景 1.什么是nginx Nginx是一款使用C语言开发的高 ...
随机推荐
- flyway和liquibase的使用样例
在代码上我们有svn和git等诸多的版本控制方法. 但是在数据库上却没有相应的工具.一度导致多环境见的数据库同步难以维持. flyway和liquibase都是常见的数据库版本控制工具. flyway ...
- 第二节. SignalR开篇以及如何指定传输协议
一. 声明 该节主要介绍SignalR的一些理论知识,代码量很小,在后续章节编写中,会不断回来更新该节,完善该节的介绍:待该系列结束时,该节会和目录章节合并. 下面的理论介绍相对枯燥,但对于后面的理解 ...
- [物理学与PDEs]第3章第2节 磁流体力学方程组 2.3 磁流体力学方程组
1. 磁流体力学方程组 $$\beex \bea \cfrac{\p {\bf H}}{\p t} &-\rot({\bf u}\times{\bf H})=\cfrac{1}{\sigma ...
- EffectiveC++ 第2章 构造/析构/赋值运算
我根据自己的理解,对原文的精华部分进行了提炼,并在一些难以理解的地方加上了自己的"可能比较准确"的「翻译」. Chapter 2 构造 / 析构 / 赋值 条款 05:了解C++ ...
- vue中使用swiper-slide时,循环轮播失效?
前言 vue 项目中使用时,组件swiper-slide 如果用v-for循环的话,loop:true 就不能无缝轮播,每次轮播到最后一张就停止了??? 正文 代码如下: <swiper :op ...
- Django REST Framework API Guide 08
1.Filtering 2.Pagination FIltering GenericAPIView的子类筛选queryset的简单方法是重写.get_quueryset()方法. 1.根据当前用户进行 ...
- Kotlin 检查空类型
Kotlin 会检查你定义的非空类型 如果运行过程中被赋空值了 会直接crash
- eclipse下classes文件夹无法发布到tomcat的问题--tomcat发布慢的问题
=== 解决eclipse下classes文件夹无法发布到tomcat的问题_Nautilus_新浪博客http://blog.sina.com.cn/s/blog_484d8777010130n5. ...
- 【原创】大数据基础之Spark(3)Spark Thrift实现原理及代码实现
spark 2.1.1 一 启动命令 启动spark thrift命令 $SPARK_HOME/sbin/start-thriftserver.sh 然后会执行 org.apache.spark.de ...
- yapi部署
官方提供了两种安装方式,由于环境或者权限问题可能会遇到不少麻烦 最简单的安装方式: 第一种方式 npm install -g yapi-cli --registry https://registry. ...