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语言开发的高 ...
随机推荐
- nginx的信号量
一.官方文档 https://www.nginx.com/resources/wiki/start/topics/tutorials/commandline/ 二.nginx进程说明 一般在nginx ...
- 【转载】c++指针的指针和指针的引用
https://www.cnblogs.com/li-peng/p/4116349.html
- git for windows 本地仓库
1.安装 先在网上安装好git for windows的程序 在gitbash中输入以下 $ git config --global user.name "Your Name" $ ...
- ORACLE升级PSU&OJVM注意的问题及遇到问题解决思路
[环境介绍] 系统环境:Solaris + Oracle 11R2 + OGG + 脚本定时任务统计信息收集 [背景描述] 基于集团的安全检查,需要对数据库版本进行漏洞扫描,漏洞扫描中存在RBDMS和 ...
- [物理学与PDEs]第1章第9节 Darwin 模型 9.2 Maxwell 方程组的一个定解问题
设 $\Omega$ 为一有界区域, 外部为理想导体 $(\sigma=+\infty)$, 则 $\Omega$ 中电磁场满足 Maxwell 方程组 $$\beex \bea \ve\cfrac{ ...
- mvc 返回一个对象 到视图接收
public ActionResult InfoFrame() { List<Users> list = new List<Users>(); Users user = new ...
- mask rcnn
Mask RCNN Mask RCNN 中主要改进是在faster rcnn中box regression 的branch 上加入mask prediction branch,能够得到点到点的预测. ...
- react中input自动聚焦问题
input自动聚焦问题 在react中可以使用refs解决这个问题,首先看一下refs的使用场景: (1)处理焦点.文本选择或媒体控制. (2)触发强制动画. (3)集成第三方 DOM 库. 使用re ...
- 基于STM32F1的语音合成芯片SYN6288驱动
目录 说明 SYN6288.h SYN6288.c 说明 基于USART2制作,封装了各种通信协议 SYN6288.h #ifndef _SYN6288_H_ #define _SYN6288_H_ ...
- 【汇编语言】Doxbox 0.74 修改窗口大小
1.打开Doxbox安装路径,找到DOXBox 0.74-2 Option.bat,双击打开. 2.找到windowresolution和output,将其值修改为下图中的值. 注意:图中,1280x ...