菜单

Centos配置ARP和Tomcat Native

2018年11月16日 - LINUX

Tomcat
Native是用以Tomcat的一个可选组件,能够允许Tomcat使用一定之本土资源、性能、兼容性。

Tomcat
Native是用于Tomcat的一个可选组件,能够允许Tomcat使用一定之地头资源、性能、兼容性。

具体来说,Tomcat Native给了Tomcat访问 Apache Portable
Runtime(APR)的网络连接实施以及随意数发生器。

具体来说,Tomcat Native给了Tomcat访问 Apache Portable
Runtime(APR)的网络连接实施以及轻易数发生器。

APR连接器的特色:

APR连接器的风味:

实际参考:http://tomcat.apache.org/native-doc/

现实参考:http://tomcat.apache.org/native-doc/

话不多说,直接上教程

话不多说,直接上教程

//配置gcc依赖
yum install gcc

//安装openssl
wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz
tar -zxvf openssl-1.1.0e.tar.gz
cd openssl-1.1.0e
./config --prefix=/usr/local/openssl
make && make install

//安装apr
cd
wget http://mirror.bit.edu.cn/apache//apr/apr-1.5.2.tar.gz
tar -zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install

//安装apr-util
cd
wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
tar -zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

//安装tomcat-native
cd
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-connectors/native/1.2.12/source/tomcat-native-1.2.12-src.tar.gz
tar -zxvf tomcat-native-1.2.12-src.tar.gz
cd tomcat-native-1.2.12-src/native
./configure --with-apr=/usr/local/apr --with-ssl=/usr/local/openssl
make && make install

//配置环境变量
vi /etc/profile
//在末尾添加
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
source /etc/profile

//测试
cat /usr/local/tomcat/logs/catalina.out
//可以看到类似下面的消息即可
[main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-18080"]
INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
org.apache.catalina.core.AprLifecycleListener.init Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.5.0.

//另外server.xml有如下一项默认设置
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
//如果用不到SSL,则需要关闭,on改为off,否则启动时会报错
//配置gcc依赖
yum install gcc

//安装openssl
wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz
tar -zxvf openssl-1.1.0e.tar.gz
cd openssl-1.1.0e
./config --prefix=/usr/local/openssl
make && make install

//安装apr
cd
wget http://mirror.bit.edu.cn/apache//apr/apr-1.5.2.tar.gz
tar -zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install

//安装apr-util
cd
wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
tar -zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

//安装tomcat-native
cd
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-connectors/native/1.2.12/source/tomcat-native-1.2.12-src.tar.gz
tar -zxvf tomcat-native-1.2.12-src.tar.gz
cd tomcat-native-1.2.12-src/native
./configure --with-apr=/usr/local/apr --with-ssl=/usr/local/openssl
make && make install

//配置环境变量
vi /etc/profile
//在末尾添加
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
source /etc/profile

//测试
cat /usr/local/tomcat/logs/catalina.out
//可以看到类似下面的消息即可
[main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-18080"]
INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
org.apache.catalina.core.AprLifecycleListener.init Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.5.0.

//另外server.xml有如下一项默认设置
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
//如果用不到SSL,则需要关闭,on改为off,否则启动时会报错

 

 

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图