Install PhpMyAdmin latest version, untuk mencari versi terakhir/latest dari PhpMyAdmin dapat dilihat diwebsite resmi dari phpmyadmin https://phpmyadmin.net/files
cd /home wget https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.zip apt install unzip -y unzip phpMyAdmin-5.1.1-all-languages.zip
lalu pindahkan folder phpmyadmin yang sudah di unzip ke dalam folder /share
mv phpMyAdmin-*/ /usr/share/phpmyadmin
tahap selajutnya buat sebuah di directory untuk phpmyadmin temp file, lalu atur permission.
mkdir -p /var/lib/phpmyadmin/tmp chown -R www-data:www-data /var/lib/phpmyadmin
Buat directory dari phpmyadmin, ini berfungsi jika ingin menggunakan password authentikasi
mkdir /etc/phpmyadmin
Langkah 4 : Edit File Konfigurasi PhpMyAdmin
Ganti nama file config dari phpmyadmin.
cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
Edit file config.inc.php dan masukan blowfich_secret
nano /usr/share/phpmyadmin/config.inc.php
Cari $cfg[‘blowfish_secret’] lalu isi generate secret seperti command dibawah:
$cfg['blowfish_secret'] = 'VlhyKab[niEixkYCfMepu:wC4c=0fzb,';
Buat Temp directory pada konfigurasi phpmyadmin:
$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';
Langkah 5 : Konfigurasi Apache WebServer (Install PhpMyadmin Ubuntu 20.04)
dan Menambahkan Apache file konfigurasi di dalam file:
nano /etc/apache2/conf-enabled/phpmyadmin.conf
copy/paste command berikut ini :
Alias /phpmyadmin /usr/share/phpmyadmin <Directory /usr/share/phpmyadmin> Options SymLinksIfOwnerMatch DirectoryIndex index.php <IfModule mod_php5.c> <IfModule mod_mime.c> AddType application/x-httpd-php .php </IfModule> <FilesMatch ".+\.php$"> SetHandler application/x-httpd-php </FilesMatch> php_value include_path . php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/ php_admin_value mbstring.func_overload 0 </IfModule> <IfModule mod_php.c> <IfModule mod_mime.c> AddType application/x-httpd-php .php </IfModule> <FilesMatch ".+\.php$"> SetHandler application/x-httpd-php </FilesMatch> php_value include_path . php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/ php_admin_value mbstring.func_overload 0 </IfModule> </Directory> # Authorize for setup <Directory /usr/share/phpmyadmin/setup> <IfModule mod_authz_core.c> <IfModule mod_authn_file.c> AuthType Basic AuthName "phpMyAdmin Setup" AuthUserFile /etc/phpmyadmin/htpasswd.setup </IfModule> Require valid-user </IfModule> </Directory> # Disallow web access to directories that don't need it <Directory /usr/share/phpmyadmin/templates> Require all denied </Directory> <Directory /usr/share/phpmyadmin/libraries> Require all denied </Directory> <Directory /usr/share/phpmyadmin/setup/lib> Require all denied </Directory>
setelah itu restart apache webserver
systemctl restart apache2
Langkah 6 : Install Mysql Database Server (Install PhpMyadmin Ubuntu 20.04)
Install Mysql-Server sebagai database:
apt install mysql-server -y
Memberikan password untuk database
sudo mysql_secure_installation
Masuk ke database melaui command berikut ini.
mysql -u root
Buat user dan password database dengan privileges nya sama dengan root.
CREATE USER 'usertest'@'localhost' IDENTIFIED BY 'Your-Password'; GRANT ALL PRIVILEGES ON *.* TO 'usertest'@'localhost'; FLUSH PRIVILEGES; exit
Langkah 7 : Akses PhpMyAdmin Di Browser
Jika sudah berjalan baik, ketikkan di browser anda alamat ip server. http://[your-ip-address] or http://[yourdomain/phpmyamdin]
Akses URL http://[Your-Ipaddress]/phpmyadmin
Sekiat Dokumentasi Install PhpMyAdmin, Semoga bermanfaat dan bisa menajdi pembelajran bagi kita semua.
Tidak ada komentar:
Posting Komentar