23 lines
615 B
Bash
Executable File
23 lines
615 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# generate globals.php from environment variables
|
|
cd /var/www/html
|
|
|
|
echo "<?php define('SQL_USER', '${PHW_SQL_USER}'); define('SQL_PASS', '${PHW_SQL_PASS}'); define('SQL_DB', '${PHW_SQL_DB}'); define('SQL_IP', '${PHW_SQL_IP}');" > globals.php
|
|
|
|
# create ARTWORKS directories
|
|
mkdir -p ARTWORKS/incoming
|
|
mkdir -p ARTWORKS/thumbnails
|
|
mkdir -p ARTWORKS/published
|
|
|
|
# change owner to www-data
|
|
chown -R www-data:www-data ARTWORKS
|
|
|
|
# substitute server name
|
|
sed -i "s|ServerName|ServerName ${PHW_SERVER_NAME}|g" /etc/apache2/sites-available/000-default.conf
|
|
|
|
|
|
# start webserver
|
|
/usr/sbin/apache2ctl -D FOREGROUND
|
|
|