Install mod_jk for Apache on RHEL5U10
对于那些需要解析JSP/Servlet的Apache来说,mod_jk是必须的。
它是Apache服务器的一个可插入模块,作为Apache与Tomcat的连接器,为Apache提供处理JSP/Servlet的能力。同时,它还具有集群与负载均衡的特性。
本文介绍如何在RHEL5U10上安装mod_jk,而开始本文之前,你已经具有安装完好的Apache HTTP服务器、Tomcat服务器。
Linux中的Apache HTTP的安装非常简单:
配置好YUM之后,执行“yum install httpd”即可完成HTTPD的安装。
Linux中,Tomcat的安装:http://d-prototype.com/archives/86
下面开始mod_jk的部署。
——————————————————————
本文采用源码包编译的方式安装mod_jk。
首先,你需要登陆mod_jk的官方网站,Downoad mod_jk的源码包。
The Apache Tomcat Connector(mod_jk):http://tomcat.apache.org/connectors-doc/
下载链接:http://tomcat.apache.org/download-connectors.cgi
Link is: http://mirror.bit.edu.cn/apache/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.40-src.tar.gz
上传下载好的介质到服务器:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@mindserver ~]# cd /software [root@mindserver software]# ll total 246840 -rw-r--r-- 1 root root 12334990 Jul 7 08:30 Discuz_X3.2_SC_UTF8.zip -rw-r--r-- 1 root root 2618452 Jul 12 16:52 h5ai-0.25.2.zip drwxr-xr-x 2 501 games 4096 Jul 5 17:33 iRedMail-0.8.7 -rw-r--r-- 1 root root 808960 Jul 5 17:31 iRedMail-0.8.7.tar drwxr-xr-x 2 root root 4096 Jul 15 14:15 JBOSS_Cluster drwxr-xr-x 2 nobody nfsnobody 4096 Jul 7 13:53 owncloud -rw-r--r-- 1 root root 99686400 Jul 7 13:52 owncloud-6.0.4.tar -rw-r--r-- 1 root root 1526449 Jul 18 10:03 tomcat-connectors-1.2.40-src.tar.gz -rw-r--r-- 1 root root 6871839 Jul 5 16:29 wordpress-3.9-zh_CN.zip -rwxr-xr-x 1 root root 128613473 Jul 5 16:23 xampp-linux-x64-1.8.3-4-installer.run [root@mindserver software]# |
(Software is: tomcat-connectors-1.2.40-src.tar.gz)
为操作系统打上C编译器:gcc
Command is: yum intall gcc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
[root@mindserver native]# yum install -y gcc (... ...etc) checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. [root@mindserver native]# yum install -y gcc Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package gcc.x86_64 0:4.1.2-54.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved =================================================================================================================== Package Arch Version Repository Size =================================================================================================================== Installing: gcc x86_64 4.1.2-54.el5 Server 5.3 M Transaction Summary =================================================================================================================== Install 1 Package(s) Upgrade 0 Package(s) Total download size: 5.3 M Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : gcc 1/1 Installed: gcc.x86_64 0:4.1.2-54.el5 Complete! [root@mindserver native]# [root@mindserver software]# rpm -qa | grep --color ^gcc gcc-4.1.2-54.el5 [root@mindserver software]# [root@mindserver software]# rpm -ql gcc-4.1.2-54.el5 /usr/bin/c89 /usr/bin/c99 /usr/bin/cc /usr/bin/gcc /usr/bin/gcov /usr/bin/protoize /usr/bin/unprotoize /usr/bin/x86_64-redhat-linux-gcc /usr/lib/gcc /usr/lib/gcc/x86_64-redhat-linux /usr/lib/gcc/x86_64-redhat-linux/4.1.1 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/crtbegin.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/crtbeginS.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/crtbeginT.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/crtfastmath.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libgcc.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libgcc_eh.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libgcc_s.so /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libgcov.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libgomp.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libgomp.so /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libmudflap.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libmudflap.so /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libmudflapth.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libmudflapth.so /usr/lib/gcc/x86_64-redhat-linux/4.1.1/SYSCALLS.c.X /usr/lib/gcc/x86_64-redhat-linux/4.1.1/crtbegin.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/crtbeginS.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/crtbeginT.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/crtfastmath.o /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/README /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/ammintrin.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/bmmintrin.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/emmintrin.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/float.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/iso646.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/limits.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/mm3dnow.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/mm_malloc.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/mmintrin-common.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/mmintrin.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/omp.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/pmmintrin.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/stdarg.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/stdbool.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/stddef.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/syslimits.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/tmmintrin.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/unwind.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/varargs.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/xmmintrin.h /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgcc.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgcc_eh.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgcc_s.so /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgcov.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgomp.a /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgomp.so /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgomp.spec /usr/lib/gcc/x86_64-redhat-linux/4.1.2 /usr/libexec/gcc /usr/libexec/gcc/x86_64-redhat-linux /usr/libexec/gcc/x86_64-redhat-linux/4.1.1 /usr/libexec/gcc/x86_64-redhat-linux/4.1.1/collect2 /usr/libexec/gcc/x86_64-redhat-linux/4.1.2 /usr/libexec/getconf /usr/libexec/getconf/default /usr/share/doc/gcc-4.1.2 /usr/share/doc/gcc-4.1.2/COPYING /usr/share/doc/gcc-4.1.2/COPYING.LIB /usr/share/doc/gcc-4.1.2/ChangeLog-1997.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-1998.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-1999.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-2000.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-2001.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-2002.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-2003.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-2004.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog-2005.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog.gomp.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog.lib.bz2 /usr/share/doc/gcc-4.1.2/ChangeLog.tree-ssa.bz2 /usr/share/doc/gcc-4.1.2/README.Portability /usr/share/info/gcc.info.gz /usr/share/info/gccinstall.info.gz /usr/share/info/gccint.info.gz /usr/share/locale/be/LC_MESSAGES/gcc.mo /usr/share/locale/ca/LC_MESSAGES/gcc.mo /usr/share/locale/da/LC_MESSAGES/gcc.mo /usr/share/locale/de/LC_MESSAGES/gcc.mo /usr/share/locale/el/LC_MESSAGES/gcc.mo /usr/share/locale/es/LC_MESSAGES/gcc.mo /usr/share/locale/fr/LC_MESSAGES/gcc.mo /usr/share/locale/ja/LC_MESSAGES/gcc.mo /usr/share/locale/nl/LC_MESSAGES/gcc.mo /usr/share/locale/ru/LC_MESSAGES/gcc.mo /usr/share/locale/rw/LC_MESSAGES/gcc.mo /usr/share/locale/sr/LC_MESSAGES/gcc.mo /usr/share/locale/sv/LC_MESSAGES/gcc.mo /usr/share/locale/tr/LC_MESSAGES/gcc.mo /usr/share/locale/zh_CN/LC_MESSAGES/gcc.mo /usr/share/locale/zh_TW/LC_MESSAGES/gcc.mo /usr/share/man/man1/gcc.1.gz /usr/share/man/man1/gcov.1.gz /usr/share/man/man1/protoize.1.gz /usr/share/man/man1/unprotoize.1.gz [root@mindserver software]# [root@lab software]# gcc --version gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@lab software]# |
然后,解压mod_jk的安装介质:
Command is: tar -xzvf tomcat-connectors-1.2.40-src.tar.gz
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
[root@mindserver software]# ls tomcat-connectors-1.2.40-src conf docs HOWTO-RELEASE.txt jkstatus LICENSE native NOTICE README.txt support tools xdocs [root@mindserver software]# tree tomcat-connectors-1.2.40-src tomcat-connectors-1.2.40-src |-- HOWTO-RELEASE.txt |-- LICENSE |-- NOTICE |-- README.txt |-- conf | |-- httpd-jk.conf | |-- uriworkermap.properties | |-- workers.properties | `-- workers.properties.minimal |-- docs | |-- ajp | | |-- ajpv13a.html | | |-- ajpv13ext.html | | `-- printer | | |-- ajpv13a.html | | `-- ajpv13ext.html | |-- generic_howto | | |-- loadbalancers.html | | |-- printer | | | |-- loadbalancers.html | | | |-- proxy.html | | | |-- quick.html | | | |-- timeouts.html | | | `-- workers.html | | |-- proxy.html | | |-- quick.html | | |-- timeouts.html | | `-- workers.html | |-- images | | |-- add.gif | | |-- code.gif | | |-- design.gif | | |-- docs.gif | | |-- fix.gif | | |-- jakarta-logo.gif | | |-- printer.gif | | |-- tomcat.gif | | |-- update.gif | | `-- void.gif | |-- index.html | |-- miscellaneous | | |-- changelog.html | | |-- doccontrib.html | | |-- faq.html | | |-- jkstatustasks.html | | |-- printer | | | |-- changelog.html | | | |-- doccontrib.html | | | |-- faq.html | | | |-- jkstatustasks.html | | | `-- reporttools.html | | `-- reporttools.html | |-- news | | |-- 20041100.html | | |-- 20050101.html | | |-- 20060101.html | | |-- 20070301.html | | |-- 20081001.html | | |-- 20090301.html | | |-- 20100101.html | | |-- 20110701.html | | |-- 20120301.html | | |-- 20140201.html | | `-- printer | | |-- 20041100.html | | |-- 20050101.html | | |-- 20060101.html | | |-- 20070301.html | | |-- 20081001.html | | |-- 20090301.html | | |-- 20100101.html | | |-- 20110701.html | | |-- 20120301.html | | `-- 20140201.html | |-- printer | | `-- index.html | |-- reference | | |-- apache.html | | |-- iis.html | | |-- printer | | | |-- apache.html | | | |-- iis.html | | | |-- status.html | | | |-- uriworkermap.html | | | `-- workers.html | | |-- status.html | | |-- uriworkermap.html | | `-- workers.html | |-- style.css | `-- webserver_howto | |-- apache.html | |-- iis.html | |-- nes.html | `-- printer | |-- apache.html | |-- iis.html | `-- nes.html |-- jkstatus | |-- build.properties.default | |-- build.xml | |-- conf | | `-- jkstatus-tasks.xml | |-- example | | |-- jkstatus.properties.default | | |-- jkstatus.xml | | |-- show.txt | | `-- show.xml | |-- src | | `-- share | | `-- org | | `-- apache | | `-- jk | | `-- status | | |-- AbstractJkStatusTask.java | | |-- JkBalancer.java | | |-- JkBalancerMapping.java | | |-- JkBalancerMember.java | | |-- JkResult.java | | |-- JkServer.java | | |-- JkSoftware.java | | |-- JkStatus.java | | |-- JkStatusAccessor.java | | |-- JkStatusParser.java | | |-- JkStatusResetTask.java | | |-- JkStatusTask.java | | |-- JkStatusUpdateLoadbalancerTask.java | | |-- JkStatusUpdateTask.java | | |-- JkStatusUpdateWorkerTask.java | | |-- LocalStrings.properties | | |-- antlib.xml | | |-- jkstatus.tasks | | |-- mbeans-descriptors.xml | | `-- package.html | `-- test | |-- build.xml | |-- conf | | |-- jkstatus.xml | | `-- log4j.xml | `-- src | `-- share | `-- org | `-- apache | `-- jk | `-- status | `-- JkStatusParserTest.java |-- native | |-- BUILDING.txt | |-- Makefile | |-- Makefile.am | |-- Makefile.in | |-- README.txt | |-- STATUS.txt | |-- TODO.txt | |-- aclocal.m4 | |-- apache-1.3 | | |-- Makefile | | |-- Makefile.apxs | | |-- Makefile.apxs.in | | |-- Makefile.in | | |-- Makefile.libdir | | |-- Makefile.netware | | |-- Makefile.tmpl | | |-- Makefile.vc | | |-- NWGNUmakefile | | |-- NWGNUmakefile.mak | | |-- libjk.module | | |-- mod_jk.c | | |-- mod_jk.dsp | | `-- mod_jk.exp | |-- apache-2.0 | | |-- Makefile | | |-- Makefile.apxs | | |-- Makefile.apxs.in | | |-- Makefile.in | | |-- Makefile.vc | | |-- NWGNUmakefile | | |-- bldjk.qclsrc | | |-- bldjk54.qclsrc | | |-- config.m4 | | |-- mod_jk.a | | |-- mod_jk.c | | |-- mod_jk.dsp | | |-- mod_jk.la | | |-- mod_jk.lo | | |-- mod_jk.o | | `-- mod_jk.so | |-- buildconf.sh | |-- common | | |-- Makefile | | |-- Makefile.in | | |-- ap_snprintf.c | | |-- ap_snprintf.h | | |-- config.h | | |-- config.h.in | | |-- jk.rc | | |-- jk_ajp12_worker.c | | |-- jk_ajp12_worker.h | | |-- jk_ajp12_worker.lo | | |-- jk_ajp12_worker.o | | |-- jk_ajp13.c | | |-- jk_ajp13.h | | |-- jk_ajp13.lo | | |-- jk_ajp13.o | | |-- jk_ajp13_worker.c | | |-- jk_ajp13_worker.h | | |-- jk_ajp13_worker.lo | | |-- jk_ajp13_worker.o | | |-- jk_ajp14.c | | |-- jk_ajp14.h | | |-- jk_ajp14.lo | | |-- jk_ajp14.o | | |-- jk_ajp14_worker.c | | |-- jk_ajp14_worker.h | | |-- jk_ajp14_worker.lo | | |-- jk_ajp14_worker.o | | |-- jk_ajp_common.c | | |-- jk_ajp_common.h | | |-- jk_ajp_common.lo | | |-- jk_ajp_common.o | | |-- jk_connect.c | | |-- jk_connect.h | | |-- jk_connect.lo | | |-- jk_connect.o | | |-- jk_context.c | | |-- jk_context.h | | |-- jk_context.lo | | |-- jk_context.o | | |-- jk_global.h | | |-- jk_lb_worker.c | | |-- jk_lb_worker.h | | |-- jk_lb_worker.lo | | |-- jk_lb_worker.o | | |-- jk_logger.h | | |-- jk_map.c | | |-- jk_map.h | | |-- jk_map.lo | | |-- jk_map.o | | |-- jk_md5.c | | |-- jk_md5.h | | |-- jk_md5.lo | | |-- jk_md5.o | | |-- jk_msg_buff.c | | |-- jk_msg_buff.h | | |-- jk_msg_buff.lo | | |-- jk_msg_buff.o | | |-- jk_mt.h | | |-- jk_nwmain.c | | |-- jk_pool.c | | |-- jk_pool.h | | |-- jk_pool.lo | | |-- jk_pool.o | | |-- jk_service.h | | |-- jk_shm.c | | |-- jk_shm.h | | |-- jk_shm.lo | | |-- jk_shm.o | | |-- jk_sockbuf.c | | |-- jk_sockbuf.h | | |-- jk_sockbuf.lo | | |-- jk_sockbuf.o | | |-- jk_status.c | | |-- jk_status.h | | |-- jk_status.lo | | |-- jk_status.o | | |-- jk_types.h | | |-- jk_types.h.in | | |-- jk_uri_worker_map.c | | |-- jk_uri_worker_map.h | | |-- jk_uri_worker_map.lo | | |-- jk_uri_worker_map.o | | |-- jk_url.c | | |-- jk_url.h | | |-- jk_url.lo | | |-- jk_url.o | | |-- jk_util.c | | |-- jk_util.h | | |-- jk_util.lo | | |-- jk_util.o | | |-- jk_version.h | | |-- jk_worker.c | | |-- jk_worker.h | | |-- jk_worker.lo | | |-- jk_worker.o | | |-- jk_worker_list.h | | |-- list.mk | | |-- list.mk.in | | `-- stamp-h1 | |-- config.log | |-- config.nice | |-- config.status | |-- configure | |-- configure.ac | |-- docs | | `-- api | | `-- README.txt | |-- iis | | |-- Makefile.amd64 | | |-- Makefile.ia64 | | |-- Makefile.x86 | | |-- README | | |-- installer | | | |-- LICENSE.TXT | | | |-- License.rtf | | | |-- bin | | | | `-- README | | | |-- conf | | | | |-- rewrite.properties | | | | |-- uriworkermap.properties | | | | `-- workers.properties.minimal | | | |-- iisfilter.vbs | | | |-- isapi-redirector-win32-msi.ism | | | |-- log | | | | `-- README | | | `-- tomcat.ico | | |-- isapi.def | | |-- isapi.dsp | | |-- isapi.dsw | | |-- isapi_install.vbs | | |-- isapi_redirect.reg | | |-- jk_isapi_plugin.c | | `-- pcre | | |-- AUTHORS | | |-- COPYING | | |-- ChangeLog | | |-- INSTALL | | |-- LICENCE | | |-- Makefile.in | | |-- NEWS | | |-- NON-UNIX-USE | | |-- NWGNUmakefile | | |-- README | | |-- RunTest.in | | |-- chartables.hw | | |-- config.hw | | |-- config.in | | |-- configure.in | | |-- dftables.c | | |-- dftables.dsp | | |-- dftables.x86 | | |-- dll.mk | | |-- doc | | | `-- README_httpd | | |-- get.c | | |-- install-sh | | |-- internal.h | | |-- libpcre.def | | |-- libpcre.pc.in | | |-- libpcreposix.def | | |-- maketables.c | | |-- makevp.bat | | |-- mkinstalldirs | | |-- pcre-config.in | | |-- pcre.amd64 | | |-- pcre.c | | |-- pcre.def | | |-- pcre.dsp | | |-- pcre.hw | | |-- pcre.ia64 | | |-- pcre.in | | |-- pcre.x86 | | |-- pcredemo.c | | |-- pcregrep.c | | |-- pcreposix.c | | |-- pcreposix.dsp | | |-- pcreposix.h | | |-- pcretest.c | | |-- perltest | | |-- perltest8 | | |-- pgrep.c | | |-- printint.c | | |-- study.c | | |-- testdata | | | |-- testinput1 | | | |-- testinput2 | | | |-- testinput3 | | | |-- testinput4 | | | |-- testinput5 | | | |-- testinput6 | | | |-- testoutput1 | | | |-- testoutput2 | | | |-- testoutput3 | | | |-- testoutput4 | | | |-- testoutput5 | | | `-- testoutput6 | | |-- ucp.c | | |-- ucp.h | | |-- ucpinternal.h | | |-- ucptable.c | | `-- ucptypetable.c | |-- libtool | |-- netscape | | |-- Makefile.linux | | |-- Makefile.netware | | |-- Makefile.solaris | | |-- Makefile.vc | | |-- README | | |-- jk_nsapi_plugin.c | | `-- nsapi.dsp | `-- scripts | `-- build | |-- config_vars.mk | |-- instdso.sh | |-- jk_common.m4 | |-- rules.mk | `-- unix | |-- buildcheck.sh | |-- config.guess | |-- config.sub | |-- install-sh | |-- ltmain.sh | `-- missing |-- support | |-- apache.m4 | |-- get_ver.awk | |-- jk_apache_static.m4 | |-- jk_apr.m4 | |-- jk_apxs.m4 | |-- jk_dominohome.m4 | |-- jk_exec.m4 | |-- jk_java.m4 | |-- jk_pcre.m4 | |-- jk_tchome.m4 | |-- jk_ws.m4 | `-- os_apache.m4 |-- tools | |-- dist | | |-- HEADER.html | | |-- README.html | | `-- binaries | | |-- netware | | | `-- HEADER.html | | `-- windows | | |-- HEADER.html | | |-- README.html | | `-- symbols | | |-- HEADER.html | | `-- README.html | |-- jkbindist.sh | |-- jkrelease.sh | |-- lineends.pl | |-- reports | | |-- README.txt | | |-- tomcat_reports.pl | | `-- tomcat_trend.pl | `-- signfile.sh `-- xdocs |-- ajp | |-- ajpv13a.xml | |-- ajpv13ext.xml | `-- project.xml |-- build.xml |-- empty.xml |-- generic_howto | |-- loadbalancers.xml | |-- project.xml | |-- proxy.xml | |-- quick.xml | |-- timeouts.xml | `-- workers.xml |-- images | |-- add.gif | |-- code.gif | |-- design.gif | |-- docs.gif | |-- fix.gif | |-- jakarta-logo.gif | |-- printer.gif | |-- tomcat.gif | |-- update.gif | `-- void.gif |-- index.xml |-- miscellaneous | |-- changelog.xml | |-- doccontrib.xml | |-- faq.xml | |-- jkstatustasks.xml | |-- project.xml | `-- reporttools.xml |-- news | |-- 20041100.xml | |-- 20050101.xml | |-- 20060101.xml | |-- 20070301.xml | |-- 20081001.xml | |-- 20090301.xml | |-- 20100101.xml | |-- 20110701.xml | |-- 20120301.xml | |-- 20140201.xml | `-- project.xml |-- project.xml |-- reference | |-- apache.xml | |-- iis.xml | |-- project.xml | |-- status.xml | |-- uriworkermap.xml | `-- workers.xml |-- style.css |-- style.xsl `-- webserver_howto |-- apache.xml |-- iis.xml |-- nes.xml `-- project.xml 67 directories, 438 files [root@mindserver software]# |
Apxs的设定:
可供参考的文档:http://d-prototype.com/archives/202
1 2 3 |
[root@mindserver software]# whereis apxs apxs: /usr/sbin/apxs /opt/lampp/bin/apxs /usr/share/man/man8/apxs.8.gz [root@mindserver software]# |
(需要进入解压目录的“native/”子目录)
Install mod_jk:./configure
Command is: ./configure –with-apxs=/usr/sbin/apxs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
[root@mindserver native]# ./configure --with-apxs=/usr/sbin/apxs checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for test... /usr/bin/test checking for grep... /bin/grep checking for echo... /bin/echo checking for sed... /bin/sed checking for cp... /bin/cp checking for mkdir... /bin/mkdir need to check for Perl first, apxs depends on it... checking for perl... /usr/bin/perl APRINCLUDEDIR is -I/usr/include/apr-1 -I/usr/include/apr-1 building connector for "apache-2.0" checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of gcc... none checking for a sed that does not truncate output... /bin/sed checking for egrep... grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... no checking for c++... no checking for gpp... no checking for aCC... no checking for CC... no checking for cxx... no checking for cc++... no checking for cl... no checking for FCC... no checking for KCC... no checking for RCC... no checking for xlC_r... no checking for xlC... no checking whether we are using the GNU C++ compiler... no checking whether g++ accepts -g... no checking dependency style of g++... none checking for g77... g77 checking whether we are using the GNU Fortran 77 compiler... yes checking whether g77 accepts -g... yes checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking for shl_load... no checking for shl_load in -ldld... no checking for dlopen... no checking for dlopen in -ldl... yes checking whether a program can dlopen itself... yes checking whether a statically linked program can dlopen itself... no checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool appending configuration tag "F77" to libtool checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for g77 option to produce PIC... -fPIC checking if g77 PIC flag -fPIC works... yes checking if g77 static flag -static works... yes checking if g77 supports -c -o file.o... yes checking whether the g77 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate LIBTOOL="/usr/lib64/apr-1/build/libtool --silent" checking for char... yes checking size of char... 1 checking for int... yes checking size of int... 4 checking for long... yes checking size of long... 8 checking for short... yes checking size of short... 2 checking for long double... yes checking size of long double... 16 checking for long long... yes checking size of long long... 8 checking for longlong... no checking size of longlong... 0 checking size of pid_t... 4 checking size of pthread_t... 8 checking for snprintf... yes checking for vsnprintf... yes checking for flock... yes checking for setsockopt in -lsocket... no checking sys/filio.h usability... no checking sys/filio.h presence... no checking for sys/filio.h... no checking whether to use SO_RCVTIMEO with setsockopt()... yes checking whether to use SO_SNDTIMEO with setsockopt()... yes checking whether to use SOCK_CLOEXEC with socket()... no checking poll.h usability... yes checking poll.h presence... yes checking for poll.h... yes checking for poll... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking for IPv6 with socket()... yes checking for struct sockaddr_storage... yes checking for getaddrinfo... yes checking for gethostbyname_r... yes checking for target platform... unix no apache given no netscape given configure: creating ./config.status config.status: creating Makefile config.status: creating apache-1.3/Makefile config.status: creating apache-1.3/Makefile.apxs config.status: creating apache-2.0/Makefile config.status: creating apache-2.0/Makefile.apxs config.status: creating common/Makefile config.status: creating common/list.mk config.status: creating common/jk_types.h config.status: creating common/config.h config.status: common/config.h is unchanged config.status: executing depfiles commands [root@mindserver native]# |
Install mod_jk:make
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
[root@mindserver native]# make Making all in common make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native/common' /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_ajp12_worker.c -o jk_ajp12_worker.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_connect.c -o jk_connect.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_msg_buff.c -o jk_msg_buff.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_util.c -o jk_util.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_ajp13.c -o jk_ajp13.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_pool.c -o jk_pool.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_worker.c -o jk_worker.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_ajp13_worker.c -o jk_ajp13_worker.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_lb_worker.c -o jk_lb_worker.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_sockbuf.c -o jk_sockbuf.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_map.c -o jk_map.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_uri_worker_map.c -o jk_uri_worker_map.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_ajp14.c -o jk_ajp14.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_ajp14_worker.c -o jk_ajp14_worker.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_md5.c -o jk_md5.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_shm.c -o jk_shm.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_ajp_common.c -o jk_ajp_common.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_context.c -o jk_context.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_url.c -o jk_url.lo /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c jk_status.c -o jk_status.lo make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native/common' Making all in apache-2.0 make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native/apache-2.0' /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -I/usr/include/httpd -DHAVE_CONFIG_H -DUSE_APACHE_MD5 -I ../common -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c mod_jk.c -o mod_jk.lo In file included from ../common/jk_global.h:29, from mod_jk.c:89: ../common/config.h:77:1: warning: "PACKAGE_NAME" redefined In file included from /usr/include/httpd/ap_config.h:234, from mod_jk.c:29: /usr/include/httpd/ap_config_auto.h:198:1: warning: this is the location of the previous definition In file included from ../common/jk_global.h:29, from mod_jk.c:89: ../common/config.h:80:1: warning: "PACKAGE_STRING" redefined In file included from /usr/include/httpd/ap_config.h:234, from mod_jk.c:29: /usr/include/httpd/ap_config_auto.h:201:1: warning: this is the location of the previous definition In file included from ../common/jk_global.h:29, from mod_jk.c:89: ../common/config.h:83:1: warning: "PACKAGE_TARNAME" redefined In file included from /usr/include/httpd/ap_config.h:234, from mod_jk.c:29: /usr/include/httpd/ap_config_auto.h:204:1: warning: this is the location of the previous definition In file included from ../common/jk_global.h:29, from mod_jk.c:89: ../common/config.h:86:1: warning: "PACKAGE_VERSION" redefined In file included from /usr/include/httpd/ap_config.h:234, from mod_jk.c:29: /usr/include/httpd/ap_config_auto.h:207:1: warning: this is the location of the previous definition /usr/lib64/apr-1/build/libtool --silent --mode=link gcc -I/usr/include/httpd -DHAVE_CONFIG_H -DUSE_APACHE_MD5 -I ../common -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -o mod_jk.la -module -rpath /usr/lib64/httpd/modules -avoid-version mod_jk.lo ../common/jk_ajp12_worker.lo ../common/jk_connect.lo ../common/jk_msg_buff.lo ../common/jk_util.lo ../common/jk_ajp13.lo ../common/jk_pool.lo ../common/jk_worker.lo ../common/jk_ajp13_worker.lo ../common/jk_lb_worker.lo ../common/jk_sockbuf.lo ../common/jk_map.lo ../common/jk_uri_worker_map.lo ../common/jk_ajp14.lo ../common/jk_ajp14_worker.lo ../common/jk_md5.lo ../common/jk_shm.lo ../common/jk_ajp_common.lo ../common/jk_context.lo ../common/jk_url.lo ../common/jk_status.lo ../scripts/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool --silent' mod_jk.la `pwd` /usr/lib64/apr-1/build/libtool --silent --mode=install cp mod_jk.la /software/tomcat-connectors-1.2.40-src/native/apache-2.0/ libtool: install: warning: remember to run `libtool --finish /usr/lib64/httpd/modules' make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native/apache-2.0' make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native' make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native' target="all"; \ list='common apache-2.0'; \ for i in $list; do \ echo "Making $target in $i"; \ if test "$i" != "."; then \ (cd $i && make $target) || exit 1; \ fi; \ done; Making all in common make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native/common' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native/common' Making all in apache-2.0 make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native/apache-2.0' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native/apache-2.0' [root@mindserver native]# |
Install mod_jk:make install
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
[root@mindserver native]# make install Making install in common make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native/common' make[1]: Nothing to be done for `install'. make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native/common' Making install in apache-2.0 make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native/apache-2.0' Installing files to Apache Modules Directory... /usr/sbin/apxs -i mod_jk.la /usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' mod_jk.la /usr/lib64/httpd/modules /usr/lib64/apr-1/build/libtool --mode=install cp mod_jk.la /usr/lib64/httpd/modules/ cp .libs/mod_jk.so /usr/lib64/httpd/modules/mod_jk.so cp .libs/mod_jk.lai /usr/lib64/httpd/modules/mod_jk.la cp .libs/mod_jk.a /usr/lib64/httpd/modules/mod_jk.a chmod 644 /usr/lib64/httpd/modules/mod_jk.a ranlib /usr/lib64/httpd/modules/mod_jk.a PATH="$PATH:/sbin" ldconfig -n /usr/lib64/httpd/modules ---------------------------------------------------------------------- Libraries have been installed in: /usr/lib64/httpd/modules If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,--rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- chmod 755 /usr/lib64/httpd/modules/mod_jk.so Please be sure to arrange /etc/httpd/conf/httpd.conf... make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native/apache-2.0' make[1]: Entering directory `/software/tomcat-connectors-1.2.40-src/native' make[2]: Entering directory `/software/tomcat-connectors-1.2.40-src/native' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native' make[1]: Leaving directory `/software/tomcat-connectors-1.2.40-src/native' [root@mindserver native]# |
Check it:
1 2 3 4 5 6 7 8 9 10 |
[root@mindserver native]# ll /usr/lib64/httpd/modules/mod_jk.so -rwxr-xr-x 1 root root 1141437 Jul 18 12:45 /usr/lib64/httpd/modules/mod_jk.so [root@mindserver native]# ll /etc/httpd/modules/ | grep mod_jk -rwxr-xr-x 1 root root 1141437 Jul 18 12:45 mod_jk.so [root@mindserver native]# [root@mindserver native]# file /etc/httpd/modules/mod_jk.so /etc/httpd/modules/mod_jk.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped [root@mindserver native]# file /usr/lib64/httpd/modules/mod_jk.so /usr/lib64/httpd/modules/mod_jk.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped [root@mindserver native]# |
一、配置Apache HTTPD
在Apache中配置mod_jk。
环境说明:
当前我的主机上有两个HTTPD的环境:
1 2 3 4 |
[root@mindserver native]# netstat -tupln | grep --color 80 tcp 0 0 :::80 :::* LISTEN 3348/httpd tcp 0 0 :::8089 :::* LISTEN 4476/httpd [root@mindserver native]# |
其中80对应的是LAMP,8089对应的才是通过YUM安装的HTTPD。
这里是希望在YUM的HTTPD上配置mod_jk,该HTTPD的主目录位于:/etc/httpd。
1 2 3 4 5 6 |
[root@mindserver native]# cd /etc/httpd/ [root@mindserver httpd]# ls conf conf.d logs modules run [root@mindserver httpd]# ls conf httpd.conf magic [root@mindserver httpd]# |
在/etc/httpd/conf/httpd.conf中添加下列记录:
1 2 3 4 5 6 7 |
LoadModule jk_module modules/mod_jk.so <ifModule jk_module> JkWorkersFile conf/workers.properties JkMountFile conf/uriworkermap.properties JkLogFile logs/mod_jk.log JkLogLevel warn </ifModule> |
创建/etc/httpd/conf/workers.properties
1 2 3 4 5 6 7 8 9 |
[root@mindserver httpd]# cat conf/workers.properties worker.list=wlb,jkstatus worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8009 worker.wlb.type=lb worker.wlb.balance_workers=ajp13w worker.jkstatus.type=status [root@mindserver httpd]# |
创建/etc/httpd/conf/uriworkermap.properties
1 2 3 4 5 6 7 8 9 10 |
[root@mindserver conf]# cat /etc/httpd/conf/uriworkermap.properties /admin/*=wlb /manager/*=wlb /jsp-examples/*=wlb /servlets-examples/*=wlb /examples/*=wlb /*.jsp=wlb !/servlets-examples/*.jpeg=wlb /jkmanager=jkstatus [root@mindserver conf]# |
二、配置TOMCAT
在本环境中,TOMCAT的家目录为:/tomcat/apache-tomcat-8.0.9/
1 2 3 4 5 6 7 8 |
[root@mindserver bin]# env | grep CATALINA CATALINA_HOME=/tomcat/apache-tomcat-8.0.9 CATALINA_TEMDIR=/tomcat/apache-tomcat-8.0.9/temp [root@mindserver bin]# [root@mindserver tomcat]# cd apache-tomcat-8.0.9/ [root@mindserver apache-tomcat-8.0.9]# ls bin conf lib LICENSE logs NOTICE RELEASE-NOTES RUNNING.txt temp webapps work [root@mindserver apache-tomcat-8.0.9]# |
(以上,主要的配置文件的修改位于“conf/”,主要的服务启停等操作的程序位于“bin/”)
修改/tomcat/conf/server.xml
修改前:
1 2 3 |
122 <Host name="localhost" appBase="webapps" 123 unpackWARs="true" autoDeploy="true"> 124 |
修改后:
1 2 3 4 5 |
122 <Host name="localhost" appBase="webapps" 123 unpackWARs="true" autoDeploy="true" 124 xmlValidation="false" xmlNamespaceAware="false"> 125 <Context path="" docBase="/var/www/html" debug="0"> 126 |
创建测试页面:
1 2 3 4 5 6 7 8 9 |
[root@mindserver html]# pwd /var/www/html [root@mindserver html]# cat helloworld.jsp <% System.out.println("Hell world, This comes from Oracle."); java.util.Date date = new java.util.Date(); %> Hello world, Time is: <%= date %> [root@mindserver html]# |
三、重启TOMCAT与HTTPD
HTTPD
1 2 3 4 5 |
[root@mindserver native]# service httpd restart Stopping httpd: [FAILED] Starting httpd: [Fri Jul 18 12:47:14 2014] [error] (EAI 3)Temporary failure in name resolution: Failed to resolve server name for 188.0.1.190 (check DNS) -- or specify an explicit ServerName [ OK ] [root@mindserver native]# |
TOMCAT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@mindserver bin]# pwd /tomcat/apache-tomcat-8.0.9/bin [root@mindserver bin]# ls bootstrap.jar commons-daemon-native.tar.gz digest.sh startup.bat tool-wrapper.sh catalina.bat configtest.bat setclasspath.bat startup.sh version.bat catalina.sh configtest.sh setclasspath.sh tomcat-juli.jar version.sh catalina-tasks.xml daemon.sh shutdown.bat tomcat-native.tar.gz commons-daemon.jar digest.bat shutdown.sh tool-wrapper.bat [root@mindserver bin]# ll startup.sh -rw-r--r-- 1 root root 1904 Jun 19 13:55 startup.sh [root@mindserver bin]# chmod -R 755 * [root@mindserver bin]# [root@mindserver bin]# ./startup.sh Using CATALINA_BASE: /tomcat/apache-tomcat-8.0.9 Using CATALINA_HOME: /tomcat/apache-tomcat-8.0.9 Using CATALINA_TMPDIR: /tomcat/apache-tomcat-8.0.9/temp Using JRE_HOME: /usr Using CLASSPATH: /tomcat/apache-tomcat-8.0.9/bin/bootstrap.jar:/tomcat/apache-tomcat-8.0.9/bin/tomcat-juli.jar Tomcat started. [root@mindserver bin]# |
三、查看。
状态的检查:
1 2 3 4 5 6 7 8 9 10 11 12 |
[root@mindserver apache-tomcat-8.0.9]# ps -ef | grep java root 1964 1 99 16:03 pts/1 00:00:03 /usr/bin/java -Djava.util.logging.config.file=/tomcat/apache-tomcat-8.0.9/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/tomcat/apache-tomcat-8.0.9/endorsed -classpath /tomcat/apache-tomcat-8.0.9/bin/bootstrap.jar:/tomcat/apache-tomcat-8.0.9/bin/tomcat-juli.jar -Dcatalina.base=/tomcat/apache-tomcat-8.0.9 -Dcatalina.home=/tomcat/apache-tomcat-8.0.9 -Djava.io.tmpdir=/tomcat/apache-tomcat-8.0.9/temp org.apache.catalina.startup.Bootstrap start root 1981 6887 0 16:03 pts/1 00:00:00 grep java [root@mindserver apache-tomcat-8.0.9]# [root@mindserver apache-tomcat-8.0.9]# [root@mindserver apache-tomcat-8.0.9]# netstat -tupln |grep 80 tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 1964/java tcp 0 0 :::8009 :::* LISTEN 1964/java tcp 0 0 :::8080 :::* LISTEN 1964/java tcp 0 0 :::80 :::* LISTEN 1792/httpd tcp 0 0 :::8089 :::* LISTEN 1419/httpd [root@mindserver apache-tomcat-8.0.9]# |
(8089的HTTPD是上面我们以YUM安装的HTTP,也是配置了和TOMCAT关联的HTTP,而非默认的80。)
网页查看:
TOMCAT: http://188.0.1.190:8080/helloworld.jsp
Apache HTTPD: http://188.0.1.190:8089/helloworld.jsp
MOD_JK的状态查看:
JK Manager:http://188.0.1.190:8089/jkmanager
————————————————————————————————
Ending。
再次,回来看这个文档,发现关于JKSTATUS的这个状态展示的原理与配置细节,其实,自己完全不理解。现在配置JBOSS4,通过另一种MOD_JK的配制方法,虽然集群跑起来了,但是JKSTATUS不知道怎么看,也不知道测试的WEB样例程序该放在哪里部署。对于JBOSS的理解,太肤浅。