Install WordPress on Almalinux

Setelah webserver telah siap, langkah selanjutnya untuk menginstall CMS WordPress pada sebuah domain/subdomain yang dipointing ke IP VPS di bagi ke dalam sub tahapan berikut.

Pada studi kasus ini wordpress di install pada domain dan IP Public VPS berikut

Domain firman.kelompoksaya.my.id
IP Public VPS 103.176.79.213

Create Domain / SubDomain & Pointing to IP VPS

firman.kelompoksaya.my.id    >   103.176.79.213

Check Propagansi Domain

Check propagansi domain dengan A record pada situs

https://dnschecker.org/

Create Database, username & password untuk wordpress

Silahkan buat database, user dan password pada phpmyadmin

DBNAME
DBHOST
DBPASS
DBHOSTNAME

Download Installer WordPress

Masuk ke folder root

[root@Almalinux-FirmanPratama ~]#	cd /root

Silahkan download file installer wordpress pada link berikut menggunakan wget

[root@Almalinux ~]# wget https://repo.firmanpratama.id/wordpress/wordpress-6.0.zip 
Note:
Official site Worpress Download
https://wordpress.org/download/

Extract/Unzip Installer WordPress

[root@Almalinux ~]# unzip wordpress-6.0.zip

Move folder wordpress to /var/www/html

Check terlebih dahulu isi file & folder pada folder /root

[root@Almalinux ~]# ls -la

Pindahkan folder “wordpress” ke dalam folder “/var/www/html/”

[root@Almalinux ~]# mv wordpress /var/www/html/

Masuk ke dalam folder “/var/www/html/”

[root@Almalinux ~]# cd /var/www/html/

Check isi, ownership serta permission file-folder di dalam folder “/var/www/html/” menggunakan perintah berikut

[root@Almalinux-FirmanPratama html]# ls -la

Ubah Ownership & Permission folder wordpress dari “root” ke “apache”

[root@Almalinux-FirmanPratama html]# chown -R apache:apache wordpress

Ubah Permission folder wordpress ke 755

[root@Almalinux-FirmanPratama html]# chmod -R 755  wordpress

Check kembali isi, ownership serta permission file-folder di dalam folder “/var/www/html/” menggunakan perintah berikut

[root@Almalinux-FirmanPratama html]# ls -la

Create Virtual Host Domain CMS WordPress

Create virtual host port 80 dan 443
http://firman.kelompoksaya.my.id
https://firman.kelompoksaya.my.id

ke dalam folder
/var/www/html/wordpress

Restart Service Apache & PHP-FPM

[root@Almalinux-FirmanPratama html]# systemctl restart httpd
[root@Almalinux-FirmanPratama html]# systemctl restart php-fpm

Install Let’s Encrypt SSL certificate. (https)

Install Let’s Encrypt SSL certificate sesuai dengan masing-masing domain/subdomain

[root@Almalinux-FirmanPratama html]# certbot --apache -d NamaDomain
Contoh
[root@Almalinux-FirmanPratama html]# certbot --apache -d firman.kelompoksaya.my.id
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y
Account registered.
Requesting a certificate for firman.kelompoksaya.my.id

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/firman.kelompoksaya.my.id/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/firman.kelompoksaya.my.id/privkey.pem
This certificate expires on 2022-09-14.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for firman.kelompoksaya.my.id to /etc/httpd/conf/httpd.conf
Congratulations! You have successfully enabled HTTPS on https://firman.kelompoksaya.my.id

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le

Web Install

Silahkan menuju browser dan akses Domain/Subdomain yang telah dibuat untuk melanjutkan instalasi wordpress

Contoh
https://firman.kelompoksaya.my.id

Masuk ke dalam folder wordpress

[root@Almalinux-FirmanPratama html]# cd /var/www/html/wordpress

Check kembali isi, file-folder di dalam folder “/var/www/html/wordpress” menggunakan perintah berikut, pastikan di dalam folder “/var/www/html/wordpress” terdapat file wp-config.php

[root@localhost ~ ]#	cd /var/www/html/wordpress
[root@Almalinux-FirmanPratama wordpress]# ls

Jika file wp-config.php tidak tergenerate silahkan buat wp-config.php secara manual seperti di bawah ini

[root@Almalinux-FirmanPratama html]# nano /var/www/html/wordpress/wp-config.php
Konfigurasi file wp-config.php
<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );

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

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

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

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+
 * Authentication unique keys and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 *
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define( 'AUTH_KEY',         'put your unique phrase here' );
define( 'SECURE_AUTH_KEY',  'put your unique phrase here' );
define( 'LOGGED_IN_KEY',    'put your unique phrase here' );
define( 'NONCE_KEY',        'put your unique phrase here' );
define( 'AUTH_SALT',        'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT',   'put your unique phrase here' );
define( 'NONCE_SALT',       'put your unique phrase here' );

/**#@-*/

/**
 * WordPress database table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
 */
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */



/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
	define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

Leave a Reply

Your email address will not be published. Required fields are marked *