Last active
August 29, 2015 14:08
-
-
Save ivanbarlog/d9fa61561c076fcd8151 to your computer and use it in GitHub Desktop.
Installation script for Adminer - LAMP on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
V=${1-"4.2.0"} | |
curl http://www.adminer.org/latest-en.php -L --create-dirs -o /var/www/src/adminer-${V}/index.php | |
chown -R ivan:ivan adminer-${V}/ | |
chmod -R 0755 adminer-${V}/ | |
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/adminer-${V}.conf | |
sed -i -e 's/#ServerName www.example.com/ServerName adminer.dev/g;s/\/var\/www\/html/\/var\/www\/http\/adminer/g;s/.log/_adminer.log/g' /etc/apache2/sites-available/adminer-${V}.conf | |
a2ensite adminer-${V}.conf | |
service apache2 reload | |
if ! grep -q adminer /etc/hosts; then | |
echo "127.0.0.1 adminer.dev" >> /etc/hosts | |
fi | |
mkdir -p /var/www/http | |
cd /var/www/http | |
ln -s ../src/adminer-${V} adminer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment