本站用于记录日常工作内容,虚拟化云计算,系统运维,数据库DBA,网络与安全。
之前安装过NTP相关的RPM软件包,正在使用中,由于版本低,有漏洞现在要升级到最新版本,可以直接停服务,再下载相关NTP4.2.8p13.tar.gz源码包,执行下面命令安装,最后启动服务。[root@webserver opt]#   service ntpd stop [root@webserver opt]#  yum install libcap-devel[root@webserver opt]# tar zxvf ntp-4.2.8p13.tar.gz[root@webserver opt]]  cd ntp-4.2.8p13[root@webserver opt]#  ./configure CFLAGS="-O2 -g -fPIC"  --prefix=/usr --bindir=/usr/sbin --sysconfdir=/etc --enable-linuxcaps --with-lineeditlibs=readline --docdir=/usr/share/doc/ntp-4.2.8p13[root@webserver opt]#  make[root@webserver opt]#  make install && install -v -o ntp -g ntp -d /var/lib/ntp[root@webserver opt]# /etc/init.d/ntpd start正在启动 ntpd:                                        &...
系统:debian 9 64位。过程:1.apt install kexec-tools # 安装 kexec 热内核切换工具2.wget http://cdn-fastly.deb.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux # 下载 debian9 的网络安装文件3.wget http://cdn-fastly.deb.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz # 下载 debian9 的网络安装文件4.wget https://github.com/fincham/kexec-remote-debian-install/raw/master/build.py # 下载脚本,制作自动安装配置文件5.vi build.py # 增加ntfs模块,ntfs-3g-udeb ntfs-3g-udeb ntfs-modules-4.9.0-9-amd64-di fuse-modules-4.9.0-9-amd64-di6.chmod +x build.py # 增加执行权限7../build.py initrd.gz enp0s20f0 144.172.126.32 255.255.255.0 144.172.126.1 8.8.8.8 # 假设网卡名是enp0s20f0(如有的网卡名是eno1),设置静态网络信息8.kexec --command-line="auto=true priority=critical mirror/http/hostname=deb.debian.org" --initrd=initrd.gz linux # 热切换到网络安装的内核上9.ssh installer@144.172.126.3...
How to change Tomcat manager default path ?tomcat7默认访问管理web地址是 8080/manager,不怎么安全,需要修改下地址。我这里就修改成 hbctmanager,需要新建个配置文件 hbctmanager.xml 放到/tomcat7/conf/Catalina/localhost/hbctmanager.xml 内容也很简单,将webapps下的manager目录文件移动到/tomcat7/hbctmanager再添加配置文件<Context path="/hbctmanager" docBase="/tomcat/tomcat7/hbctmanager" antiResourceLocking="false" privileged="true" /> 最后重新tomcat7,测试访问地址,可以正常访问,原来的目录删除掉。By default, Tomcat’s manager webapp is able to access via yourapp:8080/manager. It is a good practice to change the default /manager to something else, to avoid potential brute force attack.Environment Tomcat 7 (apt-get install)Debian 7.51. SolutionThis article show you how to change / rename the default manager webapp path from “/manager” to “/manager123”.# Tomcat manager webapp /usr/share/tomcat7-admin/manager # Tomcat conf mana...
概述:企业应用中nginx+tomcat是当前主流架构之一,当网站访问量很大的时候一台nginx代理多台tomcat来实现负载均衡是一个比较理想的解决方案,那如何保持会话呢?(也就是当一个链接访问A服务器时,刷新浏览器链接跳转到B服务器,而不会使页面失效呢?)解决方案: 1、会话粘性(session sticky),又分为基于源ip和cookie 2种方式 基于源ip(source_ip)在不同的调度器上又不同的实现方式: nginx : ip_hash lvs : sh算法 haproxy:source cookie: nginx : hash haproxy:cookie 2、会话群集(session cluster)tomcat自带的session manager 3、会话服务 (session server) 第三方redis(store),memcached(cache)环境:nginx+tomcat一台nginx :192.168.2.198一台tomcat1+mem:192.168.2.197一台tomcat2+mem:192.168.2.199一、2台Tomcat配置java环境及发布目录1、jdk安装rpm -ivh jdk-8u151-linux-x64.rpm 如图:2、t...
Logger输出中文乱码问题困扰着,在weblogic103.6环境下不存在这个问题。打开Tomcat安装目录,下面的bin目录。 修改catalina.sh文件,第229行。修改时,记得先备份该文件,以如万一!原有的: if [ -z "$LOGGING_MANAGER" ]; then  LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"fi 修改为: if [ -z "$LOGGING_MANAGER" ]; then   JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dfile.encoding=UTF8 -Dsun.jnu.encoding=UTF8"else   JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Dfile.encoding=UTF8 -Dsun.jnu.encoding=UTF8"fi 
Tomcat有三种运营模式:bio、nio、apr,不同模式下Tomcat的运行效率差别比较大。一、bio(blockingIO)阻塞式IO,Tomcat6及以前版本默认运行模式,性能非常低下,没有经过任何优化处理。二、nio(noblocking IO)非阻塞式IO,Tomcat7以后的版本默认运行模式,利用java异步IO技术使Tomcat运行性能有所提升。    <Connector port="8080" protocol="HTTP/1.1"                   connectionTimeout="20000"                   redirectPort="8543" />如果要在Tomcat6开启NIO模式,直接修改server.xml里的Connector节点,修改protocol为 org.apache.coyote.http11.Http11NioProtocol,启动生效。    <Connector port="8080"                protocol="org.apache.coyote.http11.Http11NioProtocol"  &nbs...
weblogic下java程序占用cpu过高的问题排查  1、cpu使用情况如图:2、执行命令 :jstack 126624 > cpu1112.log   (注意执行此命令时的用户需为执行进程的用户,所以此处需要用weblogic用户)若执行此命令报错:Unable to open socket file: target process not responding or HotSpot VM not loadedThe -F option can be used when the target process is not responding请查看:http://blog.51cto.com/zhangshaoxiong/13101663、top -p 126624 -H 查看占用cpu最高的线程:可以看到pid为70498 70815 70500 的线程占用cpu都很高 4、接着查看cpu的日志,里面会有126624这个进程下面每个线程的栈信息,但是是十六进制显示的,所以先把70498 70815 70500 转换成16进制 [root@pubserver1 ~]# printf "%0x\n" 70498 11362其他两个就不一一展示了5、在cpu日志里找PID=11362的线程 日志如下:"[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'" #94 daemon prio=5 os_prio=0 tid=0x00007f9f58002000 nid=0x11362 in Object.wait() [0x00007f9ecd8eb000] java.lang.Thread.State: ...
 
0

Tomcat配置参数详解

发表者:admin分类:应用服务2019-07-25 09:37:06 阅读[1322]
下面是tomcat-8.5.37原生server.xml配置,删除了所有自有注释Connector主要属性:    protocol  监听的协议,默认是http/1.1    port   连接端口号    minThread  初始化线程数    maxThread  最大线程数,生产配置800-1000    minSpareThreads="100" 最大空闲线程    enableLookups="false"  如果为true,则可以通过调用request.getRemoteHost()进行DNS查询来得到远程客户端的实际主机名,若为false则不进行DNS查询,而是返回其ip地址,生产环境建议设置false    redirectPort  指定服务器正在处理http请求时收到了一个SSL传输请求后重定向的端口号    acceptCount="800"  指定当所有可以使用的处理请求的线程数都被使用时,可以放到处理队列中的请求数,超过这个数的请求将不予处理,相当于多线程的队列    connectionTimeout  指定超时的时间数(以毫秒为单位)    SSLEnabled  是否开启 sll 验证,在Https 访问时需要开启&nbs...
 
0

Tomcat安全配置参考

发表者:admin分类:应用服务2019-07-25 09:35:34 阅读[1364]
Tomcat安全配置参考0x01 基本配置1 删除默认目录     安装完tomcat后,删除$CATALINA_HOME/webapps下默认的所有目录文件  rm -rf /srv/apache-tomcat/webapps/2 隐藏tomcat版本信息修改$CATALINA_HOME/conf/server.xml,在Connector节点添加server字段,示例如下<Connector port="8080" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443" />               server="WVS1.1"    <!-- A "Connector" using the shared thread pool-->3 自定义错误页面修改tomcat/ conf/web.xml,自定义40x、50x等容错页面,防止信息泄露。(1)配置tomcat/conf/web.xml文件:在最后</web-app>一行之前加入以下内容:<error-page> <error-code>404</error-code><location>/noFile.htm</location> </error-page>……………<error-page><exception-t...
simple-Log_v1.7程序使用ueditor编译器,pre标签内容显示异常一、问题复现只要是带<>标签的,在pre中都会被转码,变成&lt;和&gt;。保存后在文章页中显示正常,但当再次编辑的时候,这些标签就会被过滤掉。二、解决方案先把文章内容放在一个不可见的div里面,原来的textarea里别放内容了12<textarea id="contentEditer" name="content" rows="15" placeholder="请输入内容"></textarea><div class="layui-hide" id="content">${(theme.content)!""}</div>然后初始化UEditor1234567var ue = UE.getEditor('contentEditer', {    initialFrameHeight: 400}); ue.ready(function () {    ue.setContent($("#content").html());  //赋值给UEditor});通过这样的多一步骤,pre中的内容就能正常显示了,而且不影响文章保存。修改代码如下:D:\yjvpscom\includes\ueditor\third-party\SyntaxHighlighter\shcore.jsvar XRegExp;//&...
    总共47页,当前第14页 | 页数:
  1. 4
  2. 5
  3. 6
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13
  11. 14
  12. 15
  13. 16
  14. 17
  15. 18
  16. 19
  17. 20
  18. 21
  19. 22
  20. 23
  21. 24