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语言开发的高 ...
随机推荐
- 启动多个logstash脚本
一台服务器上启动多个logstash脚本 # more logstash_click #!/bin/sh # Init script for logstash # Maintained by Elas ...
- JVM调优命令-jhat
jhat JVM Heap Analysis Tool命令是与jmap搭配使用,用来分析jmap生成的dump,jhat内置了一个微型的HTTP/HTML服务器,生成dump的分析结果后,可以在浏览器 ...
- jQuery使用(十一):jQuery实例遍历与索引
each() children() index() 一.jQuery实例遍历方法each() jQuery实例上的each()方法规定要运行的函数,并且给函数传入两个参数:index,element. ...
- Typora使用说明(记录总结)
目录 区域元素 YAML FONT Matters 菜单 段落 标题 引注 序列 可选序列 代码块 数学块 表格 脚注 水平线 特征元素 链接 超链接 内链接 相关链 URLs 图片 斜体 加粗 删除 ...
- 【cpp】chap 8
1.输出“输入的内容” // basic file operations #include <iostream> #include <fstream> #include < ...
- .net使用Aspose.Words进行Word替换操作的实现代码
DLL文件下载 示例: Aspose.Words.Document doc = new Aspose.Words.Document(TempFile); Aspose.Words.DocumentBu ...
- UE4材质特别属生记录
tangent space normal 切线空间法线 材质默认使用的切线空间法线,可切换为对象空间法线(彩色贴图) Separate Translucency 单独半透明 允许半透明被渲染到一个单独 ...
- DQL、DML、DDL、DCL区别
DQL(data query language)数据查询语言 主要是由SELECT构成的查询语句 基本语法:select 字段名 from 表名 where 查询条件 DML(data manipul ...
- 【原创】大叔问题定位分享(13)HBase Region频繁下线
问题现象:hive执行sql报错 select count(*) from test_hive_table; 报错 Error: java.io.IOException: org.apache.had ...
- Kafka简单使用
前言 这几天在写 shell 脚本,学到不少,但是没啥心得之类的,有空可以写个总结(但是大概率不会发表) 现在不算很忙,想再学一点 消息队列相关知识 目前比较出名的也就 RabbitMQ 和 Kafk ...