资源描述:
《tomcat-centos安装以及部署指南》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、第一步:环境准备1.安装JDK,我安装的是:jdk1.6.0_35;安装路径位于/opt目录下,用root权限进行安装,为了方便管理,后续的软件均安装在/opt目录下;2.下载tomcat安装包,我下载的版本是:apache-tomcat-6.0.35.tar.gz3.为提升性能,安装APR:ApachePortableRuntime(APR)basedNativelibraryforTomcat:APRsupportrequiresthreemainnativecomponentstobeinstalle
2、d:·APRlibrary·JNIwrappersforAPRusedbyTomcat(libtcnative)·OpenSSLlibraries系统安装openssl库没问题,但在centos下系统安装apr时,安装路径有时不在一个目录下,会导致native库无法编译,因此有时需要手动安装apr,apr-util;从apache网站下载apr,apr-util等源码包,解压至/opt目录下;apr-1.4.6apr-util-1.4.1先安装APR:./configure--prefix=/opt/apr
3、;makemakeinstall;安装apr-util:./configure--with-apr=/opt/apr--prefix=/opt/apr;makemakeinstall;设置环境变量:LD_LIBRARY_PATH=/opt/apr/lib:$LD_LIBRARY_PATHexportLD_LIBRARY_PATH如不设置环境变量,后续启动tomcat时,会报告找不到apr库的错误;安装native:./configure--with-apr=/opt/apr--prefix=/opt/apr
4、make;makeinstall;设置动态库路径:libtool--finish/opt/apr/lib1.不需要修改配置文件,直接启动tomcat,如果发现如下信息提示,则表示tomcatapr安装成功;2012-9-2811:35:25org.apache.catalina.core.AprLifecycleListenerinit信息:LoadedAPRbasedApacheTomcatNativelibrary1.1.22.2012-9-2811:35:25org.apache.catalina.c
5、ore.AprLifecycleListenerinit信息:APRcapabilities:IPv6[true],sendfile[true],acceptfilters[false],random[true].2012-9-2811:35:25org.apache.coyote.http11.Http11AprProtocolinit信息:InitializingCoyoteHTTP/1.1onhttp-80801.APR的相关设置可以参考:http://tomcat.apache.org/tomcat
6、-6.0-doc/apr.html#APR_Connectors_ConfigurationWhenAPRisenabled,theHTTPconnectorwillusesendfileforhandlinglargestaticfiles(allsuchfileswillbesentasynchronouslyusinghighperformancekernellevelcalls),andwilluseasocketpollerforkeepalive,increasingscalabilityoft
7、heserver.WhenAPRisenabled,theHTTPSconnectorwilluseasocketpollerforkeepalive,increasingscalabilityoftheserver.ItalsousesOpenSSL,whichmaybemoreoptimizedthanJSSEdependingontheprocessorbeingused,andcanbecomplementedwithmanycommercialacceleratorcomponents.Unlik
8、etheHTTPconnector,theHTTPSconnectorcannotusesendfiletooptimizestaticfileprocessing.WhenAPRisenabled,theAJPconnectorwilluseasocketpollerforkeepalive,increasingscalabilityoftheserver.AsAJPisdesignedaroundapoolo