Ad Under Header

Cara mudah install wordpress di nginx full optimation

Langsung saja praktek ya gaes.. 

1. Bikin directory untuk data wordpressnya : 
    cd /var/www/html/
    mkdir namadomain

2. Download file wordpressnya :
    cd /var/www/html/namdomain/
    wget https://wordpress.org/latest.tar.gz

3. Ekstrak filenya terus pindah ke direktory utama :
    tar -xf latest.tar.gz
    mv /var/html/namadomain/wordpress /var/html/namadomain/

4.  Jangan lupa ubah permission directorynya :
    
chmod -R 755 /var/www/html/namadomain/
    sudo chown -R nginx:nginx /var/www/html/namadomain/

5. Tambahkan blok servernya di /etc/nginx/nginx.conf :
    server {
        listen          80;
        server_name     namdomain;
        
        access_log      /var/log/nginx/access.log main;
        error_log       /var/log/nginx/error.log;
        
        root            /var/www/html/namadomain;

        location / {
            try_files $uri $uri/ /index.php?q=$uri&$args;
        }
        
        location ~ ([^/]*)sitemap(.*).(xml|xml.gz|html|html.gz)$ { 
    rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
    rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
    rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
    rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
}

        location = /favicon.ico {
  log_not_found off;
}
        
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
    }

    terus restart : systemctl restart nginx

6. Biar lancar install theme & plugin, tambahin di wp-config.php :
    define('FS_METHOD', 'direct');

7. Biar akses dbnya gak berat, pas install jangan lupa db_hostnya menggunakan socket :
    localhost:/var/lib/mysql/mysql.sock

8. Langkah selanjutnya install seperti biasa :)

nb :
Plugin wajib :
- W3 Total Cache (biar sitenya ngebut)
- Realy Simple SSL (biar SSL nya gak error)
- Classic Editor & Classic Widget

mudah bukan.. 😅




Top ad
Middle Ad 1
Parallax Ad
Middle Ad 2
Bottom Ad
Link copied to clipboard.