-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-httpd.sh
executable file
·32 lines (25 loc) · 1.2 KB
/
run-httpd.sh
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
#!/bin/bash
if [ -f /config/davrods-vhost.conf ]; then
if [ -f /etc/apache2/sites-available/davrods-vhost.conf ]; then
cp /etc/apache2/sites-available/davrods-vhost.conf /etc/apache2/sites-available/davrods-vhost.conf.org
fi
cp /config/davrods-vhost.conf /etc/apache2/sites-available/davrods-vhost.conf
chmod 0644 /etc/apache2/sites-available/davrods-vhost.conf
sed -i "s/\$VIRTUAL_HOST/$VIRTUAL_HOST/g" /etc/apache2/sites-available/davrods-vhost.conf
sed -i "s/\$IRODS_SERVER/$IRODS_SERVER/g" /etc/apache2/sites-available/davrods-vhost.conf
fi
if [ -f /config/irods_environment.json ]; then
cp /config/irods_environment.json /etc/apache2/irods/irods_environment.json
chmod 0644 /etc/apache2/irods/irods_environment.json
fi
# Start filebeat
/etc/init.d/filebeat start
# Make log directory
mkdir -p /var/log/apache2
# Remove default webpage and enable davrods
rm -f /etc/apache2/sites-enabled/*
ln -s /etc/apache2/sites-available/davrods-vhost.conf /etc/apache2/sites-enabled/davrods-vhost.conf
# start the apache daemon
/etc/init.d/apache2 start
# this script must end with a persistent foreground process
tail -F /var/log/apache2/apache.access.log /var/log/apache2/apache.error.log