Skip to content

Instantly share code, notes, and snippets.

@DmitryMiroshnichenko
Forked from dwelch2344/installOpenVbx.sh
Last active July 15, 2017 19:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DmitryMiroshnichenko/52816fa390eb681b6d83 to your computer and use it in GitHub Desktop.
Save DmitryMiroshnichenko/52816fa390eb681b6d83 to your computer and use it in GitHub Desktop.
A simple install script to setup OpenVbx on an Debian for Google Compute Engine
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
export DBNAME="openvbxexmpl"
export DBUSER="openvbx"
export DBPASS="openVbxSecretPass"
apt-get -y update
apt-get -y upgrade
apt-get -y install apache2 php5 libapache2-mod-php5 php5-mysql libapache2-mod-auth-mysql php5-curl git mysql-server
echo "Initializing database $DBNAME; please have your root MySQL password ready"
mysql -p -e "create database if not exists $DBNAME; GRANT ALL PRIVILEGES ON $DBNAME.* to $DBUSER@localhost IDENTIFIED BY '$DBPASS'; FLUSH PRIVILEGES;"
service apache2 restart
cd /var/www
rm -f index.html
git clone git://github.com/twilio/OpenVBX.git
cp -rf OpenVBX/ calls
rm -Rf OpenVBX/
sed -i -e "s/# RewriteBase \/openvbx/RewriteBase \/calls/g" /var/www/calls/.htaccess
chmod 777 -Rf /var/www/calls/OpenVBX/config
chmod 777 -Rf /var/www/calls/audio-uploads
echo "Succeed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment