install.sh
1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
APXS=
RESIN_HOME=
DEBUG=
usage() {
echo "usage: install.sh [flags]"
echo "flags:"
echo " -help : this usage message"
echo " -conf <conf> : apache config"
echo " -apache_dir <dir> : apache dir"
echo " -libexec <dir> : libexec directory"
echo " -resin_home <resin_home> : resin home"
}
DEBUG=
while test "$#" -ne 0 ; do
case "$1" in
# Documented arguments
-h | -help) SHOW_HELP=true; shift;;
-conf) CONF="$2"; shift 2;;
-apache_dir) APACHE_DIR="$2"; shift 2;;
-libexec) LIBEXECDIR="$2"; shift 2;;
-resin_home) RESIN_HOME="$2"; shift 2;;
*) shift ; break;
esac
done
if test ! -r "$CONF"; then
echo "Can't find valid Apache configuration \"$CONF\""
exit 1
fi
#if test -d "$LIBEXECDIR"; then
# echo cp mod_caucho.so $LIBEXECDIR
# cp mod_caucho.so $LIBEXECDIR
#elif test -z "$LIBEXECDIR"; then
# LIBEXECDIR=`pwd`
#else
# echo "Can't find valid Apache module directory in \"$LIBEXECDIR\""
# exit 1
#fi
if test ! -d "$APACHE_DIR"; then
APACHE_DIR="/tmp"
fi
if test -d "$APACHE_DIR/conf.d"; then
if test ! -r "$APACHE_DIR/conf.d/resin.conf"; then
cat >> $APACHE_DIR/conf.d/resin.conf <<EOF
#
# mod_caucho Resin Configuration
#
LoadModule caucho_module $LIBEXECDIR/mod_caucho.so
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory $APACHE_DIR
CauchoStatus yes
EOF
fi
else
grep mod_caucho $CONF >/dev/null 2>/dev/null
if test "$?" != 0; then
cat >>$CONF <<EOF
#
# mod_caucho Resin Configuration
#
LoadModule caucho_module $LIBEXECDIR/mod_caucho.so
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory $APACHE_DIR
CauchoStatus yes
EOF
fi
fi