日期:2014-05-16  浏览次数:20763 次

Linux下apache与jk模块的安装
1 安装apache-2.2.10
下载安装文件httpd-2.2.10.tar.gz;
在后台管理服务器、接口应用服务器上安装apache-2.2.10,apache安装目录:/usr/local/apache2,安装过程如下:
# tar xzvf /usr/software/portal/httpd-2.2.10.tar.gz
# cd httpd-2.2.0
# ./configure --prefix=/usr/local/apache2 --enable-so
# make
# make install
3、 apache配置
? 进入apache主目录下conf目录,在“ServerRoot "/usr/local/apache2"”下添加以下内容:
StartServers       50
MinSpareServers   15
MaxSpareServers   30
MaxClients       225
MaxRequestsPerChild  4000
Apache启动、停止
配置完成后,进入apache主目录下的bin目录,在命令提示符后输入“./apachectl start”启动apache服务,输入“./apachectl stop”停止apache服务;
当确信Apache已经安装成功并处于运行状态之后,就可以直接打开浏览器,在地址栏输入"http://服务器IP"(服务器名)的格式,就可以调出你的第一个Apache页面。

2安装jk模块(整合apache与tomcat)
下载安装文件,下载地址:http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.27/mod_jk-1.2.27-httpd-2.2.10.so;
将mod_jk-1.2.27-httpd-2.2.10.so改名为“mod_jk.so”,拷贝到/usr/local/apache2/modules目录下;
在/usr/local/apache2/conf目录下增加workers.properties文件,内容如下:
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
修改apache的配置文件httpd.conf,增加以下内容:
LoadModule  jk_module modules/mod_jk.so
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /usr/local/apache2/conf/workers.properties"
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile     "/usr/local/apache2/logs/mod_jk.shm"
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile     "/usr/local/apache2/logs/mod_jk.log"
# Set the jk log level [debug/error/info]
JkLogLevel    info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /*  worker1
JkUnMount  /file/upload/* worker1
在后台管理服务器的/data/apache/下新建图片应用服务目录webapps/file/upload,修改/usr/local/apache2/conf下httpd.conf文件,将所有/usr/local/apache2/htdocs替换为/data/apache/webapps。