Apache 整合 jetty
$ cd native$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' --with-apxs=/usr/sbin/apxs$ make$ sudo make install
?
? ? linux环境下:
? ??这里是将其放到/usr/local , 安装过程可能需要?aclocal,libtool,autoheader,automake,autoconf
? ??
[root@webserver ~]# cd /usr/local/[root@webserver local]# tar xzvf jakarta-tomcat-connectors-1.2.15-src.tar.gz[root@webserver local]# cd jakarta-tomcat-connectors-1.2.15-src/jk/native[root@webserver native]#chmod 755 buildconf.sh[root@webserver native]# ./buildconf.sh[root@webserver native]#./configure --with-apxs=/usr/sbin/apxs[root@webserver native]# make [root@webserver native]# make install [root@webserver native]# cd apache-2.0 [root@webserver native]#ll mod_jk.so
?
?
? ?2)配置 httpd.conf
? ?2.1) 在文件中找到,
? ? 从 ? ?
<IfDefine !MACOSXSERVER>#LoadModule jk_module libexec/apache2/mod_jk.so...</IfDefine !MACOSXSERVER>
? ? 移出来,让apache一直加载mod_jk
?
? 2.2 在文件中找到:
? ?
<IfModule mod_jk.c>...</IfModule>
? ?改为:
<Call name="addConnector"></Call>....<Call name="addConnector"> <Arg> <New name="code"><IfModule mod_jk.c> JKWorkersFile /etc/apache2/worker.properties JKLogFile /var/log/apache2/mod_jk.log JkShmFile /var/log/apache2/jk-runtime-status JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " JkOptions +ForwardKeySize +ForwardURICompat JkMount /async-rest/* jetty</IfModule>
?
?
? ?2.3) 添加worker.properties
? ??
worker.list=jettyworker.jetty.port=8009worker.jetty.host=127.0.0.1worker.jetty.type=ajp13worker.jetty.lbfactor=1
?
?
?2 让jetty支持ajp
? ? 在jetty.xml中添加:
? ??
<Call name="addConnector">...</Call><Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.ajp.Ajp13SocketConnector"> <Set name="port">8009</Set> </New> </Arg> </Call>
?
? 若?org.eclipse.jetty.ajp.Ajp13SocketConnector 类找不到,讲jar包复制到jetty/lib/ext下
? 3, 重启jetty, apache, apache默认端口为80
? ? 运行 http://localhost/async-rest/
? 成功
?
?4 参考
? ?http://www.bartbusschots.ie/blog/?p=1347
? ? ??http://blog.omgmog.net/post/a-possible-solution-to-bad-interpreter-operation-not-permitted-error-on-mac-os-x-lion/? 解决:?bad interpreter: operation not permitted