本文介绍了清理码头-去除“不必要"的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经使用 Jetty 作为我的Web容器.

I'm used to use Jetty as my web container.

我在安装步骤上所做的就是获取原始tar球并从其中清理一些目录和文件.

What I did on my install steps is get the original tar ball and cleanup some directories and files from it.

我想在这里提出的是:

我对默认码头包裹的更改:

  • 删除:
    • README.txt
    • pom.xml
    • javadoc/
    • 示例/
    • /webapps/test *
    • /contexts/test *
    • /project-website
    • /resources/log4j.properties
    • REMOVE:
      • README.txt
      • pom.xml
      • javadoc/
      • examples/
      • /webapps/test*
      • /contexts/test*
      • /project-website
      • /resources/log4j.properties
      • 工作/

      问题:

      • 我没有违反任何许可权吗?
      • 这样做会给我的系统带来任何缺点(性能/稳定性)吗?
      • 有人在码头上进行自定义吗?
      • 评论?
      • 问题?
      • 提示?

      相关帖子:

      推荐答案

      这是清理Jetty(9.1.5)的一种方法.

      Here's one way of cleaning up Jetty (9.1.5).

      tar -xzvf jetty-distribution-9.1.5.v20140505.tar.gz
      # can rename 'jetty-distribution-9.1.5.v20140505' to 'jetty-9.1.5' or similar
      cd jetty-distribution-9.1.5.v20140505
      rm -rf VERSION.txt license-eplv10-aslv20.html notice.html start.d/jsp.ini resources/log4j.properties demo-base/
      find -name README.TXT | xargs rm -fv
      
      mv etc etc.bak              # keep a backup of etc/ and modules/, take whats necessary
      mv modules modules.bak
      mkdir etc modules work
      mv modules.bak/.donotdelete modules.bak/deploy.mod modules.bak/ext.mod modules.bak/http.mod \
          modules.bak/logging.mod modules.bak/resources.mod modules.bak/security.mod modules.bak/server.mod modules.bak/servlet* \
          modules.bak/webapp.mod modules/
      mv $(grep -h --color=none "etc.*.xml" modules/* | sed 's/etc/etc\.bak/g') etc/
      mv etc.bak/jetty-started.xml etc.bak/jetty.conf etc/        # required for bin/jetty.sh
      mv etc.bak/webdefault.xml etc/                              # required for web applications
                                                                  # provides default deployment descriptor config for all apps
      # rm -rf modules.bak/ etc.bak/                              # remove if not needed
      
      sed -i '/^#/d; /^\s*$/d' start.ini start.d/http.ini         # clean if needed
      
      vi start.ini start.d/http.ini                               # check and modify if needed
          start.ini: 'jetty.send.server.version=false', remove '--module=websocket'
          http.ini: 'jetty.port=9999'
      vi modules/<whatever.mod>                                   # check and modify if needed
      vi etc/jetty.xml # to prevent Jetty from showing context related information
          remove
              <Item>
                  <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
              </Item>
      vi etc/jetty-logging.xml # suffix date with '-', instead of prefixing with '_'
          change
              <Arg><Property name="jetty.logs" default="./logs"/>/yyyy_mm_dd.stderrout.log</Arg>
              ...
              <Get id="ServerLogName" name="datedFilename"/>
          to
              <Arg><Property name="jetty.logs" default="./logs"/>/stderrout.log.yyyy_mm_dd</Arg>
              ...
              <Arg type="java.lang.String">yyyy-MM-dd</Arg>
              <Arg type="java.lang.String">HHmmssSSS</Arg>
              <Get id="ServerLogName" name="datedFilename"/>
      vi etc/webdefault.xml # disable jsp support and modify other default settings
          remove or comment out <servlet> and <servlet-mapping> of JSP Servlet
          remove or comment out index.jsp from <welcome-file-list>
          set dirAllowed to false in default servlet
      vi bin/jetty.sh # use $JETTY_BASE/logs instead of $JETTY_BASE as working directory
          change
              JETTY_RUN=$(findDirectory -w /var/run /usr/var/run $JETTY_BASE /tmp)
              JETTY_STATE=$JETTY_BASE/${NAME}.state
          to
              JETTY_RUN=$(findDirectory -w /var/run /usr/var/run $JETTY_BASE/logs $JETTY_BASE /tmp)
              JETTY_STATE=$JETTY_RUN/${NAME}.state
      vi bin/jetty.sh # use $JETTY_HOME/work as default TMPDIR
          move following 
              TMPDIR=${TMPDIR:-/tmp}
          below 'JETTY_HOME=$PWD' and change
              TMPDIR=${TMPDIR:-"$JETTY_HOME"/work}
      

      及其结果结构.

      jetty-distribution-9.1.5.v20140505
      ├── bin
      │   └── jetty.sh
      ├── etc
      │   ├── jetty-deploy.xml
      │   ├── jetty-http.xml
      │   ├── jetty-logging.xml
      │   ├── jetty-started.xml
      │   ├── jetty.conf
      │   ├── jetty.xml
      │   └── webdefault.xml
      ├── lib
      │   └── <no change or keep only relevant>
      ├── logs
      ├── modules
      │   ├── deploy.mod
      │   ├── ext.mod
      │   ├── http.mod
      │   ├── logging.mod
      │   ├── resources.mod
      │   ├── security.mod
      │   ├── server.mod
      │   ├── servlet.mod
      │   ├── servlets.mod
      │   └── webapp.mod
      ├── resources
      ├── start.d
      │   └── http.ini
      ├── start.ini
      ├── start.jar
      ├── webapps
      └── work
      

      这篇关于清理码头-去除“不必要"的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:10