Thêm nhiều trang web thông qua tự động hóa Add multiple sites via automation បន្ថែមគេហទំព័រ multiple តាមរយៈស្វ័យប្រវត្តិកម្ម
Hướng dẫn chi tiết đồng bộ từ docs Cloudflare — mỗi section có backlink tới đúng vị trí trên trang gốc. Detailed guide synced from Cloudflare docs — each section links to the matching anchor on the official page. មគ្គុទ្ទេសក៍លម្អិតធ្វើសមកាលពី docs Cloudflare — ផ្នែកនីមួយៗមានតំណទៅទីតាំងត្រូវគ្នានៅទំព័រផ្លូវការ។
← Danh mục ← Catalog ← បញ្ជីGiải thích nhanh Quick context បរិបទរហ័ស
Tutorial đa lĩnh vực — kết hợp nhiều sản phẩm Cloudflare. Tutorial «Thêm nhiều site via automation» giúp bạn làm quen luồng triển khai thật — phù hợp đọc trước khi mở tài liệu gốc tiếng Anh. Docs gốc chia khoảng 2 bước chính; bản tóm tắt dưới đây giúp bạn nắm khung trước khi làm theo từng lệnh.
To add multiple sites to Cloudflare at once and more efficiently, you can do so via the Cloudflare API.
ដើម្បីបន្ថែមគេហទំព័រ multiple ទៅ Cloudflare ក្នុងពេលតែមួយ និងកាន់តែមានប្រសិទ្ធភាព អ្នកអាចធ្វើដូច្នេះបានតាមរយៈ Cloudflare API ។
Lưu ý Note ចំណាំ
Lưu ý trước khi làm Notes before you start ចំណាំមុនពេលចាប់ផ្តើម
- Đây là bản tóm tắt trên Orange Cloud Learning Hub — không thay thế tài liệu chính thức.
- Luôn mở liên kết «Tài liệu gốc» bên dưới khi cần lệnh CLI, snippet code và ảnh minh họa đầy đủ.
- Docs Cloudflare cập nhật thường xuyên — đối chiếu ngày «Rà soát lần cuối» trên trang gốc khi triển khai production.
- This is a summary on Orange Cloud Learning Hub — it does not replace the official documentation.
- Open the Official docs link below for CLI commands, code snippets, and full screenshots.
- Cloudflare docs change frequently — verify the Last reviewed date on the official page before production use.
- នេះគឺជាការសង្ខេបនៅលើ Orange Cloud Learning Hub — វាមិនជំនួសឯកសារផ្លូវការទេ។
- បើកតំណឯកសារផ្លូវការខាងក្រោមសម្រាប់ពាក្យបញ្ជា CLI កូដ snippets និងរូបថតអេក្រង់ពេញ។
- Cloudflare ឯកសារផ្លាស់ប្តូរជាញឹកញាប់ — ផ្ទៀងផ្ទាត់កាលបរិច្ឆេទដែលបានពិនិត្យចុងក្រោយនៅលើទំព័រផ្លូវការមុនពេលប្រើប្រាស់ផលិតកម្ម។
Tài liệu gốc — rà soát lần cuối: 5 months ago Official docs — last reviewed: 5 months ago ឯកសារផ្លូវការ — ពិនិត្យចុងក្រោយ: 5 months ago
Overview Overview ទិដ្ឋភាពទូទៅ
Phần «Tổng quan» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Overview" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «ទិដ្ឋភាពទូទៅ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
- Có nhiều tên miền lập bản đồ trở lại một tên miền duy nhất (thông thường cho các tên miền ở các quốc gia khác nhau - chẳng hạn như
.com.au,.co.uk\- mà bạn muốn được bảo vệ bởi Cloudflare). - Là một partner ↗, cơ quan, hoặc tư vấn CNTT, và quản lý nhiều miền thay mặt cho khách hàng của bạn.
- đang di chuyển một tập hợp các trang web hiện có sang Cloudflare.
- Have multiple domains mapping back to a single, canonical domain (common for domains in different countries - such as
.com.au,.co.uk\- that you want protected by Cloudflare). - Are a partner ↗, agency, or IT consultancy, and manage multiple domains on behalf of your customers.
- Are moving an existing set of sites over to Cloudflare.
- មាន multiple domains mapping back to single, canonical domains (ទូទៅសម្រាប់ domains នៅក្នុងប្រទេសផ្សេងៗគ្នា - ដូចជា
.com.au.co.uk\- ដែលអ្នកចង់បានការពារដោយ _0_TERM16)។ - គឺជា ដៃគូ ↗ ភ្នាក់ងារ ឬទីប្រឹក្សាព័ត៌មានវិទ្យា និងគ្រប់គ្រង multiple នៃអតិថិជនរបស់អ្នកនៅលើដែន។
- កំពុងផ្លាស់ទីសំណុំនៃគេហទំព័រដែលមានស្រាប់ទៅ Cloudflare ។
Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)
Điều kiện Prerequisites តម្រូវការជាមុន
Phần «Yêu cầu trước» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Prerequisites" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «តម្រូវការជាមុន» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
- Một Cloudflare account hiện tại.
- Dòng lệnh với
curl - Một Cloudflare API token với một trong các quyền sau:
- An existing Cloudflare account.
- Command line with
curl - A Cloudflare API token with one of the following permissions:
- Cloudflare គណនីដែលមានស្រាប់។
- បន្ទាត់ពាក្យបញ្ជាជាមួយ
curl - A Cloudflare a_TER ការអនុញ្ញាត៖
Administrator Khu vực Zone: Edit và DNS: Edit * Tài khoản Domain AdministratorAdministrator Zone-level Zone: Edit and DNS: Edit * Account-level Domain AdministratorAdministrator Zone-level Zone: Edit និង DNS: Edit * កម្រិតគណនី - Để vô hiệu hóa DNSSEC cho mỗi tên miền tại đăng ký của bạn (nơi bạn đã mua tên miền của bạn).
- To have disabled DNSSEC for each domain at your registrar (where you bought your domain name).
Provider-specific DNSSEC instructions This is not an exhaustive list, but the following links may be helpful: DNSimple ↗ Domaindiscount24 ↗ DreamHost ↗ Dynadot ↗ Enom ↗ Gandi ↗ GoDaddy ↗ Hostinger ↗ Hover ↗ Infomaniak ↗ InMotion Hosting ↗ INWX ↗ Joker.com ↗ Name.com ↗ Namecheap ↗ NameISP ↗ Namesilo ↗ OVH ↗ Squarespace ↗ Registro.br ↗ Porkbun ↗ (do not fill out keyData) TransIP ↗ Note If your previous provider allows you to add DNSKEY records on the zone apex and use these records in responses to DNS queries, refer to this migration tutorial to learn how to migrate a zone with DNSSEC enabled. Provider-specific DNSSEC instructions This is not an exhaustive list, but the following links may be helpful: DNSimple ↗ Domaindiscount24 ↗ DreamHost ↗ Dynadot ↗ Enom ↗ Gandi ↗ GoDaddy ↗ Hostinger ↗ Hover ↗ Infomaniak ↗ InMotion Hosting ↗ INWX ↗ Joker.com ↗ Name.com ↗ Namecheap ↗ NameISP ↗ Namesilo ↗ OVH ↗ Squarespace ↗ Registro.br ↗ Porkbun ↗ (do not fill out keyData) TransIP ↗ Note If your previous provider allows you to add DNSKEY records on the zone apex and use these records in responses to DNS queries, refer to this migration tutorial to learn how to migrate a zone with DNSSEC enabled. ការណែនាំ DNSSEC ជាក់លាក់របស់អ្នកផ្តល់សេវា នេះមិនមែនជាបញ្ជីពេញលេញទេ ប៉ុន្តែតំណភ្ជាប់ខាងក្រោមអាចមានប្រយោជន៍៖ DNSimple ↗ Doma href="https://help.dreamhost.com/hc/en-us/articles/219539467" class="link" target="_blank" rel="noopener noreferrer">DreamHost ↗Dynadot ↗Enom ↗ Gandi ↗GoDaddy ↗Hostinger ↗ < href="https://support.hover.com/support/solutions/articles/201000064716" class="link" target="_blank" rel="noopener noreferrer">Hover ↗ Infomaniak ↗ INWX ↗Joker.com ↗Name.com ↗ rel="link" target="_blanker""> ↗ NameISP ↗Namesilo ↗ ↗ Squarespace ↗ ↗ សាច់ជ្រូកប៊ុន ↗ កុំបំពេញពាក្យគន្លឹះ href="https://www.transip.eu/knowledgebase/150-secure-domains-custom-nameservers-dnssec/" class="link" target="_blank" rel="noopener noreferrer">Trans_5_TERa_62 អនុញ្ញាតឱ្យអ្នកផ្តល់សេវា បន្ថែមកំណត់ត្រា DNSKEY នៅលើ zone apex ហើយប្រើកំណត់ត្រាទាំងនេះក្នុងការឆ្លើយតបទៅនឹងសំណួរ DNS យោងទៅលើ បង្រៀនពីរបៀបធ្វើ migration ជាមួយ DNSSEC បានបើក។ --- --- --- Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)
1.Điều Thêm Domains 1. Add domains 1. បន្ថែមដែន
Phần «Thêm domains» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "1. Add domains" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «1. បន្ថែមដែន» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
- Tạo một danh sách các tên miền bạn muốn thêm, mỗi tên miền trên một dòng riêng biệt (newline tách biệt), được lưu trữ trong một tệp như
domains.txt. - Tạo một script bash
add-multiple-zones.shvà thêm những điều sau đây. Thêmdomains.txtvào cùng một thư mục hoặc cập nhật đường dẫn tương ứng.
- Create a list of domains you want to add, each on a separate line (newline separated), stored in a file such as
domains.txt. - Create a bash script
add-multiple-zones.shand add the following. Adddomains.txtto the same directory or update its path accordingly.
- បង្កើតបញ្ជីនៃដែនដែលអ្នកចង់បន្ថែម ដែលនីមួយៗនៅលើបន្ទាត់ដាច់ដោយឡែក (បន្ទាត់ថ្មីដាច់ដោយឡែក) ដែលរក្សាទុកក្នុងឯកសារដូចជា
domains.txt។ - បង្កើត bash script
add-multiple-zones.shហើយបន្ថែមដូចខាងក្រោម។ បន្ថែមdomains.txtទៅថតដូចគ្នា ឬធ្វើបច្ចុប្បន្នភាពផ្លូវរបស់វាទៅតាមនោះ។
for domain in $(cat domains.txt); do
printf "Adding ${domain}:\n"
curl https://api.cloudflare.com/client/v4/zones \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"account": {
"id":"<ACCOUNT_ID>"
},
"name": "'"$domain"'",
"type": "full"
}'
printf "\n\n"
done - Mở dòng lệnh và chạy:
- Open the command line and run:
- បើកបន្ទាត់ពាក្យបញ្ជាហើយដំណើរការ៖
bash add-multiple-zones.sh Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)
Các lựa chọn bổ sung Additional options ជម្រើសបន្ថែម
Phần «Additional options» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Additional options" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «ជម្រើសបន្ថែម» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
echo '{"foo":{"bar":"foo","testing":"hello"}}' | jq . jq documentation ↗ để biết thêm thông tin.jq documentation ↗ for more information.jq ឯកសារ ↗ សម្រាប់ព័ត៌មានបន្ថែម។jq với tùy chọn đầu tiên ở trên, sửa đổi kịch bản của bạn add-multiple-zones.sh để trích xuất ID miền và chạy một cuộc gọi API tiếp theo để quét nhanh các bản ghi DNS.jq with the first option above, modify your script add-multiple-zones.sh to extract the domain ID and run a subsequent API call to quick scan DNS records.jq ជាមួយនឹងជម្រើសទីមួយខាងលើ សូមកែប្រែ script add-multiple-zones.sh ដើម្បីទាញយកលេខសម្គាល់ដែន ហើយដំណើរការការហៅទូរសព្ទទៅ __1_TER_0_0_0 រហ័សបន្ទាប់ __1_TERM5_0 កំណត់ត្រា។for domain in $(cat domains.txt); do
printf "Adding ${domain}:\n"
add_output=`curl https://api.cloudflare.com/client/v4/zones \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"account": {
"id":"<ACCOUNT_ID>"
},
"name": "'"$domain"'",
"type": "full"
}'`
echo $add_output | jq .
domain_id=`echo $add_output | jq -r .result.id`
printf "\n\n"
printf "DNS quick scanning ${domain}:\n"
scan_output=`curl --request POST https://api.cloudflare.com/client/v4/zones/$domain_id/dns_records/scan \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>"`
echo $scan_output | jq .
done Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)
2.Đối với Update tên miền 2. Update nameservers 2. អាប់ដេត nameservers
Phần «Cập nhật nameservers» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "2. Update nameservers" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «2. អាប់ដេត nameservers» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
- Thay đổi tập lệnh
add-multiple-zones.shđể in CSV với dữ liệu từ câu trả lờiCreate ZoneJSON.
- Modify your script
add-multiple-zones.shto print a CSV with data from theCreate ZoneJSON response.
- កែប្រែ script
add-multiple-zones.shរបស់អ្នក ដើម្បីបោះពុម្ព CSV ជាមួយនឹងទិន្នន័យពីCreate Zoneការឆ្លើយតប JSON ។
for domain in $(cat domains.txt); do
printf "Adding ${domain}:\n"
add_output=`curl https://api.cloudflare.com/client/v4/zones \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"account": {
"id": "<ACCOUNT_ID>"
},
"name": "'"$domain"'",
"type": "full"
}'`
# Create csv of nameservers
echo $add_output | jq -r '[.result.name,.result.id,.result.name_servers[]] | @csv' >> /tmp/domain_nameservers.csv
domain_id=`echo $add_output | jq -r .result.id`
printf "\n\n"
printf "DNS quick scanning ${domain}:\n"
scan_output=`curl --request POST https://api.cloudflare.com/client/v4/zones/$domain_id/dns_records/scan \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>"`
echo $scan_output | jq .
done
printf "name_servers are saved in /tmp/domain_nameservers"
cat /tmp/domain_nameservers.csv - Sử dụng các giá trị trong cột NAME SERVERS để update the nameservers tại đăng ký của mỗi miền.
- Use the values in the NAME SERVERS column to update the nameservers at the registrar of each domain.
- ប្រើតម្លៃក្នុងជួរឈរ NAME SERVERS ដើម្បី nameservers នៅឯអត្រានុកូលដ្ឋាននៃដែននីមួយៗ។
Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)
Giới hạn Limitations ដែនកំណត់
Phần «Limitations» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Limitations" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «ដែនកំណត់» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
Các vấn đề chung Common issues បញ្ហាទូទៅ
Phần «Common issues» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.
Read the "Common issues" section below — open the official docs link for full screenshots and configuration tabs.
អានផ្នែក «បញ្ហាទូទៅ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/fundamentals/","name":"Cloudflare Fundamentals"}},{"@type":"ListItem","position":3,"item":{"@id":"/fundamentals/manage-domains/","name":"Domains"}},{"@type":"ListItem","position":4,"item":{"@id":"/fundamentals/manage-domains/add-multiple-sites-automation/","name":"Add multiple sites via automation"}}]} Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)
Xem bản đầy đủ trên developers.cloudflare.com (ảnh, tab cấu hình). View the full guide on developers.cloudflare.com (images, config tabs). មើលមគ្គុទ្ទេសក៍ពេញលើ developers.cloudflare.com (រូបភាព, tab កំណត់)។
Tài liệu gốc ↗ Official docs ↗ ឯកសារផ្លូវការ ↗