Skip to content

Commit 86b9226

Browse files
committed
Added PhpPgAdmin & phpMyadmin to manage databases via webbrowser
1 parent e2a724b commit 86b9226

File tree

6 files changed

+271
-5
lines changed

6 files changed

+271
-5
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Limesurvey-Vagrant
22
Pre-configured LimeSurvey Vagrant Box based on Ubuntu Bionic 64bit + PHP7.4 + Mysql + Postgresql + Nginx
3+
Additional modules:
4+
- PhpMyAdmin (To manage the Databases via webbrowser )
5+
- phpPgAdmin (To manage Postgresql Databases via webbrowser )
36

47
# Pre-installation Requirements
58
- Enable VT-x
@@ -63,18 +66,22 @@ Pre-configured LimeSurvey Vagrant Box based on Ubuntu Bionic 64bit + PHP7.4 + My
6366
- Php7.4 | Php5.6 + Depencies + Libraries
6467
- Mysql server
6568
- Postgresql server
69+
- PhpMyAdmin
70+
- PhpPgAdmin
6671
- Latest version (Master) of Limesurvey
6772

6873
# Default Mysql Login
6974
- MySql DB = "limesurvey"
7075
- MySql User = "limesurvey"
7176
- Mysql Root Password = "password"
7277
- MySql User Password = "password"
78+
- Management UI: http://your_ip/phpmyadmin (Default: http://10.0.0.10/phpmyadmin)
7379

7480
# Default Postgresql Login
7581
- pg DB = "limesurvey"
7682
- pg User = "postgres"
7783
- pg Password = "password"
84+
- Management UI: http://your_ip/phppgadmin (Default: http://10.0.0.10/phppgadmin)
7885

7986
# Default IP address of the webserver after installation
8087
- 10.0.0.10

Vagrantfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Developer: Eddy Lackmann
55
# Github:https://github.com/eddylackmann
6-
# Last update: 18 february 2020
6+
# Last update: 24 June 2020
77
# Email: a.eddy@hotmail.de
88

99
# Vagrant Configuration for Limesurvey

configuration/5.6/default

+36
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,40 @@ server {
3333
location ~ /\.ht {
3434
deny all;
3535
}
36+
37+
location /phpmyadmin {
38+
root /usr/share/;
39+
index index.php index.html index.htm;
40+
location ~ ^/phpmyadmin/(.+\.php)$ {
41+
try_files $uri =404;
42+
root /usr/share/;
43+
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
44+
fastcgi_index index.php;
45+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
46+
include /etc/nginx/fastcgi_params;
47+
}
48+
49+
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
50+
root /usr/share/;
51+
}
52+
}
53+
54+
location /phppgadmin {
55+
root /usr/share/;
56+
index index.php index.html index.htm;
57+
58+
location ~ ^/phppgadmin/(.+\.php)$ {
59+
try_files $uri =404;
60+
root /usr/share/;
61+
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
62+
fastcgi_index index.php;
63+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
64+
include /etc/nginx/fastcgi_params;
65+
}
66+
67+
68+
location ~* ^/phppgadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
69+
root /usr/share/;
70+
}
71+
}
3672
}

configuration/7.4/default

+36
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,40 @@ server {
3333
location ~ /\.ht {
3434
deny all;
3535
}
36+
37+
location /phpmyadmin {
38+
root /usr/share/;
39+
index index.php index.html index.htm;
40+
location ~ ^/phpmyadmin/(.+\.php)$ {
41+
try_files $uri =404;
42+
root /usr/share/;
43+
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
44+
fastcgi_index index.php;
45+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
46+
include /etc/nginx/fastcgi_params;
47+
}
48+
49+
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
50+
root /usr/share/;
51+
}
52+
}
53+
54+
location /phppgadmin {
55+
root /usr/share/;
56+
index index.php index.html index.htm;
57+
58+
location ~ ^/phppgadmin/(.+\.php)$ {
59+
try_files $uri =404;
60+
root /usr/share/;
61+
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
62+
fastcgi_index index.php;
63+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
64+
include /etc/nginx/fastcgi_params;
65+
}
66+
67+
68+
location ~* ^/phppgadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
69+
root /usr/share/;
70+
}
71+
}
3672
}

configuration/pgadmin.config.php

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<?php
2+
3+
/**
4+
* Central phpPgAdmin configuration. As a user you may modify the
5+
* settings here for your particular configuration.
6+
*
7+
* $Id: config.inc.php-dist,v 1.55 2008/02/18 21:10:31 xzilla Exp $
8+
*/
9+
10+
// An example server. Create as many of these as you wish,
11+
// indexed from zero upwards.
12+
13+
// Display name for the server on the login screen
14+
$conf['servers'][0]['desc'] = 'PostgreSQL';
15+
16+
// Hostname or IP address for server. Use '' for UNIX domain socket.
17+
// use 'localhost' for TCP/IP connection on this computer
18+
$conf['servers'][0]['host'] = 'localhost';
19+
20+
// Database port on server (5432 is the PostgreSQL default)
21+
$conf['servers'][0]['port'] = 5432;
22+
23+
// Database SSL mode
24+
// Possible options: disable, allow, prefer, require
25+
// To require SSL on older servers use option: legacy
26+
// To ignore the SSL mode, use option: unspecified
27+
$conf['servers'][0]['sslmode'] = 'allow';
28+
29+
// Change the default database only if you cannot connect to template1.
30+
// For a PostgreSQL 8.1+ server, you can set this to 'postgres'.
31+
$conf['servers'][0]['defaultdb'] = 'template1';
32+
33+
// Specify the path to the database dump utilities for this server.
34+
// You can set these to '' if no dumper is available.
35+
$conf['servers'][0]['pg_dump_path'] = '/usr/bin/pg_dump';
36+
$conf['servers'][0]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';
37+
38+
// Example for a second server (PostgreSQL for Windows)
39+
//$conf['servers'][1]['desc'] = 'Test Server';
40+
//$conf['servers'][1]['host'] = '127.0.0.1';
41+
//$conf['servers'][1]['port'] = 5432;
42+
//$conf['servers'][1]['sslmode'] = 'allow';
43+
//$conf['servers'][1]['defaultdb'] = 'template1';
44+
//$conf['servers'][1]['pg_dump_path'] = 'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dump.exe';
45+
//$conf['servers'][1]['pg_dumpall_path'] = 'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dumpall.exe';
46+
47+
48+
/* Groups definition */
49+
/* Groups allow administrators to logicaly group servers together under
50+
* group nodes in the left browser tree
51+
*
52+
* The group '0' description
53+
*/
54+
//$conf['srv_groups'][0]['desc'] = 'group one';
55+
56+
/* Add here servers indexes belonging to the group '0' seperated by comma */
57+
//$conf['srv_groups'][0]['servers'] = '0,1,2';
58+
59+
/* A server can belong to multi groups. Here server 1 is referenced in both
60+
* 'group one' and 'group two'*/
61+
//$conf['srv_groups'][1]['desc'] = 'group two';
62+
//$conf['srv_groups'][1]['servers'] = '3,1';
63+
64+
/* A group can be nested in one or more existing groups using the 'parents'
65+
* parameter. Here the group 'group three' contains only one server and will
66+
* appear as a subgroup in both 'group one' and 'group two':
67+
*/
68+
//$conf['srv_groups'][2]['desc'] = 'group three';
69+
//$conf['srv_groups'][2]['servers'] = '4';
70+
//$conf['srv_groups'][2]['parents'] = '0,1';
71+
72+
/* Warning: Only groups with no parents appears at the root of the tree. */
73+
74+
75+
// Default language. E.g.: 'english', 'polish', etc. See lang/ directory
76+
// for all possibilities. If you specify 'auto' (the default) it will use
77+
// your browser preference.
78+
$conf['default_lang'] = 'auto';
79+
80+
// AutoComplete uses AJAX interaction to list foreign key values
81+
// on insert fields. It currently only works on single column
82+
// foreign keys. You can choose one of the following values:
83+
// 'default on' enables AutoComplete and turns it on by default.
84+
// 'default off' enables AutoComplete but turns it off by default.
85+
// 'disable' disables AutoComplete.
86+
$conf['autocomplete'] = 'default on';
87+
88+
// If extra login security is true, then logins via phpPgAdmin with no
89+
// password or certain usernames (pgsql, postgres, root, administrator)
90+
// will be denied. Only set this false once you have read the FAQ and
91+
// understand how to change PostgreSQL's pg_hba.conf to enable
92+
// passworded local connections.
93+
$conf['extra_login_security'] = false;
94+
95+
// Only show owned databases?
96+
// Note: This will simply hide other databases in the list - this does
97+
// not in any way prevent your users from seeing other database by
98+
// other means. (e.g. Run 'SELECT * FROM pg_database' in the SQL area.)
99+
$conf['owned_only'] = false;
100+
101+
// Display comments on objects? Comments are a good way of documenting
102+
// a database, but they do take up space in the interface.
103+
$conf['show_comments'] = true;
104+
105+
// Display "advanced" objects? Setting this to true will show
106+
// aggregates, types, operators, operator classes, conversions,
107+
// languages and casts in phpPgAdmin. These objects are rarely
108+
// administered and can clutter the interface.
109+
$conf['show_advanced'] = false;
110+
111+
// Display "system" objects?
112+
$conf['show_system'] = false;
113+
114+
// Minimum length users can set their password to.
115+
$conf['min_password_length'] = 1;
116+
117+
// Width of the left frame in pixels (object browser)
118+
$conf['left_width'] = 200;
119+
120+
// Which look & feel theme to use
121+
$conf['theme'] = 'default';
122+
123+
// Show OIDs when browsing tables?
124+
$conf['show_oids'] = false;
125+
126+
// Max rows to show on a page when browsing record sets
127+
$conf['max_rows'] = 30;
128+
129+
// Max chars of each field to display by default in browse mode
130+
$conf['max_chars'] = 50;
131+
132+
// Send XHTML strict headers?
133+
$conf['use_xhtml_strict'] = false;
134+
135+
// Base URL for PostgreSQL documentation.
136+
// '%s', if present, will be replaced with the PostgreSQL version
137+
// (e.g. 8.4 )
138+
$conf['help_base'] = 'http://www.postgresql.org/docs/%s/interactive/';
139+
140+
// Configuration for ajax scripts
141+
// Time in seconds. If set to 0, refreshing data using ajax will be disabled (locks and activity pages)
142+
$conf['ajax_refresh'] = 3;
143+
144+
/** Plugins management
145+
* Add plugin names to the following array to activate them
146+
* Example:
147+
* $conf['plugins'] = array(
148+
* 'Example',
149+
* 'Slony'
150+
* );
151+
*/
152+
$conf['plugins'] = array();
153+
154+
/*****************************************
155+
* Don't modify anything below this line *
156+
*****************************************/
157+
158+
$conf['version'] = 19;
159+
160+
?>

provision/provision.sh

+31-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ echo " "
4040
echo " "
4141
echo " "
4242
echo "Packages updated"
43-
echo "################"
43+
echo "#################"
4444
# VBox additions
4545
echo " "
4646
echo " "
@@ -84,7 +84,7 @@ echo " "
8484
echo " "
8585
echo " "
8686
echo "PHP $phpVersion extensions & Libraries installed"
87-
echo "########################################"
87+
echo "################################################"
8888
# Nginx
8989
echo " "
9090
echo " "
@@ -119,12 +119,22 @@ sleep 3s;
119119
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password '"$MysqlRootPass"
120120
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '"$MysqlRootPass"
121121
sudo apt-get -y install mysql-server
122+
echo "MySql installed "
123+
124+
echo "+----------------------+"
125+
echo "+ install PhpMyAdmin +"
126+
echo "+----------------------+"
127+
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/internal/skip-preseed boolean true"
128+
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect"
129+
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean false"
130+
131+
sudo apt-get -y install phpmyadmin
122132
echo " "
123133
echo " "
124134
echo " "
125135
echo " "
126-
echo "MySql installed "
127-
echo "###############"
136+
echo "PhpMyAdmin installed"
137+
echo "####################"
128138
sleep 3s;
129139
# pgsql server
130140
echo " "
@@ -146,7 +156,22 @@ echo " "
146156
echo " "
147157
echo "Postgresql installed "
148158
echo "####################"
159+
echo "+---------------------------+"
160+
echo "+ install PgAdmin +"
161+
echo "+---------------------------+"
162+
163+
164+
sudo apt-get install -y phppgadmin
149165
sleep 3s;
166+
sudo rm /etc/phppgadmin/config.inc.php
167+
168+
sleep 5s
169+
cp /var/www/configuration/pgadmin.config.php /etc/phppgadmin/config.inc.php
170+
echo "PgAdmin installed "
171+
echo "####################"
172+
173+
174+
150175
#setup database
151176
mysql -u root -p$MysqlRootPass -e "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));"
152177
mysql -u root -p$MysqlRootPass -e "CREATE DATABASE $MysqlDBName;"
@@ -156,6 +181,7 @@ echo " "
156181
echo " "
157182
echo " "
158183
sleep 3s;
184+
159185
echo "+----------------------+"
160186
echo "+ Cleaning up +"
161187
echo "+----------------------+"
@@ -210,6 +236,7 @@ echo " "
210236
echo " "
211237
echo " "
212238
echo "You can connect to Webserver at: http://$myIp "
239+
echo "You can acces the mysql database management tool (phpmyadmin) at: http://$myIp/phpmyadmin "
213240
echo " "
214241
echo " "
215242
echo " "

0 commit comments

Comments
 (0)