CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Install Wordpress
Download dan install wordpress
cd /var/www/html
wget https://wordpress.org/latest.zip
unzip latest.zip
rm latest.zip
Set permissions untuk file dan folder
chown -R www-data:www-data wordpress/
cd wordpress/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
Sesuaikan database dengan yang sudah dibuat sebelumnya
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );
/** Database username */
define( 'DB_USER', 'wordpress' );
/** Database password */
define( 'DB_PASSWORD', 'YourStrongPasswordHere' );
Buat Virtual Host
Buat file konfigurasi untuk virtual host
cd /etc/apache2/sites-available/
touch wordpress.conf