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语言开发的高 ...
随机推荐
- centos7项目部署
1. 安装nginx 添加CentOS 7 Nginx yum资源库 sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/ng ...
- 学习python笔记 协程
下面将一个经典的消费者和生产者的案例进行分析: import time def consumer(): r = '' while True: n = yield r if not n: return ...
- ADO五大对象
ADO.NET五大对象, 1. Connection:与数据源建立连接. 2. Command:对数据源执行SQL命令并返回结果. 3. DataReader:读取数据源的数据,只允许对将数据源以只 ...
- Django详细流程
一.设计表结构 我们以学生管理系统为例,讲解一下Django的基本操作.首先要设计一下表的结构,这里就不多解释 班级表结构: 表名:grades 字段:班级名称 gname 成立时间 gdate 女生 ...
- JSON 之 SuperObject(11): TSuperTableString、TSuperAvlEntry
JSON 之 SuperObject(11): TSuperTableString.TSuperAvlEntry - 万一 - 博客园http://www.cnblogs.com/del/archiv ...
- javascript基础 之 保留关键字
1,保留关键字 意思是:特定的字符串要么是已经有指代了要么是未来将要有指代,所以取名字不要用保留关键字里的字符串 js保留关键字 abstract arguments boolean break by ...
- Java 自定义hashmap和hashtable的key注意哪些问题
- 解决ajax跨域的办法,代理,cors,jsonp
1.使用php做代理去请求第三方api接口 php是可以跨域的,我们利用ajax请求本域名中的php文件,php再去请求第三方接口文件,从而达到跨域目的. php做代理请求: ajax请求本域名php ...
- linux 安装telnet命令及使用
一.CentOS下查看系统是否已安装telnetrpm -qa | grep telnettelnet-0.17-48.el6.x86_64telnet-server-0.17-48.el6.x86_ ...
- git命令之git remote的用法
git remote git remote -v git init git add xxx git commit -m 'xxx' git remote add origin ssh://softw ...