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

推荐订阅源

T
Threat Research - Cisco Blogs
S
Securelist
H
Heimdal Security Blog
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
Spread Privacy
Spread Privacy
Cyberwarzone
Cyberwarzone
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
人人都是产品经理
人人都是产品经理
C
Cisco Blogs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Engineering at Meta
Engineering at Meta
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
O
OpenAI News
P
Proofpoint News Feed
Google Online Security Blog
Google Online Security Blog
Recent Announcements
Recent Announcements
Hacker News: Ask HN
Hacker News: Ask HN
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
G
GRAHAM CLULEY
Apple Machine Learning Research
Apple Machine Learning Research
TaoSecurity Blog
TaoSecurity Blog
S
Security @ Cisco Blogs
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Jina AI
Jina AI
S
Secure Thoughts
G
Google Developers Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
T
Tenable Blog
Latest news
Latest news
I
InfoQ

方永、南天紫雲

linux透明代理 技术的边界 停机问题通俗说明 Rust与oracle、redis集群的纠结 学习能力的增长 微信调试的原语 mac外接移动硬盘安装ArchLinux linux的死机问题 linux下全键盘操作 漂亮又好用的bspwm linux本机透明代理 ssh、mosh、autossh linux不能待机又一例 从WordPress切换到Hugo 折腾电脑开机 linux系统QQ新思路 Arch Linux的字体渲染 svn管理之submin OpenWrt自动fucking墙記錄 二维码(qrcode)名片的一些事儿 用lua nginx module搭建一个二维码(qr code)生成器 CentOS 7 安裝註記 php程序連接MySQL时只能127.0.0.1而localhost無法連接的問題 ThinkPad之FAN_ERROR、hi fi聲卡 OpenWrt簡單暴力限網 linux中cron之PATH变量 OpenWrt的WDS無線橋接模式 再敘OpenWrt下的rtl8187無線中繼 sed之模擬tail 終端進化之二零一三 linux下的郵件服務器:postfix_dovecot_roundcube 一次性密碼/動態口令卡原理 xl2tp之VPN靜態地址分配 rtl2838U2832试用记 linux中pptp协议VPN搭建 glances监控工具安装 CentOS6.4硬盘安装 Debian Wheezy硬盤/U盤安裝小記 Kirby小試 zsh shell怎么打开常用的目录? OpenWrt SSH免密码使用密钥登录 linux中的vsftpd的匿名(anonymous)用户配置 無光驅無USB無軟驅,怎麼修復硬盤MBR? 那些個人網站 linuxFreeBSD下的dnspod动态域名客户端 Windows系统盘的32K之殇 一枚Chrome插件引起的大量磁盤IO問題 用批處理切換網卡的IP(適用Win7、Win8) Windows中的DHCP服务器 Win8啓動時出現“您的電腦需要修復”問題的解決辦法 Windows8睡眠(待机)模式异常处理 最强大好用而又小巧的计算器 Windows8運行不能保存歷史命令 Win8下的红警2尤里复仇 为cmd添加readline,如Bash Shell般使用cmd 手动添加修改win8 win+x菜单 Win8運行卸載程序時提示2503之解決一法 烽火HG110提权一法 缓解眼疲劳有效的办法 mintty乱码解决办法 糟糠美妾 免费易用的Win8 ArchLinux的類box環境音量調節二三事 使用OpenWrt与curl挂QQ OpenWrt的安全 OpenWrt BCM63xx rtl8187使用注意事项 Arch Linux之systmed使用简介 Archlinux 2012.07.15之后发布的镜像新手安装完全向导 FreeBSD 9.0 安装简记 记一由FreeBSD引发的午夜惊魂 Jekyll or handmade wi-fi无线破解过程与原理简要介绍 修复QQ影音异常卸载后的文件关联 吐槽一下000webhost 为OpenWrt的luci Web界面加速 最小的sed for Windows linux的磁盘自动挂载 OpenWrt中crontab -e的使用 sddns(dnspod client for OpenWrt)使用说明 OpenWrt中vsftp添加新用户 php+markdown写博客 linux arp防火墙之p2p终结者 墙外的世界很精彩 OpenWrt使用dnspod的动态域名解析(ddns)功能 OpenWrt架设nginx php网站 openwrt架设uhttpd+php+sqlite网站 vim自动跳到上次离开的光标位置 OpenWrt无线中继配置文件 修行八支 漫步者R201T打摩升级改造 阿里(Ali)3328系dvb接收机软件升级方法 db120刷OpenWrt固件并使用ppp方式ADSL拨号 移动短信助手 chrome tips一则 cdate,显示中国传统农历日期 更改硬盘模式为AHCI后Windows及linux的调整 使用grub2加载软盘和光盘镜像 电脑用数据线连接手机上网 电脑通过蓝牙连接手机GPRS上网 我与我的语言
jetty多端口部署
zola · 2014-05-12 · via 方永、南天紫雲

有时需要将多个项目归并在同一个jetty下面部署,節省資源,便於管理。下面是部署過程:

僅在jetty 8.1.15測試通過,jetty9以上版本由於xml格式變動,需要做一些修改

一、 在 webapps 及 contexts 下面各新建目錄 1,2,3,4 ,在jetty的 etc 中添加 jetty2.xml 、 jetty3.xml 、 jetty4.xml 文件,內容如下:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure id="Server2" class="org.eclipse.jetty.server.Server">
 
<Set name="ThreadPool">
     <!-- Default queued blocking threadpool -->
     <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
       <Set name="minThreads">10</Set>
       <Set name="maxThreads">200</Set>
       <Set name="detailedDump">false</Set>
     </New>
</Set>
 
<Call name="setAttribute">
     <Arg>org.eclipse.jetty.webapp.configuration</Arg>
     <Arg>
         <Array type="java.lang.String">
              <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
              <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
              <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
              <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
              <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>
              <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
         </Array>
     </Arg>
 </Call>
 
 
<Set name="handler">
      <New id="Handlers2" class="org.eclipse.jetty.server.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.eclipse.jetty.server.Handler">
           <Item>
             <New id="Contexts2" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
           </Item>
         </Array>
        </Set>
      </New>
 </Set>
 
 
 
 <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host"><Property name="jetty.host" /></Set>
            <Set name="port"><Property name="jetty.port" default="8010"/></Set>
            <Set name="maxIdleTime">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
        <Set name="lowResourcesConnections">20000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
  </Call>
 
 
  <Call name="addBean">
    <Arg>
      <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
        <Set name="contexts">
          <Ref id="Contexts2" />
        </Set>
          <Call id="webappprovider" name="addAppProvider">
            <Arg>
              <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
                <Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps/2</Set>
                <Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
                <Set name="scanInterval">1</Set>
                <Set name="contextXmlDir"><Property name="jetty.home" default="." />/contexts/2</Set>
              </New>
            </Arg>
          </Call>
          <Call name="addAppProvider">
             <Arg>
               <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
                 <Set name="monitoredDirName"><Property name="jetty.home" default="." />/contexts/2</Set>
                 <Set name="scanInterval">1</Set>
               </New>
             </Arg>
          </Call>
 
      </New>
    </Arg>
  </Call>
 
</Configure>

修改相對目錄及端口號。

二、 更改 jetty-webapps.xml 、 jetty-contexts.xml 的相對目錄,如 monitoredDirName 的值改爲 /webapps/1 。

三、添加或修改 contexts 中 1,2,3,4 中項目的配置文件,內容可如下:

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
 
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/4/root</Set>
 
  <Set name="extractWAR">true</Set>
  <Set name="copyWebDir">false</Set>
  <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
 
</Configure>

四、 在 etc/jetty.conf 中添加如下内容:

etc/jetty2.xml
etc/jetty3.xml
etc/jetty4.xml

五、 启动jetty。