`
qiuzhifeng
  • 浏览: 2340 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Ubuntu: Installing Apache Portable Runtime (APR) for Tomcat

阅读更多
After reading “Introducing Apache Tomcat 6″ presentation by Mladen Turk I decided to enable Apache Portable Runtime (APR) native library for Tomcat. It was supposed to be as easy as

view sourceprint?
1.sudo ./configure
2.sudo make
3.sudo make install

but as you may guess, it was a little bit more than that.

1. Installing Apache APR.

“Most Linux distributions will ship packages for APR” – those of Linode don’t, I had a barebone Ubuntu 10.10 box without even "gcc" and "make", let alone Apache APR. Thanks God, networking was not an issue, unlike last time.

view sourceprint?1.wget http://apache.spd.co.il//apr/apr-1.4.2.tar.gz
2.tar -xzf apr-1.4.2.tar.gz
3.rm apr-1.4.2.tar.gz
4.cd apr-1.4.2/
5.sudo apt-get install make
6.sudo ./configure
7.sudo make
8.sudo make install


2. Installing Tomcat Native.

view sourceprint?
1.wget http://off.co.il/apache//tomcat/tomcat-connectors/native/1.1.20/source/tomcat-native-1.1.20-src.tar.gz
2.tar -xzf tomcat-native-1.1.20-src.tar.gz
3.rm tomcat-native-1.1.20-src.tar.gz
4.cd tomcat-native-1.1.20-src/jni/native
5.sudo ./configure --with-apr=/usr/local/apr

The result was

view sourceprint?
1.checking build system type... x86_64-unknown-linux-gnu
2...
3.checking for APR... yes
4...
5.checking for JDK location (please wait)... checking Try to guess JDK location...
6.configure: error: can't locate a valid JDK location

Ouch! "Can't locate a valid JDK location"? On my machine?

view sourceprint?
1.$ which java
2./home/user/java/jdk/bin/java
3.$ echo $JAVA_HOME
4./home/user/java/jdk
5.$ java -version
6.java version "1.6.0_24"
7.Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
8.Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)

But for some reason "tomcat-native-1.1.20-src/jni/native/configure" script didn’t see my "JAVA_HOME" variable no matter what and even installing "sun-java6-jdk" didn’t help much. After patching the "configure" script to dump locations it was looking for “valid JDK” I had:

view sourceprint?
01...
02.configure: [/usr/local/1.6.1]
03.configure: [/usr/local/IBMJava2-1.6.0]
04.configure: [/usr/local/java1.6.0]
05.configure: [/usr/local/java-1.6.0]
06.configure: [/usr/local/jdk1.6.0]
07.configure: [/usr/local/jdk-1.6.0]
08.configure: [/usr/local/1.6.0]
09.configure: [/usr/local/IBMJava2-1.6]
10.configure: [/usr/local/java1.6]
11.configure: [/usr/local/java-1.6]
12.configure: [/usr/local/jdk1.6]
13.configure: [/usr/local/jdk-1.6]
14...

Ok then, here you have it now:

view sourceprint?
1.sudo ln -s ~/java/jdk/ /usr/local/jdk-1.6
2.sudo ./configure --with-apr=/usr/local/apr
3.sudo make
4.sudo make install

And with

view sourceprint?
1...
2.export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
3...

I now had a beautiful log message in "catalina.out":

view sourceprint?
1...
2.Mar 7, 2011 11:51:02 PM org.apache.catalina.core.AprLifecycleListener init
3.INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
4.Mar 7, 2011 11:51:02 PM org.apache.catalina.core.AprLifecycleListener init
5.INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
6.Mar 7, 2011 11:51:03 PM org.apache.coyote.AbstractProtocolHandler init
7...

s soon as "evgeny-goldin.org" moves to its new location on the brand-new Linode box it will benefit from this performance optimization. I’ll describe the migration process and reasons for it a bit later, once it is done.

From http://evgeny-goldin.com/blog/ubuntu-installing-apr-tomcat/
原文地址:http://java.dzone.com/articles/ubuntu-installing-apache
分享到:
评论

相关推荐

    linux subversion以及依赖的apche apr

    这个压缩包包含Subversion的源代码以及其依赖的Apache Portable Runtime (APR) 和 APR Util库,还有SQLite数据库引擎的集成代码。 Apache Portable Runtime (APR) 是一个C语言库,它是Apache HTTP服务器项目的基础...

    tomcat 环境配置及问题处理

    - `Installing the service ‘Tomcat6’……..` - `Using CATALINA_HOME: “D:\Program Files\Tomcat”` - `Using CATALINA_BASE: “D:\Program Files\Tomcat”` - `Using JAVA_HOME: “D:\Program Files\Java\...

    Exam Ref 70-410: Installing and Configuring Windows Server 2012 R2

    Fully updated for Windows Server 2012 R2! Prepare for Microsoft Exam 70-410 – and help demonstrate your real-world mastery of implementing and configuring core services in Windows Server 2012 R2. ...

    Ubuntu The Complete Reference

    - **Installation Options**: Explanation of the different methods for installing Ubuntu, such as live CD/DVD, USB drive, or virtual machines. Instructions for creating bootable media are provided. - **...

    Learning Apache Karaf

    Learning Apache Karaf will benefit all Java developers and system administrators who need to develop for and/or operate Karaf’s OSGi-based runtime. Basic knowledge of Java is assumed. Table of ...

    linux环境Tomcat安装配置手册

    本手册旨在指导用户在 Linux 环境中安装和配置 Tomcat 服务器, step-by-stepguiding users through the process of installing and configuring Tomcat on a Linux environment. 知识点一:下载和安装 Tomcat 在...

    Apache.Maven.Cookbook.1785286129

    You will start off by successfully installing Apache Maven on your favorite OS, and then you will create your first working project. Furthermore, the book walks you through setting up and using Maven...

    Installing And Configuring Windows Server 2012 Exam Ref 70-410

    根据提供的文件信息,本书《Installing and Configuring Windows Server 2012 Exam Ref 70-410》是一本针对Microsoft认证考试70-410的专业辅导教材。本书由Craig Zacker编写,并由Microsoft Press出版。以下是本书中...

    tomcat排错经典案例之404.docx

    log4j:WARN No appenders could be found for logger (org.apache.mons.digester.Digester). log4j:WARN Please initialize the log4j system properly. 2009-11-06 21:39:17 org.apache.catalina.core....

    [原创]Guide: Installing Oracle Enterprise Manager Grid Control 10.2.0.5 on Oracle Database 11gR2 and RHEL Linux 5.4

    ### 安装Oracle Enterprise Manager Grid Control 10.2.0.5于Oracle Database 11gR2及RHEL Linux 5.4环境指南 #### 概述 本指南详细介绍了如何在Red Hat Enterprise Linux (RHEL) 5.4上安装并配置Oracle Enterprise...

    Failed to install Tomcat6 service(Tomcat6安装失败解决方法)

    3. **移除服务**:确保没有名为“Tomcat5”或者“Apache Tomcat 5”的服务残留在系统服务列表中。 - 使用命令行工具 `sc query tomcat5` 查看是否存在Tomcat5服务。 - 如果存在,则使用 `sc delete tomcat5` 删除...

    Installing TensorFlow for Java

    文件列表如下: Installing TensorFlow for Java _ TensorFlow.pdf; libtensorflow_jni-cpu-windows-x86_64-1.4.1.zip; libtensorflow-1.4.1.jar;

    Beginning.Ubuntu.LTS.Server.Administration.From.Novice.to.Professional.2nd.Edition

    Installing and configuring Ubuntu to ensure secure installations Virtual Ubuntu and LDAP configuration Full network and web services management What you’ll learn Administer, install, and configure ...

    Ubuntu Pocket Guide and Reference: A concise companion for day-to-day Ubuntu use

    ### Ubuntu Pocket Guide and Reference: A Concise Companion for Day-to-Day Ubuntu Use #### Introduction "Ubuntu Pocket Guide and Reference: A Concise Companion for Day-to-Day Ubuntu Use," authored by ...

    apache-tomcat-8.5.34注册服务包.zip

    官方原版一键注册tomcat为windows服务,tomcat8w.exe界面更改tomcat内存大小,开机自启,延迟自启 D:\x\develop\apache-tomcat-8.5.34\bin>service.bat install Installing the service 'Tomcat8' ...

    手动添加Apache服务

    Installing the apache2.2 service The apache2.2 service is successfully installed. ``` 这意味着Apache服务已成功安装到Windows服务列表中。 4. **启动Apache服务**:使用`net start`命令启动Apache服务: ...

    OpenERP Installing Ubuntu9.04

    OpenERP Installing Ubuntu9.04

Global site tag (gtag.js) - Google Analytics