Difference between revisions of "Installing phpMyAdmin Manually"

From Sympl Wiki
Jump to navigation Jump to search
(Created page with "This guide covers installing [https://www.phpmyadmin.net phpMyAdmin] on a server running Sympl 10.x, on Debian Buster. phpMyAdmin is included in Sympl 9.x, as the package is i...")
 
Line 1: Line 1:
 +
{{Beta Documentation}}
 +
 
This guide covers installing [https://www.phpmyadmin.net phpMyAdmin] on a server running Sympl 10.x, on Debian Buster. phpMyAdmin is included in Sympl 9.x, as the package is included in Debian Stretch.
 
This guide covers installing [https://www.phpmyadmin.net phpMyAdmin] on a server running Sympl 10.x, on Debian Buster. phpMyAdmin is included in Sympl 9.x, as the package is included in Debian Stretch.
  
 
This guide is aimed at moderate-to-experienced users, and as such care should be taken when following it.
 
This guide is aimed at moderate-to-experienced users, and as such care should be taken when following it.
  
=== Installing phpMyAdmin ===
+
===Installing phpMyAdmin===
 
<code>cd</code> to your destination htdocs dir, such as a subdirectory of an existing site (<code>'''example.com'''/phpmyadmin</code>), or a separate subdomain (<code>phpmyadmin.'''example.com'''</code>)
 
<code>cd</code> to your destination htdocs dir, such as a subdirectory of an existing site (<code>'''example.com'''/phpmyadmin</code>), or a separate subdomain (<code>phpmyadmin.'''example.com'''</code>)
 
  wget <nowiki>https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz</nowiki> -O - | tar -zxv --strip 1
 
  wget <nowiki>https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz</nowiki> -O - | tar -zxv --strip 1
Line 28: Line 30:
 
You should then be able to browse to the site, log in with the username <code>phpmyadmin</code> and the password specified, and then log into individual databases or as the <code>sympl</code> user which has the equivalent of <code>root</code> access.
 
You should then be able to browse to the site, log in with the username <code>phpmyadmin</code> and the password specified, and then log into individual databases or as the <code>sympl</code> user which has the equivalent of <code>root</code> access.
  
=== Things to know ===
+
===Things to know===
  
* The password for the <code>sympl</code> database user can be found in <code>/home/sympl/mysql_password</code>.
+
*The password for the <code>sympl</code> database user can be found in <code>/home/sympl/mysql_password</code>.
* If databases were created with <code>sympl create database</code>, their passwords can be found in <code>/home/sympl/mysql_'''''databasename'''''_password</code>
+
*If databases were created with <code>sympl create database</code>, their passwords can be found in <code>/home/sympl/mysql_'''''databasename'''''_password</code>
* Initial authentication (and users) can be updated in <code>/home/sympl/phpmyadmin.passwd</code> in normal [[htpasswd]] format. phpMyAdmin has no automatic updating, so ensure you use a '''''strong''''' password.
+
*Initial authentication (and users) can be updated in <code>/home/sympl/phpmyadmin.passwd</code> in normal [[htpasswd]] format. phpMyAdmin has no automatic updating, so ensure you use a '''''strong''''' password.
* The safest way to update phpMyAdmin at present would be to follow these instructions again.
+
*The safest way to update phpMyAdmin at present would be to follow these instructions again.
  
 
[[Category:Beta Documentation]]
 
[[Category:Beta Documentation]]
 
[[Category:Stub]]
 
[[Category:Stub]]

Revision as of 17:50, 2 January 2020

This article is Beta Documentation. It may have missing elements, or be unclear in places.
Please feel free to make corrections or amendments, or ask for help on the Sympl Forum

This guide covers installing phpMyAdmin on a server running Sympl 10.x, on Debian Buster. phpMyAdmin is included in Sympl 9.x, as the package is included in Debian Stretch.

This guide is aimed at moderate-to-experienced users, and as such care should be taken when following it.

Installing phpMyAdmin

cd to your destination htdocs dir, such as a subdirectory of an existing site (example.com/phpmyadmin), or a separate subdomain (phpmyadmin.example.com)

wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz -O - | tar -zxv --strip 1

sympl create database phpmyadmin

cat sql/create_tables.sql | mysql -u phpmyadmin -p$( cat /home/sympl/mysql_phpmyadmin_password ) phpmyadmin

rm -rf setup/ test/

mkdir tmp ; sudo chown www-data:www-data tmp ; sudo chmod 770 tmp

cp config.sample.inc.php config.inc.php

echo "\$cfg['blowfish_secret'] = '$( openssl rand -base64 32 | cut -c 1-32 )';" >> config.inc.php

echo "\$cfg['UploadDir'] = '$(pwd | cut -d'/' -f 1-4)';" >> config.inc.php
echo "\$cfg['SaveDir'] = '$(pwd | cut -d'/' -f 1-4)';" >> config.inc.php

echo -e "AuthType Basic\nAuthName \"Restricted Access\"\nAuthUserFile /home/sympl/phpmyadmin.passwd\nRequire valid-user\n" > .htaccess

Now, set the access up:

touch $(pwd | cut -d'/' -f 1-3)/config/ssl-only # enforce ssl-only mode for the site.
htpasswd -c /home/sympl/phpmyadmin.passwd phpmyadmin # set a password

You should then be able to browse to the site, log in with the username phpmyadmin and the password specified, and then log into individual databases or as the sympl user which has the equivalent of root access.

Things to know

  • The password for the sympl database user can be found in /home/sympl/mysql_password.
  • If databases were created with sympl create database, their passwords can be found in /home/sympl/mysql_databasename_password
  • Initial authentication (and users) can be updated in /home/sympl/phpmyadmin.passwd in normal htpasswd format. phpMyAdmin has no automatic updating, so ensure you use a strong password.
  • The safest way to update phpMyAdmin at present would be to follow these instructions again.