Cara Instal WordPress di Linux Debian 12
Cara Instal WordPress di Linux Debian 12
Halo teman-teman, selamat datang di blog saya! Pada kesempatan kali ini, saya akan membahas cara menginstal WordPress di Linux Debian 12.
Sebelum masuk ke tahap proses instalasi, ada beberapa persyaratan yang harus dipenuhi diantaranya:
- Sistem operasi Debian 12
- Koneksi internet
- Kopi (biar makin nikmat)
Kalau persyaratan diatas sudah terpenuhi, langsung saja kita ke tahap proses instalasinya...
Tahap 1 - Masuk ke Mode root (super user)
$ su
Tahap 2 - Persiapan Sistem
Update repositori Debian 12:
$ apt-get update && apt-get upgrade
Tahap 3 - Export Path /sbin
$ echo 'export PATH="$PATH:/sbin:/usr/sbin"' >> ~/.bashrc $ source ~/.bashrc
Kenapa harus di export ke file .bashrc, karena agar bisa menggunakan perintah a2enmod secara langsung tanpa harus mengetikkan path lengkapnya /sbin/a2enmod.
Tahap 4 - Install Apache (Web Server)
$ apt-get install apache2
Tahap 5 - Aktifkan Web Server (Apache)
$ systemctl enable apache2 $ systemctl start apache2 $ systemctl status apache2
Pastikan statusnya active (running).
Tahap 6 - Instal Database Server (MariaDB)
$ apt-get install mariadb-server
Lakukan konfigurasi keamanan dasar MariaDB:
$ mysql_secure_installation
Kalo muncul pertanyaan seperti ini:
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 haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none):
Masukkan password untuk root.
Kalo muncul pertanyaan seperti ini:
Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n]
Jawab: 'n'.
Kalo muncul pertanyaan seperti ini:
You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n]
Jawab: 'n'.
Kalo muncul pertanyaan seperti ini:
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]
Jawab: 'y'.
Kalo muncul pertanyaan seperti ini:
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]
Jawab: 'y'.
Kalo muncul pertanyaan seperti ini:
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]
Jawab: 'y'.
Kalo muncul pertanyaan seperti ini:
Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n]
Jawab: 'y'.
Tahap 7 - Install PHP dan Ekstensi WordPress
$ apt install php php-mysqli php-xml php-curl php-gd php-mbstring php-zip php-soap php-intl $ php -v
Tahap 8 - Buat Database dan User WordPress
Login ke MariaDB:
$ mariadb
Jalankan perintah berikut di MariaDB:
CREATE DATABASE wordpress; CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'passwordku'; GRANT ALL PRIVILEGES ON wordpress.* TO 'wp_user'@'localhost'; FLUSH PRIVILEGES; EXIT;
Penjelasan:
- wordpress: nama database.
- wp_user: nama user database.
- passwordku: ganti dengan password yang kuat.
Tahap 9 - Download dan Pindahkan WordPress
$ cd /tmp $ wget https://wordpress.org/latest.tar.gz $ tar -xvzf latest.tar.gz
Backup file index.html:
$ mv /var/www/html/index.html /var/www/html/index.html.backup
Salin isi folder WordPress ke root web:
$ cp -r wordpress/* /var/www/html/
Ubah kepemilikan file:
$ chown -R www-data:www-data /var/www/html/
Tahap 10 - Konfigurasi wp-config.php
Salin file konfigurasi contoh:
$ cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
Edit file wp-config.php:
$ nano /var/www/html/wp-config.php
Ubah bagian ini:
define( 'DB_NAME', 'wordpress' ); define( 'DB_USER', 'wp_user' ); define( 'DB_PASSWORD', 'passwordku' ); define( 'DB_HOST', 'localhost' );
Tambahkan juga kunci keamanan (Security Keys) yang dapat dihasilkan dari: https://api.wordpress.org/secret-key/1.1/salt/
Tahap 11 - Aktifkan Mod Rewrite dan Virtual Host
Aktifkan module rewrite:
$ a2enmod rewrite
Edit konfigurasi default Apache:
$ nano /etc/apache2/sites-available/000-default.conf
Tambahkan/ubah bagian <Directory>
:
<Directory /var/www/html/> AllowOverride All </Directory>
Restart Apache:
$ systemctl restart apache2
Tahap 12 - Selesaikan Instalasi Lewat Browser
Buka browser dan akses:
http://IP_ADDRESS_KAMU
Kamu akan melihat halaman setup WordPress. Lanjutkan dengan:
- Pilih bahasa
- Masukkan nama situs
- Buat akun admin WordPress
- Masukkan email
- Selesai
Tahap 13 - Login ke Dashboard
Setelah instalasi selesai, akses:
http://IP_ADDRESS_KAMU/wp-admin
Login menggunakan akun admin yang tadi kamu buat.
WordPress Siap Digunakan!
Itu dia pembahasan saya tentang cara menginstal WordPress di Linux Debian 12. Semoga bermanfaat! Kalo ada pertanyaan bisa ditanyakan dikolom komentar :)
Komentar
Posting Komentar