-
Notifications
You must be signed in to change notification settings - Fork 8
Stack Script for deploying EgoWeb with www.linode.com
The script below is available in the www.linode.com stack script library. This StackScript installs EgoWeb and all software required to run EgoWeb on linode. Most of the code should work on other systems.
#!/bin/bash
set -e
# <UDF name="db_password" Label="MySQL root Password" />
DB_NAME="egoweb"
DB_USER="egowebuser"
DB_USER_PASSWORD="egowebpass"
echo "db_name is $DB_NAME"
echo "db_user is $DB_USER"
echo "db_user_password is $DB_USER_PASSWORD"
source <ssinclude StackScriptID="1">
system_update
postfix_install_loopback_only
mysql_install "$DB_PASSWORD" && mysql_tune 40
mysql_create_database "$DB_PASSWORD" "$DB_NAME"
mysql_create_user "$DB_PASSWORD" "$DB_USER" "$DB_USER_PASSWORD"
mysql_grant_user "$DB_PASSWORD" "$DB_USER" "$DB_NAME"
php_install_with_apache && php_tune
apache_install && apache_tune 40
goodstuff
a2enmod rewrite
sudo apt-get install -y php5-mcrypt
sudo php5enmod mcrypt
sudo apt-get install -y git
echo 'CLONING EGOWEB FROM GIT'
git clone https://github.com/qualintitative/egoweb
echo 'REMOVING DEFAULT WEB FILES'
sudo rm -rf /var/www/*
echo 'ADDING EGOWEB FILES TO WEB DIRECTORY'
sudo cp -r egoweb/egowebWebApp/. /var/www/html/
echo 'SETTING UP TABLES IN MYSQL FOR EGOWEB - USE SQL FILE AS SOURCE'
echo "SOURCE /egoweb/sql/egoweb_db.sql" | mysql egoweb -u root -p$DB_PASSWORD
ELINENOF=$(grep -n '/var/www/' /etc/apache2/apache2.conf |cut -f1 -d:)
echo "lineno is $ELINENOF"
ELINENO=$(($ELINENOF + 2))
echo "lineno is $ELINENO"
echo "$ELINENO s/None/All/"
sed -i -e "$ELINENO s/None/All/" /etc/apache2/apache2.conf
restartServices
cd /var/www/html
./initialize.sh