install.sh

来自「《jsp编程起步》里面的所有源代码」· Shell 代码 · 共 104 行

SH
104
字号
#!/bin/shusage() {  echo "usage: install.sh [flags]"  echo "flags:"  echo "  -help               : this usage message"  echo "  -apache <apachedir> : changes the apache dir"  echo "  -apxs <apxspath>    : path to apxs"}DEBUG=while [ "$#" -ne 0 ]; do    case "$1" in    # Documented arguments    -h | -help)       SHOW_HELP=true; shift;;    -apache) APACHE="$2"; shift 2;;    -apxs) APXS="$2"; shift 2;;    -debug) DEBUG="-Wc,-DDEBUG"; shift;;    *)   break;    esacdoneif test -z "${APACHE}"; then  APACHE=/usr/local/apachefiecho "Using Apache installation in ${APACHE}"if test ! -z "${APXS}"; then  APACHE=$APXS -q PREFIXelif ${APACHE}/sbin/apxs -q PREFIX >/dev/null 2>/dev/null; then  APXS=${APACHE}/sbin/apxselif ${APACHE}/bin/apxs -q PREFIX >/dev/null 2>/dev/null; then  APXS=${APACHE}/bin/apxselif ${APACHE}/src/support/apxs -q PREFIX >/dev/null 2>/dev/null; then  APXS=${APACHE}/src/support/apxselif apxs -q PREFIX >/dev/null 2>/dev/null; then  APXS=apxselse  echo "Cannot find valid Apache apxs in ${APACHE}"  exit 1fiecho "Using apxs from ${APXS}"$APXS -o mod_caucho.so -i -Wc,-Wall $DEBUG -Wc,-O2 -c mod_caucho.c registry.c config.c stream.cif test $? != 0; then  echo "Compilation failed, probably due to problems in"  echo "$APXS.  See the Resin troubleshooting FAQ for information"  echo "on fixing it."  exit 1fiCONFDIR=`$APXS -q SYSCONFDIR`if ! grep mod_caucho $CONFDIR/httpd.conf >/dev/null 2>/dev/null; then  path=`type -p $0`  dir=`dirname $path`  if test -d ${APACHE}/htdocs; then    DOCROOT=${APACHE}/htdocs  elif test -d ${APACHE}/share/htdocs; then    DOCROOT=${APACHE}/share/htdocs  else    DOCROOT=doc  fi#  sed "s#DOCROOT#$DOCROOT#" < $dir/srun.conf > $dir/../srun.conf  cat >>$CONFDIR/httpd.conf <<EOF## Caucho Servlet Engine Configuration## Uncomment the following two lines to enable CSE#LoadModule caucho_module libexec/mod_caucho.so#AddModule mod_caucho.c<IfModule mod_caucho.c>  CauchoConfigFile $dir/../resin.conf# Uncomment the following line to debug the connection setup#  <Location /caucho-status>#    SetHandler caucho-status#  </Location>## Uncomment the following for srun connection keepalive# CauchoKeepalive on## You can also configure CSE directly by commenting out CauchoConfigFile# and adding the following:## CauchoHost localhost# CauchoPort 6802# AddHandler caucho-request jsp# <Location /servlets/*>#    SetHandler caucho-request# </Location></IfModule>EOFfi

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?