| |

Cara Install WordPress di AlmaLinux 8, Centos, RockyLinux dan RHEL

WordPress adalah salah satu CMS open source yang popular berjalan diatas php dan mysql/mariadb. Artikel ini akan membhasa cara install WordPress di linux dengan minimal install tanpa Control Panel.

Ada beberapa hal yang perlu di persiapkan sebelumnya, yaitu sudah terinstallnya LAMP (Apache, Mysql/mariaDB dan PHP) untuk yang belum install silahkan baca terlebih dahulu link install LAMP dibawah ini.

Cara Install Apache, Mysql / MariaDB dan PHP ( LAMP ) di AlmaLinux 8

Download WordPress

Pertama tentukan lokasi direktori wordpress, dalam contoh ini dipilih lokasi instalasi adalah /var/www/ dan download wordpress

# cd /var/www/
# wget https://wordpress.org/latest.tar.gz

progress nya seperti dibawah ini, file latest.tar.gz sudah berhasil di download

[root@alma8 ~]# cd /var/www/
[root@alma8 www]# wget https://wordpress.org/latest.tar.gz
--2023-04-28 05:54:19--  https://wordpress.org/latest.tar.gz
Resolving wordpress.org (wordpress.org)... 198.143.164.252
Connecting to wordpress.org (wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23018887 (22M) [application/octet-stream]
Saving to: ‘latest.tar.gz’

latest.tar.gz       100%[===================>]  21.95M   238KB/s    in 1m 41s

2023-04-28 05:56:01 (224 KB/s) - ‘latest.tar.gz’ saved [23018887/23018887]

[root@alma8 www]# ls
cgi-bin  html  latest.tar.gz  sobit-test.com  tes.sobit-test.com
[root@alma8 www]#

Membuat Database WordPress MariaDB

Kemudian buat database terlebih dahulu untuk wordpress.

# mariadb
MariaDB [(none)]> create database wp_dbase;
MariaDB [(none)]> create user 'wp_ubase'@'localhost' identified by 'c0b43n4k';
MariaDB [(none)]> grant all on wp_dbase.* to 'wp_ubase'@'localhost' identified by 'c0b43n4k' with grant option;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit

Ekstrak file WordPress dan konfig file

Lanjut extract file latest.tar.gz

# tar -xvzf latest.tar.gz
# cd wordpress

Setelah masuk kedalam direktori /var/www/wordpress copy file sample config lalu edit isinya.

[root@alma8 wordpress]# pwd
/var/www/wordpress
[root@alma8 wordpress]# cp wp-config-sample.php wp-config.php
[root@alma8 wordpress]# vi wp-config.php

Ubah isinya sesuai kebutuhan, pada contoh dibawah ini menggunakan value berikut ini.
database : wp_dbase
user database : wp_ubase
database Password : c0b43n4k
hostname : localhost

/** The name of the database for WordPress */
define( 'DB_NAME', 'wp_dbase' );

/** Database username */
define( 'DB_USER', 'wp_ubase' );

/** Database password */
define( 'DB_PASSWORD', 'c0b43n4k' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

Set ownership dan permission file dan direktori wordpress

[root@alma8 wordpress]# chown -R apache:apache ./
[root@alma8 wordpress]# find ./ -type f -name "*.php" -print -exec chmod 644 {} \;
[root@alma8 wordpress]# find ./ -type d -print -exec chmod 750 {} \;

Konfigurasi VirtualHost Apache

Selanjutnya setting konfigurasi VirtualHost Apache. Karena wordpress ini akan digunakan oleh custom domain sobit-test.com makan akan dibuat file berikut ini.

vi /etc/httpd/conf.d/sobit-test.com.conf

lalu isikan dengan

<VirtualHost *:80>
    ServerName www.sobit-test.com
    ServerAlias sobit-test.com
    #DocumentRoot /var/www/sobit-test.com/public_html
    DocumentRoot "/var/www/wordpress"

    <Directory /var/www/wordpress>
        DirectoryIndex index.html index.php
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

   #ErrorLog /var/www/sobit-test.com/log/error.log
   #CustomLog /var/www/sobit-test.com/log/sobit-test.com-access.log combined
   ErrorLog "/var/www/wordpress/error.log"
   CustomLog "/var/www/wordpress/sobit-test.com-access.log" combined

</VirtualHost>

Konfigurasi di atas dan nama domain bisa kalian sesuaikan dengan kebutuhan.

Konfigurasi Selinux

Untuk yang Selinux enable atau aktif bisa memodifikasi terlebih dahulu policy selinux untuk direktori /var/www/wordpress, Jika Selinux kalian disabled bisa skip bagian ini

# semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/wordpress(/.*)?"
# restorecon -R -v /var/www/wordpress

Jika sudah Selesai maka bisa lanjutkan ke restart service apache

# systemctl restart httpd

Sampai disini konfigurasi di sisi Server sudah selesai.

Instalasi Akhir dan Setup WordPress melalui browser

Dilanjutkan dari setup wordpress dari browser. Akses domain atau ip dari browser. Dalam contoh ini ketika domain sobit-test.com diakses makan akan tampil halaman instalasi.

install wordpress

Isikan sesuai dengan kebutuhan. jika sudah klik Install WordPress

Bila sukses akan menampilkan halaman success, bisa klik Log in

Dan kalian bisa login ke dashboard wordpress dengan user dan password di tahap instalasi wordpress.

Klik Log in, dan kalian akan masuk ke dashboard WordPress.

Sampai Disini maka instalasi Sudah selesai, dan tutorial cara install wordpress sudah selesai. Semoga bermanfaat. Salam.

Similar Posts

4 1 vote
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments