45 lines
1.2 KiB
Bash
45 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
OC_GIT="https://github.com/OpencachingDeutschland/oc-server3.git"
|
|
|
|
# This is an automated script, don't ask questions
|
|
export DEBIAN_FRONTEND="noninteractive"
|
|
|
|
# Update repositories
|
|
apt-get update
|
|
|
|
# Install debconf
|
|
#apt-get install -y -f debconf-utils
|
|
|
|
# Pre-set password for MariaDB root user
|
|
#debconf-set-selections <<< 'mariadb-server mariadb-server/root_password password octest'
|
|
#debconf-set-selections <<< 'mariadb-server mariadb-server/root_password_again password octest'
|
|
|
|
# Install PHP, MySQL, Apache2 (/var/www/html)
|
|
apt-get install -y -f apache2 mariadb-server mariadb-client libapache2-mod-php5filter
|
|
if ! [ -L /var/www ]; then
|
|
rm -rf /var/www
|
|
ln -fs /vagrant /var/www
|
|
fi
|
|
|
|
# Copy and activate OCDE Apache configuration
|
|
cp /vagrant/opencaching.conf /etc/apache2/sites-available/
|
|
a2ensite opencaching
|
|
service apache2 reload
|
|
|
|
# Install git
|
|
apt-get install -y -f git
|
|
|
|
# Install ungit
|
|
apt-get install -y -f npm nodejs-legacy
|
|
npm install -g ungit
|
|
|
|
cp /vagrant/.ungitrc /home/vagrant/
|
|
|
|
sudo -u vagrant nohup ungit >/tmp/ungit.log 2>&1 &
|
|
|
|
# Checkout OCDE code if not already there
|
|
if [ ! -d /var/www/html/ocde/.git ]; then
|
|
sudo -u vagrant git clone $OC_GIT /var/www/html/ocde
|
|
fi
|