Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ Vagrant.configure("2") do |config|
# Install Android
# config.vm.provision "shell", path: "#{github_url}/scripts/android.sh"

# Install phpMyAdmin
# config.vm.provision "shell", path: "#{github_url}/scripts/phpmyadmin.sh", args: [mysql_root_password]

####
# Local Scripts
# Any local scripts you may want to run post-provisioning.
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Here's a quickstart screencast!
* MailCatcher
* Ansible
* Android
* phpMyAdmin

## The Vagrantfile

Expand Down
58 changes: 58 additions & 0 deletions scripts/phpmyadmin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash

echo ">>> Installing phpMyAdmin"

# Test if Apache is installed
apache2 -v > /dev/null 2>&1 || { printf "!!! Apache is not installed.\n Installing phpMyAdmin aborted!\n"; exit 0; }

# Test if PHP is installed
php -v > /dev/null 2>&1 || { printf "!!! PHP is not installed.\n Installing phpMyAdmin aborted!\n"; exit 0; }

# Configure phpMyAdmin
echo "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections
echo "phpmyadmin phpmyadmin/app-password-confirm password $1" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/admin-pass password $1" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/app-pass password $1" | debconf-set-selections
echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections

# Install phpMyAdmin
export DEBIAN_FRONTEND=noninteractive
apt-get install -qq phpmyadmin

# Configure Apache 2

echo "
Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php

<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>

</Directory>

<Directory /usr/share/phpmyadmin/setup>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName \"phpMyAdmin Setup\"
AuthUserFile /etc/phpmyadmin/htpasswd.setup
</IfModule>
Require valid-user
</Directory>

<Directory /usr/share/phpmyadmin/libraries>
Order Deny,Allow
Deny from All
</Directory>

<Directory /usr/share/phpmyadmin/setup/lib>
Order Deny,Allow
Deny from All
</Directory>
" > /etc/apache2/conf-enabled/phpmyadmin.conf

# Restart Apache
/etc/init.d/apache2 restart