ការធ្វើចំណាកស្រុកវិបត្តិបង្ហោះគេហទំព័រ ការសង្គ្រោះគ្រោះមហន្តរាយម៉ាស៊ីនមេ និងការស្ដារការបម្រុងទុក¶
ការបរាជ័យនៃការបង្ហោះគេហទំព័រភ្លាមៗ ការផ្អាកគណនីតាមអំពើចិត្ត ការដាច់ផ្នែករឹងនៃមជ្ឈមណ្ឌលទិន្នន័យ ឬការសម្របសម្រួលសុវត្ថិភាពម៉ាស៊ីនមេ អាចផ្តាច់ការចូលប្រើគេហទំព័រអាជីវកម្ម ការត្រួតពិនិត្យពាណិជ្ជកម្មតាមអេឡិចត្រូនិក វិបផតថលអតិថិជន និងបណ្ណសារឌីជីថលភ្លាមៗ។ នៅពេលដែលម៉ាស៊ីនមេបង្ហោះចែករំលែកគាំង អ្នកមើលវិចារណកថានិម្មិតបរាជ័យ ឬក្រុមហ៊ុនបង្ហោះចាក់សោគណនីកំឡុងពេលវិក្កយបត្រ ឬវិវាទធនធាន ការមាននីតិវិធីធ្វើចំណាកស្រុកសង្គ្រោះបន្ទាន់ច្បាស់លាស់ការពារស្ថាប័នរបស់អ្នកពីការបាត់បង់ទិន្នន័យជាអចិន្ត្រៃយ៍ និងពេលវេលារងចាំយូរ។
ការប្រតិបត្តិការផ្លាស់ប្តូរម៉ាស៊ីនមេសង្គ្រោះបន្ទាន់ក្រោមសម្ពាធតម្រូវឱ្យមានការសាកល្បងវិធីសាស្រ្ត។ ដោយការស្រង់ចេញនូវស្ថានភាពនៃមូលដ្ឋានទិន្នន័យ និងឯកសារកម្មវិធីដែលនៅរស់ ការផ្តល់ម៉ាស៊ីនមេពពកឯករាជ្យ ស្ដារតារាងមូលដ្ឋានទិន្នន័យ និងការអនុញ្ញាតឯកសារ ការចង្អុលបង្ហាញប្រព័ន្ធឈ្មោះដែន (DNS) ឡើងវិញជាមួយនឹងការពន្យារពេលក្នុងឃ្លាំងសម្ងាត់ទាប និងការចេញវិញ្ញាបនបត្រ Transport Layer Security (TLS) ថ្មី អ្នកអាចស្ដារប្រតិបត្តិការគេហទំព័រពេញលេញក្នុងរយៈពេលពីមួយទៅពីរម៉ោង។
ធ្វើដូចនេះឥឡូវនេះ¶
ប្រសិនបើគេហទំព័រ ឬកម្មវិធីគេហទំព័ររបស់អ្នកធ្លាក់ចុះ ផ្អាក ឬប្រឈមនឹងការបិទម៉ាស៊ីនមេដែលជិតមកដល់ សូមអនុវត្តតាមជំហាននៃការទប់ស្កាត់ និងទាញយកជាបន្ទាន់ទាំងនេះ៖
- វាយតម្លៃថាតើការចូលប្រើផ្នែករដ្ឋបាលនៅតែដំណើរការទេ៖ សាកល្បងថាតើអ្នកនៅតែអាចទៅដល់ម៉ាស៊ីនមេរបស់អ្នកតាមរយៈ SSH (Secure Shell), SFTP (SSH File Transfer Protocol) ឬផ្ទាំងគ្រប់គ្រងបង្ហោះរបស់អ្នក (cPanel, Plesk, DirectAdmin ឬ ផ្ទាំងគ្រប់គ្រងពពកផ្ទាល់ខ្លួន)។ កុំដាក់សំបុត្រគាំទ្រដោយកំហឹងដែលគំរាមកំហែងដល់សកម្មភាពផ្លូវច្បាប់ មុនពេលអ្នកបានទាញយកទិន្នន័យរបស់អ្នក ព្រោះជួនកាលសំបុត្រអរិភាពនឹងជំរុញឱ្យម៉ាស៊ីនដែលមិនសមហេតុផលឱ្យដកសិទ្ធិចូលប្រើភ្លាមៗ។
- បើកដំណើរការ "Always Online" ឬការរក្សាឃ្លាំងសម្ងាត់នៅគែម CDN របស់អ្នក៖ ប្រសិនបើដែនរបស់អ្នកប្រើប្រូកស៊ីបញ្ច្រាសគែមដូចជា Cloudflare សូមចូលទៅក្នុងផ្ទាំងគ្រប់គ្រង DNS របស់អ្នក ហើយផ្ទៀងផ្ទាត់ថាការបម្រើឃ្លាំងសម្ងាត់គឺសកម្ម ដូច្នេះអ្នកទស្សនាបន្តមើលឃើញទំព័រឋិតិវន្តដែលបានរក្សាទុកក្នុងឃ្លាំងសម្ងាត់ ខណៈពេលដែលអ្នកបង្កើតម៉ាស៊ីនមេខាងក្រោយឡើងវិញ។
- ** បន្ថយតម្លៃ DNS Time To Live (TTL) របស់អ្នកមកត្រឹម 60 ឬ 300 វិនាទីភ្លាមៗ**៖ ប្រសិនបើដែនរបស់អ្នកនៅតែដោះស្រាយ ឬដំណើរការដោយផ្នែក សូមចូលទៅកាន់អ្នកចុះឈ្មោះដែន ឬអ្នកផ្តល់ DNS របស់អ្នកឥឡូវនេះ ហើយកាត់បន្ថយ TTL នៅលើរបស់អ្នក។
@(ឫស),www, និងដែនរងAនិងAAAAកត់ត្រារហូតដល់ 300 វិនាទី (5 នាទី) ឬ 60 វិនាទី (1 នាទី) ដូច្នេះការកាត់អាសយដ្ឋាន IP នាពេលខាងមុខរីករាលដាលយ៉ាងឆាប់រហ័សទូទាំងពិភពលោក។ - ** ស្រង់ចេញមូលដ្ឋានទិន្នន័យ SQL ផ្ទាល់របស់អ្នកជាមុនសិន**៖ ជាធម្មតាឯកសារមូលដ្ឋានទិន្នន័យមានទំហំតូច (មេកាបៃទៅពីរបីជីហ្គាបៃ) និងមានទិន្នន័យថាមវន្តដែលមិនអាចជំនួសបានច្រើនបំផុតរបស់អ្នក (ការបញ្ជាទិញអតិថិជន គណនីអ្នកប្រើប្រាស់ ការបង្ហោះ និងប្រតិបត្តិការ)។ រត់
mysqldumpឬpg_dumpលើ SSH ឬនាំចេញ a.sql.gzបណ្ណសារតាមរយៈ phpMyAdmin ហើយទាញយកវាទៅកុំព្យូទ័រក្នុងតំបន់របស់អ្នកភ្លាមៗ។ - ** បង្ហាប់ និងទាញយកកម្មវិធី webroot និងឯកសារកំណត់រចនាសម្ព័ន្ធរបស់អ្នក **៖ បង្កើតការបង្ហាប់តែមួយ
.tar.gzឬ.zipបណ្ណសារនៃឫសឯកសាររបស់អ្នក (រួមទាំងឯកសារលាក់ដូចជា.envនិង.htaccess) ហើយទាញយកវាចេញពីម៉ាស៊ីនមេតាមរយៈ SFTP ឬrsync. - ផ្ទៀងផ្ទាត់ការគ្រប់គ្រងគណនីចុះឈ្មោះដែនរបស់អ្នក៖ បញ្ជាក់ថាអ្នកអាចចូលទៅក្នុងអ្នកចុះឈ្មោះដែនដែលឈ្មោះដែនរបស់អ្នកត្រូវបានចុះឈ្មោះ (ដូចជា Cloudflare Registrar, Porkbun, Namecheap ឬ AWS Route 53)។ ប្រសិនបើឈ្មោះដែនរបស់អ្នកត្រូវបានចុះឈ្មោះតាមរយៈក្រុមហ៊ុនបង្ហោះគេហទំព័រដែលបរាជ័យដូចគ្នា ដោះសោដែន និងទាញយកលេខកូដផ្ទេរសិទ្ធិ EPP/Authorization ភ្លាមៗ។
Danger
នៅពេលបង្កើត ក .zip ឬ .tar.gz បណ្ណសារបម្រុងទុកនៅខាងក្នុងថតគេហទំព័រសាធារណៈផ្ទាល់ (ដូចជា /var/www/html/backup.zip ឬ public_html/site-backup.tar.gz), bots ឧក្រិដ្ឋកម្មតាមអ៊ីនធឺណិតដោយស្វ័យប្រវត្តិបន្តស្កេនដែនសម្រាប់ឈ្មោះឯកសារបម្រុងទុកទូទៅ។ ប្រសិនបើអ្នកវាយប្រហារទាញយកបណ្ណសាររបស់អ្នក ពួកគេអាចចូលប្រើបានពេញលេញទៅកាន់ពាក្យសម្ងាត់មូលដ្ឋានទិន្នន័យ សោ API និងកំណត់ត្រាអតិថិជនរបស់អ្នក។ តែងតែសរសេរប័ណ្ណសារបម្រុងទុកទៅថតឯកជននៅខាងក្រៅ webroot សាធារណៈ (ដូចជា /home/username/ ឬ /tmp/) ហើយលុបបណ្ណសារបណ្ដោះអាសន្នចេញពីម៉ាស៊ីនមេ នៅពេលការទាញយករបស់អ្នកបញ្ចប់ភ្លាមៗ។
គំនូសតាងលំហូរវិបត្តិ៖ ការជ្រើសរើសផ្លូវសង្គ្រោះរបស់អ្នក។¶
ប្រើមែកធាងការសម្រេចចិត្តនេះដើម្បីជ្រើសរើសវិធីសាស្ត្រសង្គ្រោះលឿនបំផុតដោយផ្អែកលើការចូលប្រើម៉ាស៊ីនមេបច្ចុប្បន្ន និងការគ្រប់គ្រងដែនរបស់អ្នក៖
flowchart TD
A["បានរកឃើញការដាច់បណ្តាញ ឬម៉ាស៊ីនមេ"] --> B{"តើអ្នកនៅតែអាចចូលប្រើ SSH, SFTP, ឬ cPanel បានទេ?"}
B -->|"បាទ/ចាស៖ ដំណើរការការចូលប្រើផ្ទាល់"| C["ដំណើរការការបោះចោលមូលដ្ឋានទិន្នន័យផ្ទាល់រយៈពេល 15 នាទី និងបណ្ណសារ webroot tar"]
B -->|"ទេ៖ ម៉ាស៊ីនមេស្លាប់ ឬគណនីត្រូវបានចាក់សោ"| D{"តើអ្នកមានការបម្រុងទុកក្រៅបណ្តាញ ឬកុងសូលសង្គ្រោះទេ?"}
D -->|"របៀបសង្គ្រោះ VPS អាចប្រើបាន"| E["Boot hypervisor Rescue ISO, mount disk, និង SCP data out"]
D -->|"ការបម្រុងទុកខាងក្រៅតែប៉ុណ្ណោះ"| F["ទាញយក SQL ស្អាតចុងក្រោយបំផុត និងរូបថតឯកសារពី S3 / Backblaze / កន្លែងផ្ទុកក្នុងមូលដ្ឋាន"]
C --> G{"តើការដាច់ភ្លើងបង្កឡើងដោយមេរោគ ឬការលួចចូល?"}
E --> G
F --> G
G -->|"ទេ៖ ផ្នែករឹង ការចេញវិក្កយបត្រ ឬម៉ាស៊ីនបរាជ័យ"| H["ផ្តល់ VPS ស្អាត ឬម៉ាស៊ីនដែលបានគ្រប់គ្រង និងស្ដារប័ណ្ណសារដោយផ្ទាល់"]
G -->|"បាទ/ចាស៖ Ransomware ឬ webshell compromise"| I["រក្សាការបម្រុងទុក ការដាក់ពង្រាយ CMS/កូដថ្មីៗពី Git សម្អាតការបង្ហោះ និង SQL"]
H --> J["សាកល្បងតាមរយៈឯកសារម៉ាស៊ីនក្នុងស្រុក ចេញវិញ្ញាបនបត្រ TLS និងកាត់កំណត់ត្រា DNS A/AAAA"]
I --> J
Phase 1: The 15-minute emergency data extraction protocol¶
When a server is unstable, failing under hardware degradation, or facing imminent suspension, extract your data in order of priority: databases first, configuration files second, code and themes third, and heavy static media uploads last.
Method A: Command-line extraction via SSH (fastest and most reliable)¶
Web-based file managers and browser downloads frequently time out or corrupt archives when exporting sites larger than 500 megabytes. If you have SSH terminal access, run these commands to create consistent, compressed snapshots:
# 1. Create a private working directory outside the public webroot:
mkdir -p ~/emergency_migration && chmod 700 ~/emergency_migration
# 2. Dump MySQL / MariaDB database with single-transaction consistency (no table locking on InnoDB):
mysqldump --single-transaction --routines --triggers --events \
-u db_username -p db_name | gzip -9 > ~/emergency_migration/db_backup_$(date +%F).sql.gz
# (Alternative for PostgreSQL databases):
# pg_dump -U db_username -Fc db_name > ~/emergency_migration/db_backup_$(date +%F).dump
# 3. Archive the entire webroot, preserving permissions and hidden dotfiles (.env, .htaccess):
tar -czpf ~/emergency_migration/webroot_backup_$(date +%F).tar.gz -C /var/www/html .
# 4. Copy existing Nginx/Apache virtual host configs and cron jobs for reference:
cp -r /etc/nginx/sites-available ~/emergency_migration/nginx_configs 2>/dev/null
crontab -l > ~/emergency_migration/user_crontab.txt 2>/dev/null
Once the archives are created on the remote server, open a terminal on your local workstation (or directly on your newly provisioned target server) and pull the files across using rsync ឬ scp:
# Pull the backups to your local computer with resume support (-P) if the connection drops:
rsync -avzP -e "ssh -p 22" username@old_server_ip:~/emergency_migration/ ./local_rescue_folder/
Method B: Extracting data from an unbootable VPS using Rescue Mode¶
If your Virtual Private Server (VPS) or dedicated server fails to boot (for example, due to a corrupted Linux kernel, broken GRUB bootloader, or full root partition) and SSH does not respond, do not wipe or re-image the server:
- Log into your cloud provider's hardware control panel (DigitalOcean, Hetzner, Linode/Akamai, Vultr, OVHcloud, or AWS EC2).
- Enable Rescue Mode (or attach the root volume to a temporary recovery instance) and reboot the server into the live Linux rescue environment.
- Connect to the rescue environment via SSH or the browser-based VNC console, mount your server's primary storage partition, and copy your files out:
# Identify your main storage partition (usually /dev/sda1, /dev/vda1, or /dev/nvme0n1p1):
lsblk
# Mount the partition read-only (or read-write if needed) to /mnt/rescue:
mkdir -p /mnt/rescue
mount -o ro /dev/vda1 /mnt/rescue
# Archive your web files and raw MySQL/MariaDB data directory (/var/lib/mysql):
tar -czpf /tmp/raw_mysql_files.tar.gz -C /mnt/rescue/var/lib/mysql .
tar -czpf /tmp/site_files.tar.gz -C /mnt/rescue/var/www/html .
Method C: Shared hosting control panel extraction (cPanel, Plesk, DirectAdmin)¶
If you are on shared hosting without SSH access:
- Generate a Full cPanel Backup: In cPanel, open Backup or Backup Wizard and click Download a Full Account Backup. This generates a single
backup-date_time_username.tar.gzfile in your home directory containing your public files, MySQL databases, email forwarders, and DNS zone records, which can be restored with one click on any other cPanel host or unpacked manually on any Linux VPS. - Manual phpMyAdmin database export: If the full backup tool is disabled by your host, open phpMyAdmin, select your database in the left sidebar, click Export at the top, select Custom, highlight all tables, check Add DROP TABLE / VIEW / PROCEDURE / FUNCTION, choose gzipped compression, and click Export.
- File Manager archive: Open File Manager, click Settings in the top right corner and check Show Hidden Files (dotfiles) so you do not miss
.htaccessឬ.env. Select all files insidepublic_html/, click Compress (Zip ArchiveឬGZiped Tar Archive), download the archive to your computer, and immediately delete the archive file from the server.
Phase 2: Provisioning independent target infrastructure¶
Never migrate from one failing shared hosting brand to another brand owned by the exact same parent conglomerate using the same datacenter infrastructure. Choose an independent cloud compute provider or managed platform with transparent status reporting and automated snapshot capabilities.
Comparison of emergency migration target architectures¶
| Target Hosting Type | Provisioning Speed | Technical Skill Required | Best Use Case During an Emergency |
|---|---|---|---|
| Cloud VPS Instance (DigitalOcean, Linode/Akamai, Hetzner, Vultr, AWS Lightsail) | 60 seconds | Intermediate Linux CLI (SSH, Nginx/Apache, MariaDB) | Full root control, lowest cost, immune to shared hosting resource throttling, ideal for custom apps or high-traffic CMS sites. |
| Managed Cloud Control Panel (Cloudways, RunCloud, Forge, Ploi, SpinupWP on VPS) | 5 to 10 minutes | Beginner to Intermediate | Automated LEMP stack provisioning, built-in SSL, firewall, and staging environments without manual command-line server setup. |
| Independent cPanel / Plesk Host | 10 to 20 minutes | Beginner | Fastest drop-in restoration if you extracted a full cpanel-backup.tar.gz archive and need bundled POP3/IMAP email hosting. |
| Static / Jamstack Edge Hosting (Cloudflare Pages, GitHub Pages, Netlify, Vercel) | 2 ទៅ 5 នាទី។ | កម្រិតមធ្យម (លំហូរការងារ Git) | ល្អបំផុតសម្រាប់គេហទំព័រឋិតិវន្ត (Zensical, MkDocs, Hugo, Astro, Next.js) ឬដាក់ទំព័រចុះចតបន្ទាន់តាមអ៊ីនធឺណិតភ្លាមៗ។ |
ការផ្តល់ជង់ Ubuntu 24.04 LTS LEMP ស្អាត (Nginx + MariaDB + PHP)¶
ប្រសិនបើអ្នកបង្វិលម៉ាស៊ីនមេពពកអ៊ូប៊ុនទូ 24.04 LTS ស្អាត ដំណើរការលំដាប់ពាក្យបញ្ជានេះជា root ឬ sudo អ្នកប្រើប្រាស់ដើម្បីបង្កើតម៉ាស៊ីនមេគេហទំព័រដែលត្រៀមរួចជាស្រេចក្នុងរយៈពេល 5 នាទី៖
# 1. Update operating system packages and install core utilities:
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git unzip ufw fail2ban
# 2. Configure the Uncomplicated Firewall (UFW) before exposing services:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw --force enable
# 3. Install Nginx web server and MariaDB database server:
sudo apt install -y nginx mariadb-server
# 4. Install PHP-FPM and standard web application extensions:
sudo apt install -y php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd \
php8.3-mbstring php8.3-xml php8.3-zip php8.3-intl php8.3-bcmath \
php8.3-imagick php8.3-redis
# 5. Enable and start all core services on boot:
sudo systemctl enable --now nginx mariadb php8.3-fpm
Warning
ពិនិត្យមើលឡើងវិញនូវអ្វីដែល PHP, Node.js, Python, ឬកំណែមូលដ្ឋានទិន្នន័យដែលគេហទំព័រចាស់របស់អ្នកទាមទារ មុនពេលប្តូរចរាចរ។ ប្រសិនបើអ្នកផ្ទេរកម្មវិធី PHP 7.4 ចាស់ទៅម៉ាស៊ីនមេ PHP 8.3 ថ្មីស្រឡាងដោយមិនចាំបាច់សាកល្បង មុខងារដែលបានបដិសេធនៅក្នុងកម្មវិធីជំនួយចាស់ៗ ឬកូដផ្ទាល់ខ្លួនអាចបង្កឱ្យមានគ្រោះថ្នាក់ដល់ជីវិត។ HTTP 500 Internal Server Error គាំង។ ប្រសិនបើចាំបាច់ អ្នកអាចដំណើរការកំណែ PHP ចាស់ពិតប្រាកដមួយចំហៀងនៅលើអ៊ូប៊ុនទូ ដោយប្រើការទុកចិត្ត ppa:ondrej/php ឃ្លាំងរហូតដល់លេខកូដរបស់អ្នកត្រូវបានធ្វើបច្ចុប្បន្នភាព។
ដំណាក់កាលទី 3៖ ស្ដារមូលដ្ឋានទិន្នន័យ ពន្លាឯកសារ និងការអនុញ្ញាតឲ្យរឹង¶
នៅពេលដែលម៉ាស៊ីនមេថ្មីរបស់អ្នកកំពុងដំណើរការ សូមផ្ទេរប័ណ្ណសារបម្រុងទុករបស់អ្នកទៅកាន់ម៉ាស៊ីនមេថ្មីតាមរយៈ scp ឬ rsync និងស្ដារមូលដ្ឋានទិន្នន័យ និងឯកសារជា root ។
1. Creating an isolated database user and importing the SQL dump¶
Never connect a production web application to the database using the root MySQL account. Create a dedicated database and a least-privilege database user bound strictly to localhost:
Inside the SQL prompt, run:
CREATE DATABASE prod_app_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'prod_app_user'@'localhost' IDENTIFIED BY 'Generate_A_Strong_32_Char_Random_Password';
GRANT ALL PRIVILEGES ON prod_app_db.* TO 'prod_app_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Now stream your compressed .sql.gz backup directly into the newly created database from the Linux command line:
# Stream and decompress the SQL backup into MariaDB:
zcat ~/db_backup_2026-10-30.sql.gz | sudo mysql -u root prod_app_db
2. Unpacking application files and setting strict POSIX permissions¶
Incorrect file ownership or overly permissive 777 permissions are major causes of both broken migrations (403 Forbidden or failed image uploads) and secondary security breaches:
# Create the target webroot directory and unpack your archive into it:
sudo mkdir -p /var/www/yourdomain.com
sudo tar -xzpf ~/webroot_backup_2026-10-30.tar.gz -C /var/www/yourdomain.com
# Assign ownership to the web server daemon (www-data on Ubuntu/Debian):
sudo chown -R www-data:www-data /var/www/yourdomain.com
# Set all directories to 755 (rwxr-xr-x) and all files to 644 (rw-r--r--):
sudo find /var/www/yourdomain.com -type d -exec chmod 755 {} +
sudo find /var/www/yourdomain.com -type f -exec chmod 644 {} +
# Lock down sensitive configuration files containing database credentials:
sudo chmod 600 /var/www/yourdomain.com/wp-config.php 2>/dev/null
sudo chmod 600 /var/www/yourdomain.com/.env 2>/dev/null
3. Updating database credentials and environment variables¶
Open your application's configuration file (for example, wp-config.php for WordPress, .env for Laravel/Node/Django, sites/default/settings.php for Drupal, or app/etc/env.php for Magento) and update:
- Database Name (
DB_NAME):prod_app_db - Database User (
DB_USER):prod_app_user - Database Password (
DB_PASSWORD): Your newly generated random password - Database Host (
DB_HOST):localhostឬ127.0.0.1(remember that many managed hosts use external RDS or remote MySQL hostnames; when moving to a self-contained VPS, this must be changed back tolocalhost)
Phase 4: Local hosts file testing before switching public DNS¶
Never point your live public DNS records to a newly migrated server before verifying that the site actually loads, connects to the database, and renders internal links properly. You can test the new server privately on your own computer while the rest of the world still sees your old DNS settings by editing your local hosts file.
- Locate your local
hostsfile:- Linux និង macOS៖ បើក terminal ហើយដំណើរការ
sudo nano /etc/hosts. - ** Windows 10 / 11 ៖ បើក Notepad ** as Administrator ហើយបើក
C:\Windows\System32\drivers\etc\hosts.
- Linux និង macOS៖ បើក terminal ហើយដំណើរការ
- បន្ថែមបន្ទាត់បដិសេធបណ្តោះអាសន្ននៅខាងក្រោមឯកសារ៖ ជំនួស
203.0.113.50ជាមួយនឹង អាសយដ្ឋាន IPv4 របស់ម៉ាស៊ីនមេថ្មីរបស់អ្នក៖ - ** រក្សាទុកឯកសារ និងសាកល្បងនៅក្នុងបង្អួចកម្មវិធីរុករកឯកជន**៖ ឥឡូវនេះកុំព្យូទ័ររបស់អ្នកនឹងឆ្លងកាត់ DNS សាធារណៈ ហើយផ្ទុក
yourdomain.comដោយផ្ទាល់ពី IP ម៉ាស៊ីនមេថ្មី។ សាកល្បងទំព័រដើម អត្ថបទខាងក្នុង permalinks (ប្រសិនបើទំព័ររងត្រឡប់មកវិញ404 Not Foundនៅលើ Nginx ត្រូវប្រាកដថាប្លុកម៉ាស៊ីនមេ Nginx របស់អ្នករួមបញ្ចូលtry_files $uri $uri/ /index.php?$args;) ទម្រង់ការចូលរបស់អតិថិជន និងការត្រួតពិនិត្យរទេះទិញទំនិញ។ - ** ដកខ្សែចេញពី
/etc/hostsនៅពេលការសាកល្បងជោគជ័យ **៖ កុំភ្លេចលុបបន្ទាត់ជំនួសបណ្តោះអាសន្នពីមូលដ្ឋានរបស់អ្នក។hostsឯកសារមុនពេលអនុវត្តការកាត់ DNS សាធារណៈពិតប្រាកដ។
ដំណាក់កាលទី 5៖ ការកាត់ឈ្មោះ DNS យុទ្ធសាស្រ្តឆ្លងកាត់ TTL និងវិញ្ញាបនបត្រ SSL/TLS¶
នៅពេលដែលការធ្វើតេស្តក្នុងស្រុកបញ្ជាក់ថាម៉ាស៊ីនមេថ្មីដំណើរការបានត្រឹមត្រូវ ប្រតិបត្តិការកាត់ DNS សាធារណៈ និងផ្តល់ការអ៊ិនគ្រីប HTTPS ។
កំណត់ត្រា DNS សំខាន់ៗដើម្បីធ្វើសវនកម្មកំឡុងពេលកាត់¶
| ប្រភេទកំណត់ត្រា | ម៉ាស៊ីន / ឈ្មោះ | តម្លៃគោលដៅ | គោលបំណង និងសកម្មភាពចំណាកស្រុក |
|---|---|---|---|
| ** កំណត់ត្រាមួយ ** | @ (ដែនឫសគល់) |
ម៉ាស៊ីនមេ IPv4 ថ្មី (ឧ. 203.0.113.50) |
បញ្ជូនចរាចរបណ្តាញ IPv4 ចម្បងទៅកាន់ម៉ាស៊ីនមេថ្មីរបស់អ្នក។ ធ្វើបច្ចុប្បន្នភាពភ្លាមៗនៅពេលកាត់។ |
| ** កំណត់ត្រា AAAA ** | @ (ដែនឫសគល់) |
ម៉ាស៊ីនមេ IPv6 ថ្មី (ឧ. 2001:db8::1) |
ផ្លូវ IPv6 ចរាចរ។ សំខាន់៖ ប្រសិនបើម៉ាស៊ីនមេថ្មីរបស់អ្នកមិនមានការកំណត់ IPv6 ទេ លុប កំណត់ត្រា AAAA ចាស់ ឬអ្នកទស្សនាពាក់កណ្តាលរបស់អ្នកនឹងនៅតែវាយលុកម៉ាស៊ីនមេស្លាប់។ |
| ** CNAME / A ** | www |
yourdomain.com (ឬ IPv4 ថ្មី) |
ផ្លូវ www ចរាចរណ៍ដែនរង។ រក្សាសមកាលកម្មជាមួយកំណត់ត្រាឫស។ |
| ** កំណត់ត្រា MX ** | @ |
ឈ្មោះម៉ាស៊ីនមេសំបុត្រ (ឧ. Google, Microsoft) | ធ្វើដំណើរតាមអ៊ីមែលរបស់ក្រុមហ៊ុនដែលចូលមក។ រក្សានៅដដែល ដូច្នេះអ៊ីមែលសាជីវកម្មមិនខូចទេ។ |
| ** TXT (SPF) ** | @ |
v=spf1 ip4:NEW_IP include:... ~all |
អនុញ្ញាត IP របស់ម៉ាស៊ីនមេថ្មីរបស់អ្នកដើម្បីផ្ញើអ៊ីមែលប្រតិបត្តិការដោយមិនចាំបាច់ចូលទៅក្នុងសារឥតបានការ។ |
| ** កំណត់ត្រា CAA ** | @ |
0 issue "letsencrypt.org" |
កំណត់ត្រាជាជម្រើសដែលដាក់កម្រិតអាជ្ញាធរវិញ្ញាបនបត្រណាដែលអាចចេញវិញ្ញាបនបត្រ SSL។ ផ្ទៀងផ្ទាត់វាអនុញ្ញាតឱ្យ Let's Encrypt ។ |
វិធីរំលងឃ្លាំងសម្ងាត់ DNS TTL ដែលជាប់គាំង 24 ម៉ោង (86,400 វិនាទី)¶
ប្រសិនបើម៉ាស៊ីនបណ្តាញចាស់របស់អ្នកគាំងដោយមិននឹកស្មានដល់ ខណៈពេលដែលកំណត់ត្រា DNS របស់អ្នកមាន Time To Live (TTL) យូរ 14,400 វិនាទី (4 ម៉ោង) ឬ 86,400 វិនាទី (24 ម៉ោង) ដោយគ្រាន់តែកែសម្រួល A កត់ត្រានៅខាងក្នុងតំបន់ DNS ចាស់មានន័យថាអ្នកដោះស្រាយ ISP ទូទាំងពិភពលោកនឹងបន្តបញ្ជូនអ្នកទស្សនាទៅកាន់អាសយដ្ឋាន IP ដែលស្លាប់រហូតដល់កម្មវិធីកំណត់ម៉ោងនោះផុតកំណត់។
- ** ល្បិចផ្ទេរឈ្មោះ Serveritative Nameserver**៖ ប្រសិនបើ DNS របស់អ្នកត្រូវបានបង្ហោះនៅលើ nameservers របស់ web host ដែលបានស្លាប់នោះ សូមចូលទៅក្នុង domain registrar របស់អ្នក ហើយផ្លាស់ប្តូរ domain’s Authoritative Nameservers (NS) របស់អ្នកទៅបណ្តាញ DNS anycast ឯករាជ្យ ដែលមានល្បឿនលឿន (ដូចជា Cloudflare DNS ឬ AWS Route 53) ដែលអ្នកបានបញ្ចូល DNS server របស់អ្នកជាមុន។ ការអាប់ដេតរបស់ server nameserver កម្រិតកំពូល (TLD) ជំរុញភ្លាមៗទៅកាន់ម៉ាស៊ីនមេ root សកល ហើយជារឿយៗឆ្លងកាត់ឃ្លាំងសម្ងាត់កំណត់ត្រាកុមារដែលជាប់គាំងឆ្លងកាត់ឧបករណ៍ដោះស្រាយដែលកើតឡើងដដែលៗសំខាន់ៗ (ដូចជា
1.1.1.1និង8.8.8.8) - Reverse Proxy Traffic Forwarding from the Old Server: If your old server is still accessible via SSH (for example, during a billing migration or hardware deprecation) and you want zero split-brain database writes while DNS propagates over 24 hours, install a lightweight Nginx reverse proxy block or
socattunnel on the old server that proxies 100 percent of incoming HTTP/HTTPS requests transparently over to the new server's IP address. That way, even visitors whose ISP has cached the old IP address are served live from the new server database immediately.
Provisioning free automated SSL/TLS certificates (Certbot / Let's Encrypt)¶
As soon as your public DNS points to the new server (or via DNS-01 API validation before switching DNS), install a trusted HTTPS certificate so visitors do not encounter browser security warnings:
# Install Certbot and the Nginx configuration plugin:
sudo apt install -y certbot python3-certbot-nginx
# Issue the certificate and configure automatic HTTP-to-HTTPS 301 redirects:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com \
--non-interactive --agree-tos -m admin@yourdomain.com --redirect
# Verify the systemd auto-renewal timer is active:
sudo systemctl status certbot.timer
Note
Let's Encrypt enforces strict production rate limits (up to 5 duplicate certificates per exact set of domains per 7 days, and 50 certificates per registered domain per week). If you are testing your server script repeatedly, always pass the --staging flag to certbot until your setup works, then run certbot once without --staging to fetch your live production certificate.
Phase 6: Protecting corporate email continuity (MX, SPF, DKIM, DMARC)¶
One of the most damaging side effects of a rushed website migration occurs when an administrator switches the domain's nameservers to a new host without copying over the domain's Mail Exchanger (MX) and authentication TXT records, silently blackholing all incoming company emails.
- Export your full DNS zone before changing nameservers: Before changing nameservers at your registrar, copy every existing
MX,TXT,SRV, andCNAMErecord from your current DNS dashboard. - Separate email hosting from web hosting: Never host mission-critical business email on the same local cPanel server as your public website. Use a dedicated email provider (such as Google Workspace, Microsoft 365, Fastmail, Proton Mail, or Zoho Mail) so a web server crash never interrupts company communications.
- Update your SPF record with the new server IP: If your website sends password reset emails, contact form notifications, or WooCommerce order receipts directly from the server, replace the old server IP with the new server IP inside your
v=spf1កំណត់ត្រា TXT ឬបញ្ជូនអ៊ីមែលចេញពីគេហទំព័រទាំងអស់តាមរយៈសេវាកម្ម SMTP API ប្រតិបត្តិការជាក់លាក់ (ដូចជា Postmark, Amazon SES, SendGrid ឬ Mailgun) ជាមួយនឹងការចុះហត្ថលេខា DKIM ។
ដំណាក់កាលទី 7៖ ការធ្វើចំណាកស្រុកដោយឡែកបន្ទាប់ពីមានការសម្របសម្រួលពីមេរោគ ឬ ransomware¶
ប្រសិនបើអ្នកកំពុងផ្លាស់ប្តូរគេហទំព័ររបស់អ្នក ដោយសារតែម៉ាស៊ីនចាស់បានផ្អាកគណនីរបស់អ្នកដោយសារមេរោគ ការចាក់បញ្ចូលមេរោគ ការបញ្ជូនសារឥតបានការ ឬការរំលោភបំពានលើ webshell នោះ **កុំគ្រាន់តែចម្លង និងស្រាយកញ្ចប់ចាស់ទាំងស្រុងនោះទេ។ public_html ទុកក្នុងប័ណ្ណសារលើម៉ាស៊ីនមេថ្មីរបស់អ្នក **។ ការធ្វើដូច្នេះចម្លង backdoor របស់អ្នកវាយប្រហារត្រង់ទៅកាន់ server ថ្មីរបស់អ្នក។
អនុវត្តតាមដំណើរការការងារសម្អាតបន្ទប់សម្អាតនេះជំនួសវិញ៖
- ដាក់ពង្រាយឯកសារកម្មវិធីស្នូលថ្មីៗពីប្រភពផ្លូវការ៖ ទាញយកច្បាប់ចម្លង CMS ឬ framework របស់អ្នកថ្មីដែលមិនធ្លាប់មាន (ឧទាហរណ៍ ទាញយកការចេញផ្សាយ WordPress ស្អាតដោយផ្ទាល់ពី
wordpress.orgឬក្លូនការប្តេជ្ញាចិត្តស្អាតដែលបានផ្ទៀងផ្ទាត់ពីឃ្លាំង Git របស់អ្នក) ហើយដំឡើងច្បាប់ចម្លងថ្មីនៃកម្មវិធីជំនួយ និងស្បែកទាំងអស់ពីឃ្លាំងផ្លូវការ ជាជាងចម្លងឯកសារចាស់wp-admin,wp-includes, ឬvendorថតឯកសារ។ - ចម្លងតែមេឌៀអ្នកប្រើប្រាស់ឋិតិវន្ត និងស្គ្រីបដែលអាចប្រតិបត្តិបានដែលលាក់៖ អ្នកវាយប្រហារតែងតែលាក់ webshells PHP ដែលក្លែងបន្លំនៅក្នុងថតផ្ទុករូបភាព (ដូចជា
wp-content/uploads/2026/05/avatar.jpg.phpឬ.icofiles containing PHP code). Copy only your media uploads folder into a quarantine directory and purge all executable scripts before moving it into your live webroot:# Delete any PHP, Python, Perl, or shell scripts hiding inside the uploads directory: sudo find /var/www/yourdomain.com/wp-content/uploads -type f \ \( -iname "*.php*" -o -iname "*.phtml" -o -iname "*.phar" -o -iname "*.py" -o -iname "*.sh" -o -iname "*.cgi" -o -iname ".htaccess" \) \ -exec rm -vf {} + - Disable PHP execution inside the uploads folder at the Nginx/Apache level: Add a location block in your Nginx virtual host config that blocks any
.phpfile inside/uploads/from ever being executed by PHP-FPM: - Inspect the SQL database dump for injected JavaScript and rogue admin users: Before importing your database, scan the
.sqlfile for injected<script>tags,eval(base64_decode(...))payloads, and check theuserstable (wp_usersin WordPress) to delete any unfamiliar administrator accounts created by the attacker. Rotate every database password, CMS security salt key, and API token immediately.
Building long-term resilience: the 3-2-1-1-0 backup architecture¶
Once your website is back online and stable, configure an automated, encrypted off-site backup pipeline so you never face a single point of failure again:
- 3 copies of your data: Your live production server plus at least two independent backup copies.
- 2 different storage formats: Fast hypervisor block snapshots alongside portable application-level dumps (
.sql.gz+.tar.gz) - 1 off-site cloud location on a completely separate provider: Never store your only backups on the same hosting company's servers. Use
resticឬborgbackupvia a daily cron job to push encrypted, deduplicated backups to an independent object storage bucket (such as AWS S3, Backblaze B2, Cloudflare R2, or Wasabi). - 1 immutable (append-only / Object Lock) copy: Configure S3 Object Lock or write-only API keys so that even if an attacker gains root SSH access to your web server, they cannot delete or encrypt your historical off-site backups.
- 0 unverified backups: Test restoring your backup archive to a staging environment at least once every quarter to confirm that your SQL dumps are complete and not silently empty.
សំណួរដែលគេសួរញឹកញាប់¶
How can I migrate my website if my old web host suspended my account and locked me out of cPanel and SSH?
First, check if you have any local backups, developer staging copies, or third-party backup plugin archives stored in Google Drive, Dropbox, or Amazon S3. If your only copy of the site is inside the suspended hosting account, contact the host's Abuse or Billing Compliance department calmly in writing and request a one-time generation of a downloadable backup archive (`cpmove` or `.tar.gz` of your files and SQL database) strictly for off-boarding purposes, offering to settle any undisputed past-due balance if billing was the cause. If the site was mostly informational and the host refuses all access, you can also extract your historical HTML pages, text, and images from the Internet Archive Wayback Machine (`web.archive.org`) using open-source Wayback downloader tools.
Why is my website showing a 500 Internal Server Error or Error Establishing a Database Connection after migrating?
An "Error Establishing a Database Connection" means the database name, username, password, or host address inside your configuration file (`wp-config.php` or `.env`) does not match the user you created in MySQL/MariaDB on the new server, or the `mariadb` service is stopped. A generic `500 Internal Server Error` or blank white screen usually stems from one of three causes: incorrect file ownership (fix with `chown -R www-data:www-data`), a syntax error in `.htaccess`, or a PHP version mismatch where an old plugin crashes on PHP 8.2/8.3. Check the exact error message by running `sudo tail -n 50 /var/log/nginx/error.log` or `/var/log/php8.3-fpm.log`.
Why does my home page work on the new server, but every internal page returns a 404 Not Found error?
When migrating a CMS like WordPress, Laravel, or Drupal from an Apache server (which uses `.htaccess` files for URL rewriting) to an Nginx server (which ignores `.htaccess` files completely), internal permalinks will return `404 Not Found` unless you add a rewrite rule inside your Nginx site configuration block. Open `/etc/nginx/sites-available/yourdomain.com`, locate the `location /` block, make sure it contains `try_files $uri $uri/ /index.php?$args;`, and reload Nginx with `sudo systemctl reload nginx`.
How do I prevent losing new WooCommerce orders or user comments while DNS is propagating to the new server?
To achieve a zero-data-loss migration for dynamic e-commerce or membership sites, place the site into brief "Maintenance Mode" on the old server (blocking new checkout submissions for 10 to 15 minutes) right before taking your final `mysqldump`, import that final SQL dump onto the new server, and then immediately switch your DNS `A`/`AAAA` records (or flip the IP inside your Cloudflare proxy dashboard, which cuts traffic over globally within 30 seconds). You can also configure Nginx on the old server to reverse-proxy requests to the new server IP so visitors with stale DNS caches still interact with the new database.
What should I do if my domain name itself is registered with the failing web hosting company?
Separate your domain registration from your web hosting immediately. However, if your site is currently down, do not start an ICANN Registrar Transfer first, because transferring a domain between registrars takes up to 5 to 7 days and locks your nameservers during the transfer window. Instead, first log into the current registrar panel and change the **Nameservers (NS)** to an independent DNS provider (like Cloudflare or Route 53) to get your website back online today. Once your website is stable on the new server, unlock the domain, get the EPP Auth Code, and transfer the domain registration to an independent registrar.
Why are some visitors seeing my new server while others still see the old broken server hours later?
This is called DNS propagation delay, caused by two factors: the Time To Live (TTL) caching setting that was on your old DNS records before you changed them, and forgotten IPv6 (`AAAA`) records. Many mobile carriers (such as T-Mobile, Verizon, EE, and Telstra) route smartphone traffic preferentially over IPv6. If you updated your IPv4 `A` record to point to the new server, but forgot to update or delete the old IPv6 `AAAA` record, desktop users on Wi-Fi will see your new working site while mobile phone users on 5G will continue hitting the dead server via IPv6.
ប្រភពបានពិនិត្យ¶
- National Institute of Standards and Technology (NIST, United States): Special Publication 800-34 Rev. 1, Contingency Planning Guide for Federal Information Systems and Server Recovery (
csrc.nist.gov) - Cybersecurity and Infrastructure Security Agency (CISA, United States): Capacity Enhancement Guides on Cloud Security, DNS Security, and Ransomware Recovery from Backups (
cisa.gov) - National Cyber Security Centre (NCSC, United Kingdom): Offline and Immutable Backup Guidance, Web Server Security, and Transport Layer Security (TLS) Best Practices (
ncsc.gov.uk) - Internet Engineering Task Force (IETF, International): RFC 1034 / RFC 1035 (Domain Name System Caching and TTL Specifications) and RFC 8555 (ACME Automated Certificate Management Protocol) (
ietf.org) - សាជីវកម្មអ៊ីនធឺណិតសម្រាប់ឈ្មោះ និងលេខដែលបានចាត់តាំង (ICANN, អន្តរជាតិ)៖ គោលនយោបាយស្តីពីការផ្ទេរការចុះឈ្មោះរវាងអ្នកចុះឈ្មោះ និងសិទ្ធិចុះឈ្មោះ (
icann.org) - ** គម្រោងសុវត្ថិភាពកម្មវិធីគេហទំព័របើកចំហ (OWASP, អន្តរជាតិ)**៖ ការពង្រឹងម៉ាស៊ីនមេ ការសម្អាតការបង្ហោះឯកសារ និងសន្លឹកបន្លំសុវត្ថិភាពមូលដ្ឋានទិន្នន័យ (
owasp.org)