惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
罗磊的独立博客
V
Visual Studio Blog
爱范儿
爱范儿
H
Help Net Security
J
Java Code Geeks
I
InfoQ
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recorded Future
Recorded Future
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
GbyAI
GbyAI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
Scott Helme
Scott Helme
S
SegmentFault 最新的问题
S
Securelist
L
LINUX DO - 热门话题
Cyberwarzone
Cyberwarzone
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
博客园_首页
B
Blog
F
Fortinet All Blogs
AWS News Blog
AWS News Blog
V
Vulnerabilities – Threatpost
S
Secure Thoughts
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Schneier on Security
Project Zero
Project Zero
Martin Fowler
Martin Fowler
C
Cybersecurity and Infrastructure Security Agency CISA
N
Netflix TechBlog - Medium
N
News and Events Feed by Topic

博客园 - shitou

java解压缩.Z文件 Uncompress a unix compressed file--.Z poi jxl 生成EXCEL 正则表达式删除空行 JS的构造函数 中文乱码在java中URLEncoder.encode方法要调用两次解决 数据层框架guzz Maven使用手册 Jetty 的配置 jetty 网址分享 windows安装MongoDB Spring中使用Quartz Quartz 在Spring中动态设置cronExpression spring任务调度-Quartz Quartz的cron表达式 spring3.0核心包说明 Struts2 异常错误总结 ExtJS的Desktop应用 java.lang.NoSuchMethodError: com.opensymphony.xwork2.util.ValueStack.findValue(Ljava/lang/String;Ljava/lang/Class;Z)
Apache+Jetty整合
shitou · 2011-05-31 · via 博客园 - shitou

Jetty国内好像用的人并不多,资料很少。Apache和Jetty整合的更是没有,国外的有一些但大多写的不够清楚。

最近因为业务需要,需将apache jetty进行整合,研究了一天终于搞定,现将此分享。

安装包路径:/usr/local/src 

---安装jdk---

#chmod u+x jdk-6u11-linux-i586-rpm.bin
#./jdk-6u11-linux-i586-rpm.bin

添加环境变量:
#vi /etc/profile

添加:
export JAVA_HOME=/usr/java/jdk1.6.0_11
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin

---安装Jetty---

Jetty官方网站:http://www.mortbay.org/jetty/
最新版本是 6.1.14

#unzip jetty-6.1.14.zip
#mv jetty-6.1.14 /usr/local/jetty
#/usr/local/jetty/bin/build_release_bundles.sh /usr/local/jetty

---启动Jetty---Jetty 可以用如下命令启动:
#cd /usr/local/jetty
#java -jar start.jar

访问http://xxx.xxx.xxx.xxx:8080/ 就可以看到Jetty的测试页面

ps:也可以用jetty启动脚本(支持绝对路径)
#/usr/local/jetty/bin/jetty.sh start

---安装Apache---

Apache官方网站:http://httpd.apache.org/
最新版本是: httpd-2.2.11.tar.gz

#tar zxvf  httpd-2.2.11.tar.gz
#cd cd httpd-2.2.11
#cd srclib/apr
#./configure --prefix=/usr/local/apr --enable-threads --enable-other-child --enable-static
# make && make install
# cd ../apr-util
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ --with-mysql=/usr/local/mysql
# make && make install
#cd ../..
#./configure --prefix=/usr/loacl/apache --enable-modules=so --enable-so --enable-mods-shared=all --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --enable-static-support --enable-static-htpasswd --enable-static-htdigest --enable-static-rotatelogs --enable-static-logresolve --enable-static-htdbm --enable-static-ab --enable-static-checkgid --disable-cgid --disable-cgi --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre

# make && make install
#cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

--- 安装 mod_jk ---
下载地址:http://tomcat.apache.org/download-connectors.cgi

#tar zxvf tomcat-connectors-1.2.27-src.tar.gz
#cd tomcat-connectors-1.2.27-src
#cd native
#./configure --with-apxs=/usr/local/apache/bin/apxs
#make && make install

--- 整合 Apache Jetty ---
修改Jetty配置文件:
路径:/usr/local/jetty/etc/jetty.xml

添加如下内容:
 <Call name="addConnector">
     <Arg>
        <New class="org.mortbay.jetty.ajp.Ajp13SocketConnector">
        <Set name="host">127.0.0.1</Set>  
        <Set name="port">8009</Set>     
        </New>                     
     </Arg>                             
 </Call>

或用如下方式启用jetty亦可:
#java -jar start.jar etc/jetty.xml etc/jetty-ajp.xml &  (必须在jetty目录下执行)

修改httpd.conf

添加如下内容:
<IfModule !mod_jk.c>

  LoadModule jk_module  modules/mod_jk.so

</IfModule>

<IfModule mod_jk.c>

  JkWorkersFile "conf/worker.properties"

  JkLogFile "logs/mod_jk.log"

  JkLogLevel info

  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

  JkOptions +ForwardKeySize +ForwardURICompat
 
 JkMount /*.jsp jetty
 
</IfModule>

在httpd.conf同目录下创建worker.properties

其内容为:

worker.list=jetty

worker.jetty.port=8009

worker.jetty.host=127.0.0.1

worker.jetty.type=ajp13