正规的彩票

Nginx Linux安装部署详细教程

 更新时间: 2020年06月23日 14:33:50   转载 作者: taiyonghai  
这篇文章主要介绍了Nginx Linux安装部署详细教程,本文通过图文实例代码相结合给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

一、Nginx简介

nginxshiyigewebzhengguidecaipiaoqiyekeyiyonglaizuofuzaijunhengjifanxiangdailishiyong,muqianshiyongzuiduodejiushifuzaijunheng,jutijianjiezhengguidecaipiaojiubujieshaolebaiduyixiayouhenduo,xiamianzhijiejinruanzhuangbuzhou

二、Nginx安装

1、xiazainginxjixiangguanzujian

正规的彩票linuxxitongshicentos 6.5 64wei,zhengguidecaipiaozhijieqiehuandaorootyonghuxiaanzhuang

jinruyonghumuluxiazaichengxu

xiazaixiangguanzujian

[root@localhost src]# wget http://nginx.org/download/nginx-1.10.2.tar.gz
省略安装内容...
[root@localhost src]# wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz
省略安装内容...
[root@localhost src]# wget http://zlib.net/zlib-1.2.11.tar.gz
省略安装内容...
[root@localhost src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
省略安装内容...

anzhuangc++bianyihuanjing,ruyianzhuangkelveguo

[root@localhost src]# yum install gcc-c++
省略安装内容...
期间会有确认提示输入y回车
Is this ok [y/N]:y
省略安装内容...

正规的彩票2、anzhuangnginxjixiangguanzujian

opensslanzhuang

[root@localhost src]# tar zxvf openssl-fips-2.0.10.tar.gz
省略安装内容...
[root@localhost src]# cd openssl-fips-2.0.10
[root@localhost openssl-fips-2.0.10]# ./config && make && make install
省略安装内容...

pcreanzhuang

[root@localhost src]# tar zxvf pcre-8.40.tar.gz
省略安装内容...
[root@localhost src]# cd pcre-8.40
[root@localhost pcre-8.40]# ./configure && make && make install
省略安装内容...

zlibanzhuang

[root@localhost src]# tar zxvf zlib-1.2.11.tar.gz
省略安装内容...
[root@localhost src]# cd zlib-1.2.11
[root@localhost zlib-1.2.11]# ./configure && make && make install
省略安装内容...

nginxanzhuang

[root@localhost src]# tar zxvf nginx-1.10.2.tar.gz
省略安装内容...
[root@localhost src]# cd nginx-1.10.2
[root@localhost nginx-1.10.2]# ./configure && make && make install
省略安装内容...

3、qidongnginx

正规的彩票xianzhaoyixianginxanzhuangdaoshenmeweizhishangle

正规的彩票jinrunginxmulubingqidong

baocuole,error while loading shared libraries: libpcre.so.1: cannot open shared object file: no such file or directory,anzhaoxiamianfangshijiejue

1.用whereis libpcre.so.1命令找到libpcre.so.1在哪里
2.用ln -s /usr/local/lib/libpcre.so.1 /lib64命令做个软连接就可以了
3.用sbin/nginx启动Nginx
4.用ps -aux | grep nginx查看状态
[root@localhost nginx]# whereis libpcre.so.1[root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64[root@localhost nginx]# sbin/nginx[root@localhost nginx]# ps -aux | grep nginx

jinrulinuxxitongdetuxingjiemian,dakailiulanqishurulocalhosthuikandaoxiatu,shuomingnginxqidongchenggong

nginxdejibencaozuo

启动
[root@localhost ~]# /usr/local/nginx/sbin/nginx
停止/重启
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s stop(quit、reload)
命令帮助
[root@localhost ~]# /usr/local/nginx/sbin/nginx -h
验证配置文件
[root@localhost ~]# /usr/local/nginx/sbin/nginx -t
配置文件
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf

4、jiandanpeizhinginx

正规的彩票dakainginxpeizhiwenjianweiyunginxmuluxiadeconfwenjianjiaxia

jiandanjieshaoyixiavimdeyufa

默认vim打开后是不能录入的,需要按键才能操作,具体如下:
开启编辑: 按“i”或者“Insert”键
退出编辑: “Esc”键
退出vim: “:q”
保存vim: “:w”
保存退出vim: “:wq”
不保存退出vim: “:q!”

"#"daibiaozhushi,zuizhongyaodeshiserver{}kuaizheibufenjiudaibiaomeiyigewebzhandian,xiangxidepeizhijieshaokeyichayuezhengguidecaipiaodelingyipianpeizhiwenzhang,cichuzhengguidecaipiaoxianzanshishezhisangezhandian

fenbieshiyongbutongdeduankou80、81、82baocuntuichubingqiezhongqinginx

5、kaiqiwaiwangfangwen

正规的彩票zailinuxxitongzhongmorenyoufanghuoqiangiptablesguanlizhesuoyoudeduankou,zhiqiyongmorenyuanchenglianjie22duankouqitadouguanbi,zanmenshangmianshezhide80dengdengyeshiguanbide,suoyizhengguidecaipiaoxuyaoxianbayingyongdeduankoukaiqi

fangfayizhijieguanbifanghuoqiang,zheiyangxingnengjiaohao,dananquanxingjiaocha,ruguoyouqianzhifanghuoqiangkeyicaiquzheizhongfangshi

关闭防火墙
[root@localhost ~]# service iptables stop
关闭开机自启动防火墙
[root@localhost ~]# chkconfig iptables off
[root@localhost ~]# chkconfig --list|grep ipt

xiamianshifanghuoqiangdeqitacaozuomingling

正规的彩票fangfaerjiangkaiqideduankoujiarufanghuoqiangbaimingdanzhong,zheizhongfangshijiaoanquandanxingnengyexiangduijiaocha

编辑防火墙白名单
[root@localhost ~]# vim /etc/sysconfig/iptables
增加下面一行代码
-A INPUT -p tcp -m state -- state NEW -m tcp --dport 80 -j ACCEPT
保存退出,重启防火墙
[root@localhost ~]# service iptables restart

linuxpeizhiwanbile,shiyonglingyitaidiannaoerfeianzhuangnginxdediannao,zhengguidecaipiaoshiyongdewindowsxitong,peizhiyixiahostzai“c:\windows\system32\drivers\etc”xiadehostszhongpeizhiyixiayumingzhongdingxiang

10.11.13.22 nginx.test.com nginx.test1.com nginx.test2.com

ranhoucmdzaipingyixiazheigeyumingshifouzhengquezhixianglezheigeipshang

zhengquezhixianghouzaitelnetyixia80duankoukanyixiashifoukeyiyuduankoutongxin(ruguotelnettishimeiyouciminglingshimeiyouanzhuangkehuduan,zaiqiyonghuojinyongwindowsgongnengchuanzhuanghouzaicaozuojike)

正规的彩票dedaoyixiajiemianjidaibiaotongxinchenggong

dakaizheitaiwindowsxitongneideliulanqi,shurunginx.test.comhuidedaoyixiajieguo,jiushuomingwaiwangfangwenchenggong

ruguofanghuoqiangniyiranqiyong,zhishishezhileqiyongduankou,neizhengguidecaipiaofangwen81neigeduankouhuifaxianwufafangwen,yinweizhengguidecaipiaobingmeiyoujiarubaimingdan

daocinginxzhengguidecaipiaoqichuxingbushuwancheng。

6、nginxfuzaijunhengpeizhi

nginxjifanxiangdailihefuzaijunhengyuyishen,zaipeizhiwenjianzhongxiugaipeijiukeyishixian

正规的彩票shouxianzhengguidecaipiaodakaipeizhiwenjian

[root@localhost nginx]# vim conf/nginx.conf

meiyigeserverjiushiyigexunizhuji,zhengguidecaipiaoyouyigedangzuowebzhengguidecaipiaoqilaishiyong

listen 80;代表监听80端口
server_name xxx.com;代表外网访问的域名
location / {};代表一个过滤器,/匹配所有请求,正规的彩票还可以根据自己的情况定义不同的过滤,比如对静态文件js、css、image制定专属过滤
root html;代表站点根目录
index index.html;代表默认主页

zheiyangpeizhiwanbizhengguidecaipiaoshuruyumingjiukeyifangwendaogaizhandianle。

正规的彩票fuzaijunhenggongnengwangwangzaijieshoudaomougeqingqiuhoufenpeidaohouduandeduotaizhengguidecaipiaoqishang,neizhengguidecaipiaojiuxuyaoupstream{}kuailaipeiheshiyong

upstream xxx{};upstream模块是命名一个后端正规的彩票器组,组名必须为后端正规的彩票器站点域名,内部可以写多台正规的彩票器ip和port,还可以设置跳转规则及权重等等
ip_hash;代表使用ip地址方式分配跳转后端正规的彩票器,同一ip请求每次都会访问同一台后端正规的彩票器
server;代表后端正规的彩票器地址

server{};server模块依然是接收外部请求的部分
server_name;代表外网访问域名
location / {};同样代表过滤器,用于制定不同请求的不同操作
proxy_pass;代表后端正规的彩票器组名,此组名必须为后端正规的彩票器站点域名

server_name和upstream{}的组名可以不一致,server_name是外网访问接收请求的域名,upstream{}的组名是跳转后端正规的彩票器时站点访问的域名

peizhiyixiawindowsdehostjiangzhengguidecaipiaoyaofangwendeyumingaaa.test.comzhixianglinux

yinweiyingjianyouxian,zhengguidecaipiaoshijiangwindowszhongdeiiszuoweinginxdehouduanzhengguidecaipiaoqi,suoyipeizhiyixiaiisdezhandianyuming

正规的彩票dakaicmdzaipingyixiaaaa.test.comqueshizhixianglinuxxitongle,zaidakailiulanqishuruaaa.test.comhuixianshibbbzheigezhandianjiudaibiaofuzaichenggongle。

nginxdefuzaigongnengjiupeizhiwanchengle,zheizhishijiandanshezhileyixia,shengchanhuanjingzhonghaiyouhenduoxiangxidediaozheng,houxuzaizhujianzengjia,benrenshuipingyouxian,ruyoubuduizhichuhaiwangzhidaoxiexie。

正规的彩票daocizheipianguanyunginx linuxanzhuangbushuxiangxijiaochengdewenzhangjiujieshaodaozheile,gengduoxiangguannginx linuxanzhuangbushuneirongqingsousuojiaobenzhijiayiqiandewenzhanghuojixuliulanxiamiandezhengguidecaipiaoxiangguandewenzhangxiwangdajiayihouduoduozhichijiaobenzhijia!

正规的彩票相关的文章

最新评论

正规的彩票_正规彩票平台app下载[首页最快线路√] 彩票官网_彩票官网app|网站首页 彩票平台_彩票平台快三-[平台最快线路√] 彩票app下载_彩票app下载官网下载快三_官方入口 彩票平台_彩票平台app-专注彩票门户 彩票官网_彩票官网app下载网址-HOME 彩票平台_彩票平台登录-老品牌最信誉 彩票app_彩票app客户端下载>> 首页 彩票平台_彩票平台免费送彩金18-点击进入>! 彩票平台_彩票平台官网〖2020购彩首选〗 彩票app_彩票app彩票投注平台-Welcome