Difference between revisions of "Install WordPress di Ubuntu 20.04"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "Bagi anda yang berminat untuk membuat sendiri Server Blog dapat menggunakan Wordpress. Pertama-tama siapkan beberapa fasilitas pendukung Wordpress seperti MySQL...")
 
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
 
Untuk [[Ubuntu]] 20.04
 
Untuk [[Ubuntu]] 20.04
  
Edit /etc/apt/sources.list
+
==Edit /etc/apt/sources.list==
  
  deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
+
  deb http://id.archive.ubuntu.com/ubuntu focal main restricted universe multiverse
  deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
+
deb http://id.archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
  deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse
+
  deb http://id.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
 +
  deb http://id.archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse
  
Install apps
 
  
apt update
+
==Install Apache2==
apt -y install apache2 php php-xmlrpc php-mysql php-gd php-cli php-curl \
 
mysql-client mysql-server libmysqlclient-dev libphp-adodb \
 
php-mysql php-gd php-curl php-pear unzip php-mbstring php7.2-xml php-xmlrpc \
 
php php-mysql libapache2-mod-php php-cli php-cgi php-gd
 
  
Jika dibutuhkan kita dapat meng-enable module PHP 7 di apache,
+
sudo su
 +
sudo apt -y install apache2
 +
sudo ufw allow 'Apache'
  
a2emod php7.2
 
  
pada dasarnya default konfigurasi apache, sudah mengaktifkan php terbaru.
+
==Install PHP 7.4==
 +
 
 +
sudo apt -y install software-properties-common
 +
sudo add-apt-repository ppa:ondrej/php
 +
 
 +
sudo apt update
 +
sudo apt -y install php7.4
 +
 
 +
Install extension
 +
 
 +
sudo apt -y install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc \
 +
php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev \
 +
php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap \
 +
php7.4-zip php7.4-cli php7.4-intl \
 +
imagemagick git unzip zip libgd-dev libapache2-mod-php libphp-adodb
 +
 
 +
 
 +
Edit (tergantung kebutuhan)
 +
 
 +
sudo vi /etc/php/7.4/apache2/php.ini
 +
 
 +
upload_max_filesize = 100M
 +
post_max_size = 48M
 +
memory_limit = 512M
 +
max_execution_time = 600
 +
max_input_vars = 3000
 +
max_input_time = 1000
 +
 
 +
Restart apache2
 +
 
 +
sudo systemctl restart apache2.service
 +
 
 +
Test (Optional)
 +
 
 +
sudo vi /var/www/html/phpinfo.php
 +
 
 +
<?php phpinfo( ); ?>
 +
 
 +
 
 +
 
 +
==Install Percona==
 +
 
 +
sudo apt -y install wget
 +
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
 +
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
 +
 
 +
sudo percona-release setup ps57
 +
sudo apt -y install percona-server-server-5.7
 +
 
 +
Edit
 +
 
 +
sudo vi /etc/mysql/percona-server.conf.d/mysqld.cnf
 +
 
 +
[mysqld]
 +
max_allowed_packet=32M
 +
 
 +
Restart
 +
 
 +
/etc/init.d/mysql restart
 +
 
 +
 
 +
 
 +
==Install Wordpress==
 +
 
 
Ambil [[source code]] [[Wordpress]] di
 
Ambil [[source code]] [[Wordpress]] di
  

Latest revision as of 12:04, 7 May 2020

Bagi anda yang berminat untuk membuat sendiri Server Blog dapat menggunakan Wordpress.

Pertama-tama siapkan beberapa fasilitas pendukung Wordpress seperti MySQL-server, PHP dll, antara lain dapat di install melalui perintah

Untuk Ubuntu 20.04

Edit /etc/apt/sources.list

deb http://id.archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb http://id.archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
deb http://id.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
deb http://id.archive.ubuntu.com/ubuntu focal-security main restricted universe multiverse


Install Apache2

sudo su
sudo apt -y install apache2
sudo ufw allow 'Apache'


Install PHP 7.4

sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt -y install php7.4

Install extension

sudo apt -y install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc \
php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev \
php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap \
php7.4-zip php7.4-cli php7.4-intl \
imagemagick git unzip zip libgd-dev libapache2-mod-php libphp-adodb


Edit (tergantung kebutuhan)

sudo vi /etc/php/7.4/apache2/php.ini
upload_max_filesize = 100M
post_max_size = 48M
memory_limit = 512M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 1000

Restart apache2

sudo systemctl restart apache2.service

Test (Optional)

sudo vi /var/www/html/phpinfo.php
<?php phpinfo( ); ?>


Install Percona

sudo apt -y install wget
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo percona-release setup ps57
sudo apt -y install percona-server-server-5.7

Edit

sudo vi /etc/mysql/percona-server.conf.d/mysqld.cnf
[mysqld]
max_allowed_packet=32M

Restart

/etc/init.d/mysql restart


Install Wordpress

Ambil source code Wordpress di

Atau bagi anda yang ingin menggunakan Wordpress berbahasa Indonesia dapat mengambil source code-nya di

Download & copy

wget http://wordpress.org/latest.tar.gz
cp latest.tar.gz /var/www/html/
cd /var/www/html
tar zxvf latest.tar.gz
cd /var/www/html/wordpress
chmod -Rf 777 /var/www/html/wordpress/wp-content/

Konfigurasi Wordpress untuk menggunakan database server MySQL

cd /var/www/html/wordpress
cp wp-config-sample.php wp-config.php
vi wp-config.php
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', 'wordpress');
define('DB_HOST', 'localhost');

Siapkan database untuk Wordpress, disini akan digunakan database dengan nama wordpress, user database dengan nama wordpress dan password untuk akses database adalah wordpress. Sedang password root MySQL di set sebagai password. Perintah yang digunakan untuk mengkonfigurasi adalah

mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD('password');

Jika password Root MySQL database sudah di set maka kita dapat langsung mengkonfigurasi MySQL menggunakan perintah

# mysql -u root -p
Enter password:
create database wordpress;
grant INSERT,SELECT on root.* to wordpress@localhost;
grant CREATE, INSERT, SELECT, DELETE, UPDATE on wordpress.* to wordpress@localhost identified by 'wordpress';
grant CREATE, INSERT, SELECT, DELETE, UPDATE on wordpress.* to wordpress identified by 'wordpress';
exit

Jika masih belajar dapat menggunakan perintah


# mysql -u root -p123456
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
grant ALL on root.* to wordpress@localhost;
GRANT ALL ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpress';
grant ALL on wordpress.* to wordpress identified by 'wordpress';
exit

Restart Web Server

/etc/init.d/apache2 restart
/etc/init.d/mysql restart

Akses Web Wordpress ke IP address statik dari Web Server anda. Sangat tidak di sarankan ungtuk mengakses ke localhost, kecuali jika Web Wordpress hanya digunakan untuk komputer anda sendiri tidak untuk orang lain. Cara mengakses-nya adalah,

http://ip-address-web-server/wordpress
install.php

Masukan Data berikut

Judul Situs 	
Nama Pengguna 	
Kata sandi, dua kali
E-mail Anda

Klik pada "Install Wordpress"

Kita dapat login

http://ip-address-web-server/wordpress/wp-login.php

Youtube


Pranala Menarik