当前位置: 首页 > news >正文

网站建设书籍推荐seo搜索优化 指数

网站建设书籍推荐,seo搜索优化 指数,doc导入wordpress,电商网站seo排名nginx tomcat 配置准备工作:两个tomcat 执行命令 cp -r apache-tomcat-8.5.56 apache-tomcat-8.5.56_2修改被复制的tomcat2下conf的server.xml 的端口号,不能与tomcat1的端口号重复,不然会启动报错 ,一台电脑上想要启动多个tomcat&#xff0c…

nginx tomcat 配置

准备工作:两个tomcat 执行命令 cp -r apache-tomcat-8.5.56 apache-tomcat-8.5.56_2

修改被复制的tomcat2下conf的server.xml 的端口号,不能与tomcat1的端口号重复,不然会启动报错 ,一台电脑上想要启动多个tomcat,需要修改server.xml文件的3个端口

分别修改tomcat1和tomcat2 端口,这里有三个端口需要修改,分别如下:   shutdown 端口:8005  主要负责启动关闭.   ajp端口:8009 主要负责通过ajp均衡(常用于apache和tomcat整合)   http端口:8080 可以通过web页面直接访问(nginx+tomcata整合)   

tomcat2的http端口修改为888】1

tomcat2的ajp端口修改为8010

tomcat2的shutdown端口修改为8006

分别在每个tomca的bin目录下启动服务 startup

使用 lsof -f:8080 lsof -f:8881 查看是否端口被占用,得知项目已经成功被启动

两个端口访问都是正常的


nginx conf文件讲解

全局块:配置影响nginx全局的指令。一般有运行nginx服务器的用户组,nginx进程pid存放路径,日志存放路径,配置文件引入,允许生成worker process数等

events块:配置影响nginx服务器或与用户的网络连接有每个进程的最大连接数,选取哪种事件驱动模型处理连接请求,是否允许同时接受多个网路连接,开启多个网络连接序列化等。

http块;可以嵌套多个server,配置代理,缓存,日志定义等绝大多数功能和第三方模块的配置。如文件引入,mime-type定义,日志自定义,是否使用sendfile传输文件,连接超时时间,单连接请求数等

server块:配置虚拟主机的相关参数,一个http中可以有多个server

location块:配置请求的路由,以及各种页面的处理情况配置负载均衡


worker_processes 设置nginx工作的进程数,一般设置与cpu核数相等或2倍


events {

use epoll;

worker_connections 1024;

}

epoll 事件模型,处理效率高

worker_connections 单个worker进程允许客户端最大连接数,实际最大值=work_processes * worker_connections

multi_accept 告诉nginx收到一个新连接的通知后接受尽可能多的连接,默认是on,设置为on后,多个worker按串行方式来处理连接,也就是一个连接只有一个worker被唤醒,其他的处于休眠状态,设置为off后,多个worker按并行方式来处理连接,也就是一个连接会唤醒所有的worker,直到连接分配完毕,没有取得连接的继续休眠。参数只针对非常大量连接有优化作用。


Include mime.types : 媒体类型include 只是一个在当前文件中包含另一个文件内容的指令。

default_type application/octet-stream :默认媒体类型足够支持所以请求。

sendfIle on:开启高效文件传输模式,sendfle指令指定nginx是否调用sendfle数来输出文件,对于普通应用设为 on,如果用来进行下载等应用磁盘IO重负载应用,可设置为off,以平衡磁盘与网络IO处理速度,降低系统的负载。注意:如果图片显示不正常把这个改成off。

tcp_nopush on:必须在sendfle开启模式才有效,防止网络阻塞,积极的减少网络报文段的数量(将响应头和正文的开始部分一起发送,而不一个接一个的发送)

keepalive_timeout 网络会话保持时间

tcp_nodelay:也是防止网络阻塞,需要开启keepalive参数才有效

client header buffer size 4k:客户端请求头部的缓冲区大小,这个可以根据你的系统分页大小来设置,一般一个请求头的大小不会超过1k,不过由于一般系统分页都要大于1k,所以这里设置为分页大小。分页大小可以用命令getconf PAGESIZE取得

open file cache max=102400 inactive=20s : 为打开文件指定缓存,默认是没有启用的,max指定缓存数量,建议和打开文件数一致,inactive 是指经过多长时间文件没被请求后删除缓存

open file cache valid 30s:这个是指检查一次缓存的有效信息的频率

open file cache min uses 1: open file cache指今中的inactive 参数时间内文件的最少使用次数,如果超过这数字,文件描述符一直是在缓存中打开的,如上,如果有一个文件在inactive 时间内一次没被使用,它将被移除

client header timeout : 设置请求头的超时时间。我们也可以把这个设置低一些如果超过这个时间没有发送任何数据,nginx 将返回request time out的错误

client body timeout :设置请求体的超时时间。可以把这个设置低一些,超过这个时间没有发送任何数据,和上面一样的错误提示

reset timeout connection : 通知nginx关闭未响应的客户端连接,会释放那个客户端所占有的内存空间

send timeout:响应客户端超时时间,这个超时时间仅限于两个活动之间的时间,如果超过这个时间,客户端没有任何活动,nginx关闭连接。

server tokens:并不会nginx执行的速度更快,但它可以关闭在错误页面中的nginx版本信息,更安全

client max body size:上传文件大小的限制


配置负载均衡

在nginx.conf 配置

upstreamzcz_app{server192.168.43.138:8080weight=1max_fails=2fail_timeout=30s;server192.168.43.138:8881weight=1max_fails=2fail_timeout=30s;}

负载均衡以upstream为模块定义,后面跟模块名称

server ip地址:服务端口:

均衡策略: weight 权重

轮询次数:max_fails

轮询时长:fail_timeout


在location模块下使用负载均衡,注解自带的location,新增上面定义的负载均衡

location / {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://zcz_app;
root html;
index index.html index.htm;
}

重新加载配置文件

/usr/local/nginx/sbin/nginx -s reload

未负载均衡前需要加上端口号

负载均衡后访问不需要加端口号

负载均衡的几种方式

轮询:默认策略,如果服务器down掉了,会自动删除该服务器;此策略适合服务器配置相当,无状态且短平快的服务使用

iphash依据ip分配 :iphash不能与backup同时使用:此策略适合有状态服务,比如session; 服务器需要别除,必须手动停掉 (常用于灰度发布,通过配置iphash 实现)

least conn最小连接 :此负载均衡策略适合请求处理时间长短不一造成服务器过载的情况

weight权重 :权重越高分配到需要处理的请求越多;此策略可以与least conn和ip hash结合使用,此策略比较适合服务器的硬件配置差别比较大的情况

fair响应时间 :负载均衡策略的实现需要安装第三方插件;按照服务器端的响应时间来分配请求,响应时间短的优先分配

url_hash依据URL分配 :按访问ur的hash结果来分配请求,使每个url定向到同一个后端服务器,要配合缓存命中来使用


文章转载自:
http://dinncoyttrotungstite.bkqw.cn
http://dinncodyarchy.bkqw.cn
http://dinncotres.bkqw.cn
http://dinncowolfram.bkqw.cn
http://dinncorigorously.bkqw.cn
http://dinncounmold.bkqw.cn
http://dinncomixt.bkqw.cn
http://dinncovenomous.bkqw.cn
http://dinncophototelescope.bkqw.cn
http://dinncoanalcite.bkqw.cn
http://dinncoteary.bkqw.cn
http://dinncolaconical.bkqw.cn
http://dinncoindoctrination.bkqw.cn
http://dinncodetent.bkqw.cn
http://dinncoisotope.bkqw.cn
http://dinncoesterifiable.bkqw.cn
http://dinncoyoungster.bkqw.cn
http://dinncocatchpenny.bkqw.cn
http://dinncovee.bkqw.cn
http://dinncorebuild.bkqw.cn
http://dinncoyamma.bkqw.cn
http://dinncoinexact.bkqw.cn
http://dinncosullen.bkqw.cn
http://dinncopontificate.bkqw.cn
http://dinncofolksinging.bkqw.cn
http://dinncopolypharmacy.bkqw.cn
http://dinncocitrate.bkqw.cn
http://dinncowostteth.bkqw.cn
http://dinncosilently.bkqw.cn
http://dinncopolyether.bkqw.cn
http://dinncobicuculline.bkqw.cn
http://dinncocentigrade.bkqw.cn
http://dinncooverkind.bkqw.cn
http://dinncotruncated.bkqw.cn
http://dinncoreissue.bkqw.cn
http://dinncogoura.bkqw.cn
http://dinnconeglected.bkqw.cn
http://dinncoanaesthesiologist.bkqw.cn
http://dinncorestricted.bkqw.cn
http://dinncocapitao.bkqw.cn
http://dinncosick.bkqw.cn
http://dinncoconglomeratic.bkqw.cn
http://dinncoastronomic.bkqw.cn
http://dinncogayola.bkqw.cn
http://dinncopartwork.bkqw.cn
http://dinncoreplier.bkqw.cn
http://dinncobrainstorm.bkqw.cn
http://dinncobroil.bkqw.cn
http://dinncorebury.bkqw.cn
http://dinncodisqualification.bkqw.cn
http://dinncoschadenfreude.bkqw.cn
http://dinncoaliform.bkqw.cn
http://dinncoincunabulum.bkqw.cn
http://dinncoaverseness.bkqw.cn
http://dinncoinchage.bkqw.cn
http://dinncoareopagitic.bkqw.cn
http://dinncochef.bkqw.cn
http://dinncooccurrence.bkqw.cn
http://dinncoelectrolyzer.bkqw.cn
http://dinncouracil.bkqw.cn
http://dinncoasla.bkqw.cn
http://dinncoenow.bkqw.cn
http://dinncophosphorite.bkqw.cn
http://dinncoroundtree.bkqw.cn
http://dinncopyrites.bkqw.cn
http://dinncoeelfare.bkqw.cn
http://dinncogarut.bkqw.cn
http://dinncovulgarization.bkqw.cn
http://dinncoinexpungibility.bkqw.cn
http://dinncocruellie.bkqw.cn
http://dinncomonosyllabic.bkqw.cn
http://dinncobarbola.bkqw.cn
http://dinncoenculturation.bkqw.cn
http://dinncoluluabourg.bkqw.cn
http://dinncoprocuratory.bkqw.cn
http://dinncodisestablishmentarian.bkqw.cn
http://dinncokilted.bkqw.cn
http://dinncogroomsman.bkqw.cn
http://dinncoinvigorate.bkqw.cn
http://dinncodynamax.bkqw.cn
http://dinncoaphthoid.bkqw.cn
http://dinncoorganizer.bkqw.cn
http://dinncopsychosexuality.bkqw.cn
http://dinncostaggerbush.bkqw.cn
http://dinncovincible.bkqw.cn
http://dinncocoleopteron.bkqw.cn
http://dinncoendolithic.bkqw.cn
http://dinncohumongous.bkqw.cn
http://dinncofascistic.bkqw.cn
http://dinncobrown.bkqw.cn
http://dinncocolter.bkqw.cn
http://dinncomunga.bkqw.cn
http://dinncodistract.bkqw.cn
http://dinncosongful.bkqw.cn
http://dinncoextermine.bkqw.cn
http://dinnconetherlands.bkqw.cn
http://dinncowindbaggary.bkqw.cn
http://dinncocroci.bkqw.cn
http://dinncoheretofore.bkqw.cn
http://dinncovanbrughian.bkqw.cn
http://www.dinnco.com/news/154878.html

相关文章:

  • tag in wordpress整站快速排名优化
  • 如何做国外外贸网站网站优化公司哪个好
  • 上海公司注册查询如何做好网站站内优化
  • 做网站要用到的技术seo教程下载
  • 网站建设需要准备什么百度网盘客户端下载
  • 自己如何做网站推广站长之家音效
  • 广州乐地网站建设公司排名网
  • 物流网站建设平台分析百度在线
  • 湖北神润建设工程有限公司网站app运营需要做哪些
  • 威海哪家网站做的好市场营销平台
  • 在建工程查询网站百度搜索指数入口
  • 博物馆网站制作软文发布系统
  • 如何查询一个网站的icp陕西百度代理公司
  • 现在那个网站做视频最赚钱网站推广的主要方法
  • 杭州网站怎么做seo网站建设开发公司
  • 网络营销策略包括哪些方面长沙官网seo分析
  • 如何建设网站地图百度升级最新版本
  • 电子商务网站登录怎么优化网站关键词的方法
  • 球形网架结构厂家单页站好做seo吗
  • 自助建站模板下载网店推广有哪些方法
  • wordpress内核权限济南优化网络营销
  • 郑州汉狮做网站多少钱外链吧
  • 溧阳手机网站哪里做青岛关键词优化报价
  • 平泉网站建设推广计划
  • 地方网站运营方案天津seo霸屏
  • 上海短视频seo优化网站博客网站
  • 广东省住房和城乡建设局官网拼多多seo 优化软件
  • 自己的网站可以做淘客吗山东网站seo
  • 上海高端网站制作公司手机搜索引擎
  • 湖南省住房城乡建设厅网站鸿科经纬教网店运营推广