Advertisement
nugrohoe_ku

Install Wordpress + LEMP (Nginx, MariaDB, PHP 8.0) on VPS | Ubuntu 20.04

Jan 16th, 2022
1,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. install wordpress + LEMP (NGINX, MariaDB, PHP 8.0) | ubuntu 20.04 VPS
  2.  
  3. 1. login ssh
  4. 2. change repo ubuntu (optional)
  5. 3. install nginx, mariadb-server, software-properties-common
  6. 4. add repo : add-apt-repository ppa:ondrej/php
  7. 5. install php dan library atau modul tambahan php :
  8.  
  9. apt install -y php8.0 php8.0-bcmath php8.0-curl php8.0-dev php8.0-fpm \
  10. php8.0-gd php8.0-intl php8.0-mbstring php8.0-mysql php8.0-soap \
  11. php8.0-xml php8.0-xmlrpc php8.0-zip
  12.  
  13. # (PHP Extension Community Library)
  14. apt install -y php8.0-mcrypt php-imagick
  15.  
  16. 6. restart service nginx, dan cek semua service sudah berjalan
  17.  
  18. systemctl restart nginx
  19. systemctl restart php8.0-fpm
  20. service mysql status
  21. service nginx status
  22.  
  23. 7. login mysql, create database wordpress : CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
  24. 8. add new user : CREATE USER 'wordpressuser'@localhost IDENTIFIED BY 'password1';
  25. 9. grant all user : GRANT ALL ON wordpress.* TO 'wordpressuser'@localhost;
  26. 10. flush privileges : FLUSH PRIVILEGES;
  27.  
  28. 11. *for ipv6 vps, you must install warp : wget -N https://cdn.jsdelivr.net/gh/fscarmen/warp/menu.sh && bash menu.sh
  29.  
  30. 12. install wordpress :
  31.  
  32. cd /tmp
  33. wget https://wordpress.org/latest.tar.gz
  34. tar xzvf latest.tar.gz
  35.  
  36. cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
  37. mkdir /tmp/wordpress/wp-content/upgrade
  38. cp -a /tmp/wordpress/. /var/www/html/wordpress
  39.  
  40. chown -R www-data:www-data /var/www/html/wordpress
  41.  
  42. find /var/www/html/wordpress/ -type d -exec chmod 750 {} \;
  43. find /var/www/html/wordpress/ -type f -exec chmod 640 {} \;
  44.  
  45. curl -s https://api.wordpress.org/secret-key/1.1/salt/
  46.  
  47. copy all secret key
  48.  
  49. nano /var/www/html/wordpress/wp-config.php
  50.  
  51. paste secret key, then change database, user, password,db_prefix, etc
  52.  
  53. nano /etc/nginx/sites-available/bastomi.xyz
  54.  
  55. server {
  56. listen 80;
  57. listen [::]:80;
  58. root /var/www/html/wordpress;
  59. index index.php index.html index.htm;
  60. server_name bastomi.xyz www.bastomi.xyz;
  61.  
  62. client_max_body_size 100M;
  63. autoindex off;
  64. location / {
  65. try_files $uri $uri/ /index.php?$args;
  66. }
  67.  
  68. location ~ \.php$ {
  69. include snippets/fastcgi-php.conf;
  70. fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
  71. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  72. include fastcgi_params;
  73. }
  74. }
  75.  
  76. ln -s /etc/nginx/sites-available/bastomi.xyz /etc/nginx/sites-enabled/
  77.  
  78. sudo nginx -t
  79.  
  80. systemctl reload nginx
  81.  
  82. access your domain or ip : https://server_domain_or_IP
  83.  
  84. repo ubuntu 20.04
  85. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
  86. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
  87. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  88. deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
  89. 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