vi

WordPress VPS Offshore: Hướng Dẫn Tự Lưu Trữ

WordPress chiếm hơn 43% toàn bộ website trên internet - nhưng phần lớn chạy trên shared hosting bị giới hạn CPU, RAM và plugin. Chạy WordPress trên VPS offshore của AnubizHost mang lại tốc độ vượt trội, khả năng tùy chỉnh không giới hạn và quyền cài đặt bất kỳ plugin nào kể cả những plugin bị chặn bởi WordPress.com. Với VPS ở Iceland, website của bạn cũng hưởng lợi từ môi trường pháp lý bảo vệ quyền tự do ngôn luận.

Need this done for your project?

We implement, you ship. Async, documented, done in days.

Start a Brief

Cài Đặt LEMP Stack cho WordPress

WordPress cần Linux + Nginx + MySQL + PHP. Cài đặt toàn bộ stack:

apt update && apt upgrade -y
apt install -y nginx mysql-server php8.3-fpm php8.3-mysql     php8.3-xml php8.3-mbstring php8.3-curl php8.3-zip     php8.3-gd php8.3-intl php8.3-bcmath

Bảo mật MySQL:

mysql_secure_installation

Tạo database cho WordPress:

mysql -u root -p
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Cài Đặt WordPress

Download và cấu hình WordPress:

cd /var/www
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mv wordpress mysite
chown -R www-data:www-data /var/www/mysite
cd /var/www/mysite
cp wp-config-sample.php wp-config.php
nano wp-config.php

Sửa các dòng database trong wp-config.php:

define( 'DB_NAME', 'wordpress' );
define( 'DB_USER', 'wpuser' );
define( 'DB_PASSWORD', 'StrongPassword123!' );
define( 'DB_HOST', 'localhost' );

Thêm unique keys từ https://api.wordpress.org/secret-key/1.1/salt/ vào wp-config.php để tăng cường bảo mật session.

Cấu Hình Nginx cho WordPress

nano /etc/nginx/sites-available/mysite
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/mysite;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ .php$ {
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~* .(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
        log_not_found off;
    }

    location ~ /. {
        deny all;
    }
}
ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx

Tối Ưu Hiệu Suất WordPress trên VPS

Cài đặt Redis Object Cache để tăng tốc WordPress đáng kể:

apt install -y redis-server php8.3-redis
systemctl enable redis-server

Cài plugin Redis Object Cache từ WordPress dashboard và kết nối tới Redis trên localhost:6379.

Tối ưu PHP-FPM trong /etc/php/8.3/fpm/pool.d/www.conf:

pm = dynamic
pm.max_children = 20
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 10

Cài plugin WP Super Cache hoặc W3 Total Cache để cache HTML. Với VPS AnubizHost 2GB+ RAM, WordPress có thể serve hàng nghìn requests mỗi giây mà không cần CDN.

Why Anubiz Host

100% async — no calls, no meetings
Delivered in days, not weeks
Full documentation included
Production-grade from day one
Security-first approach
Post-delivery support included

Ready to get started?

Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.

Anubiz Chat AI

Online