-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·66 lines (51 loc) · 2.52 KB
/
install
File metadata and controls
executable file
·66 lines (51 loc) · 2.52 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
#!/bin/bash
source ./bits/bootstrap/logging
#-----------
# Configurations
#-----------
LAUNCHER_OWNER=${LAUNCHER_OWNER-$USER}
export LAUNCHER_DIR=${LAUNCHER_DIR-/var/local}
export APACHE_LAUNCHER_DIR=${APACHE_LAUNCHER_DIR-$LAUNCHER_DIR/apache}
export DOCKER_LAUNCHER_DIR=${DOCKER_LAUNCHER_DIR-$LAUNCHER_DIR/docker}
APACHE_INCLUDE_RELOAD=${APACHE_INCLUDE_RELOAD-true}
APACHE_INCLUDE_PHP=${APACHE_INCLUDE_PHP-true}
APACHE_INCLUDE_MYSQL=${APACHE_INCLUDE_MYSQL-true}
APACHE_INCLUDE_POSTGRES=${APACHE_INCLUDE_POSTGRES-true}
export APACHE_APPS_DIR=${APACHE_APPS_DIR-/var/local/apps}
export APACHE_SITES_ENABLED_DIR=${APACHE_SITES_ENABLED_DIR-/etc/apache2/sites-enabled}
export APACHE_SITES_AVAILABLE_DIR=${APACHE_SITES_AVAILABLE_DIR-/etc/apache2/sites-available}
export APACHE_LOG_DIR=${APACHE_LOG_DIR-/var/log/apache2}
export APACHE_HTTP_PORT=${APACHE_HTTP_PORT-80}
export APACHE_SSL_PORT=${APACHE_SSL_PORT-443}
#-----------
# Install Script
#-----------
notify "Install apache..."
OWNER=$LAUNCHER_OWNER ./bits/bootstrap/mkdir LAUNCHER_DIR APACHE_LAUNCHER_DIR $APACHE_LAUNCHER_DIR/startup.d $APACHE_LAUNCHER_DIR/files
OWNER=$LAUNCHER_OWNER:www-data ./bits/bootstrap/mkdir APACHE_SITES_ENABLED_DIR APACHE_SITES_AVAILABLE_DIR
TEMPLATE=./bits/apache/files/apache.dockerfile LOCATION=$APACHE_LAUNCHER_DIR/Dockerfile ./bits/docker/copyif
if [[ ! -e $APACHE_LAUNCHER_DIR/files/do_nothing ]]; then
printf '#!/bin/bash\n# Do nothing\n' > $APACHE_LAUNCHER_DIR/files/do_nothing
chmod 755 $APACHE_LAUNCHER_DIR/files/do_nothing
fi
if [[ "$APACHE_INCLUDE_PHP" = true ]]; then
debug " -- enabling php"
sed -i 's|# @PHP_INSTALL@|cat ./bits/apache/files/php_partial.dockerfile|e' ${APACHE_LAUNCHER_DIR}/Dockerfile
fi
if [[ "$APACHE_INCLUDE_MYSQL" = true ]]; then
debug " -- enabling mysql"
sed -i 's|# @MYSQL_INSTALL@|cat ./bits/apache/files/mysql_partial.dockerfile|e' ${APACHE_LAUNCHER_DIR}/Dockerfile
fi
if [[ "$APACHE_INCLUDE_RELOAD" = true ]]; then
debug " -- enabling apache reload"
cp ./bits/apache/files/apache_touch $APACHE_LAUNCHER_DIR/files/apache_touch
cp ./bits/apache/files/touchandgo $APACHE_LAUNCHER_DIR/files/touchandgo
cp ./bits/apache/files/apache_reload $APACHE_LAUNCHER_DIR/files/apache_reload
sed -i 's|# @RELOAD_INSTALL@|cat ./bits/apache/files/reload_partial.dockerfile|e' $APACHE_LAUNCHER_DIR/Dockerfile
fi
LAUNCHER_DIR=$APACHE_LAUNCHER_DIR NAME=apache ./bits/docker/build
NAME=apache DIR=$APACHE_LAUNCHER_DIR \
START=./bits/apache/files/_start \
DEBUG=./bits/apache/files/_debug \
./bits/docker/helpers
notify "DONE, Install apache."