Advertisement
nugrohoe_ku

Install Wordpress + LAMP (Apache, MariaDB, php 8.0) on VPS | ubuntu 20.04

Jan 16th, 2022 (edited)
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. install wordpress + lamp + (php 8.0) on VPS | ubuntu 20.04
  2.  
  3. 1. login ssh
  4. 2. change repo ubuntu (optional)
  5. 3. instal apache2, mariadb-server, software-properties-common
  6. 4. add repo : add-apt-repository ppa:ondrej/php
  7. 5. install php dan modul tambahan php :
  8.  
  9. apt install php8.0 php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-xmlrpc php8.0-soap php8.0-intl php8.0-zip
  10.  
  11. apt install curl php8.0-mysql
  12.  
  13. 6. restart service apache, dan cek smua service sudah berjalan
  14. 7. login mysql, create database wordpress : CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
  15. 8. add new user : CREATE USER 'wordpressuser'@localhost IDENTIFIED BY 'password1';
  16. 9. grant all user : GRANT ALL ON wordpress.* TO 'wordpressuser'@localhost;
  17. 10. flush privileges : FLUSH PRIVILEGES;
  18.  
  19. 11. *for ipv6 vps, you must install warp : wget -N https://cdn.jsdelivr.net/gh/fscarmen/warp/menu.sh && bash menu.sh
  20. 12. install wordpress :
  21.  
  22. cd /tmp
  23. curl -O https://wordpress.org/latest.tar.gz
  24. tar xzvf latest.tar.gz
  25. touch /tmp/wordpress/.htaccess
  26. cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
  27. mkdir /tmp/wordpress/wp-content/upgrade
  28. cp -a /tmp/wordpress/. /var/www/html/wordpress
  29.  
  30. chown -R www-data:www-data /var/www/wordpress
  31.  
  32. find /var/www/html/wordpress/ -type d -exec chmod 750 {} \;
  33. find /var/www/html/wordpress/ -type f -exec chmod 640 {} \;
  34.  
  35. curl -s https://api.wordpress.org/secret-key/1.1/salt/
  36.  
  37. copy all secret key
  38.  
  39. nano /var/www/html/wordpress/wp-config.php
  40.  
  41. paste secret key, then change database, user, password,db_prefix, etc
  42.  
  43. nano /etc/apache2/sites-available/wordpress.conf
  44.  
  45. <VirtualHost *:80>
  46. ServerName example.com
  47. ServerAlias www.example.com
  48. ServerAdmin admin@example.com
  49. DocumentRoot /var/www/html/wordpress
  50.  
  51. <Directory /var/www/wordpress/>
  52. Options FollowSymlinks
  53. AllowOverride All
  54. Require all granted
  55. </Directory>
  56.  
  57. ErrorLog ${APACHE_LOG_DIR}/error.log
  58. CustomLog ${APACHE_LOG_DIR}/access.log combined
  59.  
  60. </VirtualHost>
  61.  
  62. a2enmod rewrite
  63.  
  64. a2ensite wordpress.conf
  65.  
  66. systemctl restart apache2
  67.  
  68. access your domain or ip : https://server_domain_or_IP
  69.  
  70. repo ubuntu 20.04
  71. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
  72. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
  73. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  74. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
  75. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-proposed main restricted universe multiverse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement