Tomcat的运行模式有3种.修改他们的运行模式.3种模式的运行是否成功,可以看他的启动控制台,或者启动日志.或者登录他们的默认页面http://localhost:8080/查看其中的服务器状态。
三、出错情况处理
3.1、启动tomcat时报“The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/apr/lib”
解决方案:确保tomcat-native安装成功,否则执行上面2.5,如果依旧不成功,请执行下面步骤
#vi /opt/tomcat_api_8035/bin/catalina.sh
CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
3.2、安装apr时报‘Neither the JAVA_HOME nor the JRE_HOME environment variable is defined“
解决方案:这是未设置环境JAVA_HOME与JAVA_JRE目录,请确保安装jdk成功,确认/etc/profile环境变量配置正确
3.3、在执行sysctl -p的时候发现输出出现以下错误
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
原因:上面有3个参数依赖于bridge模块,该模块如果没有加载则会现上面的输出错误
解决方案:执行modprobe bridge命令,加载bridge模块
(转)Linux下配置tomcat+apr+native应对高并发
原文:https://www.cnblogs.com/wangshuyang/p/8984788.html