Table of contents

WordPress adalah sebuah platform sistem manajemen konten (CMS) yang digunakan untuk membuat dan mengelola situs web atau blog. WordPress sangat populer karena kemudahan penggunaannya, tersedianya banyak tema dan plugin. Juga fleksibilitas yang memungkinkan pengguna untuk membuat situs web yang sesuai dengan kebutuhan mereka. Termasuk kamu yang menggunakan sistem operasi Linux Ubuntu.

Berikut adalah cara install WordPress menggunakan Ubuntu 20.4

Install apache

Update apt

sudo apt update

sudo apt upgrade

Kemudian install apache

sudo apt install apache2

Install mariaDB

sudo apt install mariadb-server mariadb-client

Cek status mariadb

sudo systemctl status mariadb

Hasilnya

● mariadb.service - MariaDB 10.3.37 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: e>
    Active: active (running) since Thu 2023-02-16 21:06:00 UTC; 26min ago
      Docs: man:mysqld(8)
            https://mariadb.com/kb/en/library/systemd/
  Main PID: 53075 (mysqld)
    Status: "Taking your SQL requests now..."
      Tasks: 30 (limit: 560)
    Memory: 67.1M
    CGroup: /system.slice/mariadb.service
            └─53075 /usr/sbin/mysqld

Jalankan sekuriti script

sudo mysql_secure_installation

Set root password n sisanya Y

Set root password? [Y/n] n
... skipping.

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!

Test login mysql


ubuntu@ip-172-26-5-245:~$ sudo mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 48
Server version: 10.3.37-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


Bila sudah berhasil silahkan keluar dengan ketik exit

MariaDB [(none)]> exit
Bye



Install PHP

Jalankan perintah berikut

sudo apt install php libapache2-mod-php php-mysql


Setelah selesai test hasilnya dengan perintah

php -v


Hasilnya

PHP 7.4.3-4ubuntu2.17 (cli) (built: Jan 10 2023 15:37:44) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3-4ubuntu2.17, Copyright (c), by Zend Technologies

Membuat virtual host untuk website

Buat direktori untuk domain contohnya

sudo mkdir /var/www/idwebhosthostingmurah.my.id


Set owner untuk folder

sudo chown -R $USER:$USER /var/www/idwebhosthostingmurah.my.id

Buat file konfigurasi di sites-available

sudo vi /etc/apache2/sites-available/idwebhosthostingmurah.my.id.conf

Isi seperti berikut, ganti your domain dengan domainmu

<VirtualHost *:80>
    ServerName your_domain
    ServerAlias www.your_domain
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/your_domain
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Gunakan a2ensite untuk enable virtual host

sudo a2ensite idwebhosthostingmurah.my.id

Disable default website

sudo a2dissite 000-default

Pastikan file konfigurasi tidak ada syntax error dengan

sudo apache2ctl configtest

Bila sudah sesuai reload apache

sudo systemctl reload apache2

Buat file index.html untuk test virtual host

vi /var/www/your_domain/index.html

Isi dengan konten misalnya

<html>
  <head>
    <title>your_domain website</title>
  </head>
  <body>
    <h1>Hello World!</h1>

    <p>This is the landing page of <strong>your_domain</strong>.</p>
  </body>
</html>

Kemudian Test akses ke IP address

Tambahkan setting agar index.php dapat terbaca di directory index

vi /etc/apache2/mods-enabled/dir.conf

Masukkan seperti berikut

<IfModule mod_dir.c>
        DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

Bila sudah reload apache agar berefek

sudo systemctl reload apache2

Test php proses di webserver dengan membuat info php

vi /var/www/idwebhosthostingmurah.my.id/info.php

Isi dengan contoh seperti berikut

<?php
phpinfo();
?>

Akses nama domain atau ip /info.php bila tampil info php maka berhasil

Buat user dan password database

Akses mysql dari root

sudo mysql

Buat database dengan perintah

CREATE DATABASE contoh_database;

Buat user database dengan nama contoh_user dan password password1

CREATE USER 'contoh_user'@localhost IDENTIFIED BY 'password1';

Berikan privilege untuk user yang dibuat

GRANT ALL PRIVILEGES ON *.* TO 'contoh_user'@localhost IDENTIFIED BY 'password1';

Flush privileges dan cek hasilnya

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> SHOW GRANTS FOR 'contoh_user'@localhost;
+-----------------------------------------------------------------------------------------------------------------------------+
| Grants for contoh_user@localhost                                                                                            |
+-----------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO `contoh_user`@`localhost` IDENTIFIED BY PASSWORD '*668425423DB5193AF921380129F465A6425216D0' |
+-----------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)

Download dan Install wordpress

Masuk ke folder virtual host sebelumnya

cd /var/www/idwebhosthostingmurah.my.id/

Kemudian download wordpress dengan wget

wget https://wordpress.org/wordpress-6.1.1.zip

Install unzip

sudo apt install unzip

Kemudian unzip file wordpress tadi

unzip wordpress-6.1.1.zip

Pindahkan hasil ekstrak dari folder wordpress ke folder dokumen root domain

mv /var/www/idwebhosthostingmurah.my.id/wordpress/* /var/www/idwebhosthostingmurah.my.id/

Ganti owner folder installasi wordpress

sudo chown -R www-data:www-data /var/www/idwebhosthostingmurah.my.id/

Buat folder uploads di wp-content

sudo mkdir uploads

Page intallasi wordpress tampil

Install wordpress menggunakan ubuntu 20.4 + Lamp

Lanjutkan instalasi wordpress seperti biasanya

Install wordpress menggunakan ubuntu 20.4 + Lamp

Terima kasih telah setia bersama IDwebhost. Jika kamu punya pertanyaan seputar layanan kami, silakan hubungi tim customer service terbaik IDwebhost melalui kanal berikut:

Live Chat

Email ( info@idwebhost.com, billing@idwebhost.com, support@idwebhost.com )

Hotline (0274) 415585