Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install wordpress + LEMP (NGINX, MariaDB, PHP 8.0) | ubuntu 20.04 VPS
- 1. login ssh
- 2. change repo ubuntu (optional)
- 3. install nginx, mariadb-server, software-properties-common
- 4. add repo : add-apt-repository ppa:ondrej/php
- 5. install php dan library atau modul tambahan php :
- apt install -y php8.0 php8.0-bcmath php8.0-curl php8.0-dev php8.0-fpm \
- php8.0-gd php8.0-intl php8.0-mbstring php8.0-mysql php8.0-soap \
- php8.0-xml php8.0-xmlrpc php8.0-zip
- # (PHP Extension Community Library)
- apt install -y php8.0-mcrypt php-imagick
- 6. restart service nginx, dan cek semua service sudah berjalan
- systemctl restart nginx
- systemctl restart php8.0-fpm
- service mysql status
- service nginx status
- 7. login mysql, create database wordpress : CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
- 8. add new user : CREATE USER 'wordpressuser'@localhost IDENTIFIED BY 'password1';
- 9. grant all user : GRANT ALL ON wordpress.* TO 'wordpressuser'@localhost;
- 10. flush privileges : FLUSH PRIVILEGES;
- 11. *for ipv6 vps, you must install warp : wget -N https://cdn.jsdelivr.net/gh/fscarmen/warp/menu.sh && bash menu.sh
- 12. install wordpress :
- cd /tmp
- wget https://wordpress.org/latest.tar.gz
- tar xzvf latest.tar.gz
- cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
- mkdir /tmp/wordpress/wp-content/upgrade
- cp -a /tmp/wordpress/. /var/www/html/wordpress
- chown -R www-data:www-data /var/www/html/wordpress
- find /var/www/html/wordpress/ -type d -exec chmod 750 {} \;
- find /var/www/html/wordpress/ -type f -exec chmod 640 {} \;
- curl -s https://api.wordpress.org/secret-key/1.1/salt/
- copy all secret key
- nano /var/www/html/wordpress/wp-config.php
- paste secret key, then change database, user, password,db_prefix, etc
- nano /etc/nginx/sites-available/bastomi.xyz
- server {
- listen 80;
- listen [::]:80;
- root /var/www/html/wordpress;
- index index.php index.html index.htm;
- server_name bastomi.xyz www.bastomi.xyz;
- client_max_body_size 100M;
- autoindex off;
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
- location ~ \.php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- }
- ln -s /etc/nginx/sites-available/bastomi.xyz /etc/nginx/sites-enabled/
- sudo nginx -t
- systemctl reload nginx
- access your domain or ip : https://server_domain_or_IP
- repo ubuntu 20.04
- deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
- deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
- deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
- deb http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
- 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