phpMyAdmin adalah perangkat lunak yang paling banyak digunakan untuk administrasi database dari database MariaDB/MySQL. phpMyAdmin ditulis dalam PHP dan JavaScript dan didistribusikan di bawah lisensi GNU GPL 2
MariaDB/MySQL tidak menyertakan antarmuka GUI asli untuk administrasi basis data. Oleh karena itu, kami menginstal phpMyAdmin berdampingan di server MariaDB/MySQL untuk menyediakan antarmuka pengguna web ke sysadmin dan pengembang
Di lab ini, Anda akan belajar cara menginstal phpMyAdmin di server CentOS 8
Artikel Ini Menyediakan
Fitur phpMyAdmin
Beberapa fitur dari phpMyAdmin adalah
- membuat, menelusuri, mengedit, dan menjatuhkan database, tabel, tampilan, kolom, dan indeks
- membuat, menyalin, menjatuhkan, mengganti nama, dan mengubah basis data, tabel, kolom, dan indeks
- jalankan, edit, dan tandai semua pernyataan SQL, bahkan kueri batch
- memuat file teks ke dalam tabel
- membuat dan membaca tumpukan tabel
Untuk daftar lengkap fitur, silakan lihat dokumentasi phpMyAdmin
Persyaratan Sistem phpMyAdmin
phpMyAdmin 5. 0. 1 membutuhkan prasyarat perangkat lunak berikut
- Server web – Apache, nginx, IIS
- PHP-7. 1. 3 atau lebih baru
- Basis data – MySQL/MariaDB 5. 5 atau lebih baru
Spesifikasi Lingkungan
Kami menggunakan mesin virtual CentOS 8 minimal dengan spesifikasi sebagai berikut
- CPU - 3. 4 Ghz (2 inti)
- Memori - 2 GB
- Penyimpanan - 20 GB
- Sistem Operasi - CentOS 8. 0
- Nama host – phpmyadmin-01. sysadminlabs. com
- Alamat IP - 192. 168. 116. 206 /24
Menginstal LAMP Stack di CentOS 8
phpMyAdmin adalah aplikasi web berbasis PHP yang membutuhkan preprosesor hiperteks PHP dan server web yang didukung untuk penyebaran
Oleh karena itu, kami menginstal tumpukan LAMP (Linux, Apache, MySQL, dan PHP) di CentOS 8 kami
Apache, MariaDB (varian MySQL) dan PHP tersedia di repositori yum standar, sehingga kita dapat menginstalnya menggunakan perintah dnf
# dnf install -y @mariadb @httpd @phpInstal paket php-mysqlnd untuk konektivitas PHP ke MariaDB
# dnf install -y php-mysqlnd_
Aktifkan dan mulai layanan MariaDB
# systemctl enable --now mariadb.service Created symlink /etc/systemd/system/mysql.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/mysqld.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service â /usr/lib/systemd/system/mariadb.service.Konfigurasikan instance MariaDB dan tetapkan kata sandi pengguna root
# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. .. Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y .. Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y .. Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... .. Success! - Removing privileges on test database... .. Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y .. Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!Uji konektivitas basis data MariaDB
# mysql -u root -p123 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 16 Server version: 10.3.17-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>_Buat direktori untuk menyimpan sertifikat SSL dan kunci pribadi
# mkdir /etc/httpd/sslHasilkan sertifikat SSL yang ditandatangani sendiri menggunakan perintah openssl. Anda juga dapat membuat CSR (Permintaan Penandatanganan Sertifikat) dan membuatnya ditandatangani oleh Server Otoritas Sertifikat di jaringan Anda
# openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/httpd/ssl/lamp.crt -keyout /etc/httpd/ssl/lamp.key Generating a RSA private key ...........................+++++ .............................................................+++++ writing new private key to '/etc/httpd/ssl/lamp.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:PK State or Province Name (full name) []:Sindh Locality Name (eg, city) [Default City]:Karachi Organization Name (eg, company) [Default Company Ltd]:Ahmer's SysAdmin Recipes Organizational Unit Name (eg, section) []:IT Lab Common Name (eg, your name or your server's hostname) []:phpmyadmin-01.sysadminlabs.com Email Address []:root@phpmyadmin-01.sysadminlabs.com_Edit file konfigurasi Apache untuk menambahkan sertifikat SSL dan kunci pribadi
# vi /etc/httpd/conf.d/ssl.confTemukan dan perbarui arahan berikut dalam file ini
SSLCertificateFile /etc/httpd/ssl/lamp.crt SSLCertificateKeyFile /etc/httpd/ssl/lamp.key_Aktifkan dan mulai layanan Apache
Aktifkan dan mulai layanan php-fpm
# dnf install -y php-mysqlnd_0
Izinkan port layanan default Apache di firewall CentOS 8
# dnf install -y php-mysqlnd_1
Buka URL https. //phpmyadmin-01. sysadminlabs. com di browser web
Jika Anda menggunakan sertifikat SSL yang ditandatangani sendiri, browser akan menampilkan peringatan keamanan. Abaikan dan lanjutkan
Server LAMP kami telah berhasil dikonfigurasi
Menginstal phpMyAdmin di server CentOS 8 LAMP
Unduh versi terbaru phpMyAdmin dari situs web resmi phpMyAdmin
Saat ini, phpMyAdmin 5. 0. 1 adalah rilis stabil terbaru. Oleh karena itu, kami mengunduhnya dari halaman unduhan resmi phpMyAdmin
# dnf install -y php-mysqlnd_2
Ekstrak TARBall yang diunduh di root dokumen default Apache
# dnf install -y php-mysqlnd_3
Ganti nama direktori yang diekstraksi untuk aksesibilitas yang lebih baik
_4
Buat database phpMyAdmin dan objek terkait di server MariaDB menggunakan skrip yang disediakan oleh vendor di direktori phpMyAdmin
# dnf install -y php-mysqlnd_5
Buat salinan file konfigurasi sampel
# dnf install -y php-mysqlnd_6
Mengedit konfigurasi. termasuk. php dalam editor teks
# dnf install -y php-mysqlnd_7
Tetapkan rahasia Blowfish 32 karakter dalam file ini
# dnf install -y php-mysqlnd_8
Buat direktori sementara untuk menyimpan template dengan phpMyAdmin
# dnf install -y php-mysqlnd_9
Tetapkan pengguna apache sebagai pemilik direktori pma
# systemctl enable --now mariadb.service Created symlink /etc/systemd/system/mysql.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/mysqld.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service â /usr/lib/systemd/system/mariadb.service.0Tetapkan izin SELinux untuk direktori tmp, agar dapat ditulis oleh pengguna apache
# systemctl enable --now mariadb.service Created symlink /etc/systemd/system/mysql.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/mysqld.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service â /usr/lib/systemd/system/mariadb.service.1Buka URL https. //phpmyadmin-01. sysadminlabs. com/pma/ di browser web
Masuk sebagai pengguna root
Setelah berhasil login, Anda akan sampai di Dashboard aplikasi phpMyAdmin
Kami telah berhasil menginstal phpMyAdmin di server CentOS 8 LAMP. Untuk mulai menggunakan phpMyAdmin, Anda harus membaca Menguasai phpMyAdmin 3. 4 untuk Manajemen MySQL yang Efektif oleh Packt Publishing