ဝဘ်ဆာဗာ Access Log မှ 4xx နှင့် 5xx အမှား URLများကို ချက်ချင်း စစ်ထုတ်နိုင်တဲ့ Script သည် ဝဘ်ဆာဗာ၏ access log ကိုဖတ်၍ Client-side 4xx error နှင့် Server-side 5xx error ထုတ်ပေးတဲ့ URLများကို အလိုအလျောက် စာရင်းပြုစုနိုင်တဲ့ လက်တွဲရလွယ်သော နည်းလမ်းတစ်ခုဖြစ်ပါတယ်။ ဒီ script နဲ့တစ်ဆက်တည်း ဘယ်စာမျက်နှာတွေ 404, 403, 500, 502, 503 error ပြနေသလဲ၊ SEO ရှုံးနစ်မှု၊ Crawl budget မပေးသုံးခြင်း၊ Broken link, Performance ပြဿနာတွေကို တစ်ခါတည်း သိနိုင်ပါတယ်။
ဝဘ်ဆိုဒ်မှာ ပြဿနာဖြစ်နေတဲ့ URL တွေကို Browser ထဲမှာ browse လုပ်ရုံနဲ့ သိနိုင်မှာ မဟုတ်ပါဘူး။ အချို့ error တွေ API request, bot, အဟောင်း campaign link, mobile user agent, traffic ကြီးတဲ့အချိန်မှာပဲ ပေါ်လာနိုင်ပါတယ်။ Access log files တွေက ဆာဗာကို လာသော request တစ်ခုချင်းစီ၏ date, IP, method, URL path, HTTP status code, response size, user-agent စသည့် အချက်အလက်လုံးဝ ထည့်ထားတာဖြစ်ပါတယ်။ ဒီကြောင့် Technical SEO, Security, Operation အသင်းများအတွက် log analysis က မလိုမရပါ။
ဒီ guide မှာ Apache နဲ့ Nginx access log မှ 4xx/5xx error URL တွေကို Bash script နဲ့ စစ်ထုတ်နည်း၊ command နမူနာ၊ output format, data ဘာလို့အရေးကြီးသလဲ၊ priority များအဆင့်လိုက်ဖော်ပြထားပါတယ်။ Root access ရှိတဲ့ VPS သုံးသူတွေအနေနဲ့ တိုက်ရိုက် run လို့ရပြီး Shared hosting user တွေအနေနဲ့ Control panel မှ log ကို download လုပ်ပြီး ဒီနည်းနဲ့ စစ်နိုင်ပါတယ်။ အပြင် Hostragons ဝဘ်ဟိုစတင်းပက်ကေ့များ တစ်ခုအတွက် hosting infrastructure ကို အမြဲစိတ်ချစေဖို့၊ အထက်တန်း control လိုအပ်တဲ့ project များအတွက် Hostragons VPS ဆာဗာဖြေရှင်းမှုများ တွေကိုလည်း စဉ်းစားနိုင်ပါတယ်။
Access Log ဆိုတာဘာလဲ? 4xx/5xx Analysis ဘာလို့ အရေးကြီးသလဲ?
Access log ဆိုတာ ဝဘ်ဆာဗာကို လာတဲ့ HTTP request တစ်ခုချင်းစီကို မှတ်တမ်းတင်ထားတဲ့ log file တစ်ခုပါ။ Apache မှာ /var/log/apache2/access.log, /var/log/httpd/access_log တို့မှာ, Nginx မှာ /var/log/nginx/access.log မှာတွေ့နိုင်ပါတယ်။ Control panel တွေမှာ domain အလိုက် log တွေချင်း ခွဲထားနိုင်ပါတယ်။ cPanel, Plesk, DirectAdmin သုံးတဲ့ user တွေအနေနဲ့ log တွေကို compressed archive အနေနဲ့ download လုပ်နိုင်ပါတယ်။
HTTP status code တွေက request result ကို classification လုပ်ပါတယ်။ 2xx success, 3xx redirect, 4xx client error, 5xx server error ဖြစ်ပါတယ်။ SEO အတွက် အထူးသဖြင့် 404, 410, 403, 429, 500, 502, 503, 504 ကို မကြာခဏ ကြည့်ဖို့လိုပါတယ်။ Search engine bot တွေ ဒီ code တွေကို မကြာခဏ တွေ့ရင် Page ကို index မှာ ဖယ်တားနိုင်သလို, crawl frequency လျှော့နိုင်သလို, site quality signal ကို မမှန်မှန် သတ်မှတ်နိုင်ပါတယ်။
ဥပမာ 100,000 line access log မှာ 404 error 12,000 ခုရှိရင် Broken link တစ်ခုနှစ်ခုတင် မဟုတ်နိုင်ပါဘူး။ Wrong sitemap, old URL, faulty internal link, canonical, deleted image, bot attack တွေတင်ပြနေပါတယ်။ 500 error တွေ specific hour တွေမှာ ပိုများလာရင် PHP memory limit, database connection, disk I/O, cache layer စတာတွေကို စစ်ဖို့လိုပါတယ်။
4xx/5xx Error Code များ၏ အနုတ်လက္ခဏာ
Script မရေးခင် ဘယ် code ဘာကို ဆိုလိုသလဲ သိထားဖို့ လိုပါတယ်။ 404 error တစ်ခုစီတိုင်း အလျှင်သက်သက် ပြုပြင်ဖို့ မလိုအပ်သလို၊ 403 ကလည်း security issue လို့ မထင်သင့်ပါဘူး။ နောက်ထပ် ပြပြီး User traffic, bot traffic ရရှိနေတဲ့ error တွေကို အလေးထားဖို့လိုပါတယ်။
| Code | Type | အနုတ်လက္ခဏာ | လုပ်ဆောင်ရန် |
|---|---|---|---|
| 400 | 4xx | Request မမှန်ပါ/parameter error | Application & redirect rule စစ်ပါ |
| 403 | 4xx | Access တားမြစ်ထားသည် | Permission, file access, security rule စစ်ပါ |
| 404 | 4xx | Resource မတွေ့ပါ | Broken link ပြုပြင်ပါ၊ 301 redirect ထည့်ပါ |
| 410 | 4xx | Resource ပျောက်သွားသည် (အမြဲတမ်း) | Sitemap, internal link များကို သန့်စင်ပါ |
| 429 | 4xx | Request များနToo many requests | Rate limit, bot traffic, CDN setting စစ်ပါ |
| 500 | 5xx | Server general error | Application log, PHP/database error စစ်ပါ |
| 502 | 5xx | Bad Gateway | Proxy, upstream service, PHP-FPM connection စစ်ပါ |
| 503 | 5xx | Service unavailable | Resource usage, maintenance mode, limit စစ်ပါ |
| 504 | 5xx | Gateway timeout | Slow query, timeout setting, network latency စစ်ပါ |
Log Format ကို သိခြင်း – Script မှာ အဓိကပါ
Apache, Nginx က access log format မတူညီနိုင်ပါတယ်။ အများဆုံး format က IP, timestamp, method & URL, HTTP version, status code, response size, referer, user-agent ဖြစ်ပါတယ်။ Script မှာ status code ဘယ် field မှာရှိသလဲ သိဖို့လိုပါတယ်။ Apache combined log format မှာ status code နောက်ဆုံး field မဟုတ်နိုင်ပါတယ်။ အချို့ request portion တွေမှာ space ပါလို့ field counting လုပ်ရင် error ဖြစ်နိုင်ပါတယ်။
ထို့ကြောင့် တစ်ကယ် solid extraction နည်းက request portion, status code ကို regex နဲ့ ယူသင့်ပါတယ်။ Nginx log format ကို customize လုပ်ထားလား စစ်ဖို့လိုပါတယ်။ Regular expression ကို log sample 20 lines နဲ့ manual check လုပ်တာ အကောင်းဆုံးပါ။
Quick check အတွက် terminal မှာ log file last line ကို tail လုပ်ပြီး 404 error URL တစ်ခုကို purposely request လုပ်ပါ။ Access log တစ်ခုချင်းစီ status code, method, URL, user-agent, referer စနည်းနဲ့ check လုပ်ပါ။
4xx/5xx Error URL Extraction Script – အလုပ်လုပ်ပုံ
ကောင်းတဲ့ error extraction script က error line တွေကိုသာမက၊ error တွေကို group လုပ်ပြီး repeat count, last seen date, status code, URL path တို့ကို report ထုတ်နိုင်ဖို့ လိုပါတယ်။ 404 error တစ်ခါ versus 404 error 20,000 ကြိမ် တွေ priority မတူပါ။ 5xx error တွေကို file တစ်ခုခြားထုတ်ဖို့ လည်း အစီအစဉ်ထားသင့်ပါတယ်။
အလုပ်လုပ်ပုံ အကျဉ်း –
- Log file ကို line-by-line ဖတ်ပါ
- HTTP status code 400–599 line တွေ filter လုပ်ပါ
- URL path, method, status code extract လုပ်ပါ
- Status code + URL တစ်ခုချင်းစီ count လုပ်ပါ
- Repeat count အမြင့်ဆုံး error တွေကို sort လုပ်ပါ
- User-agent field ကို bot/user ခွဲခြားဖို့ optionally log လုပ်ပါ
- CSV output file တစ်ခုထုတ်ပါ
Linux command line မှာ awk, grep, sort, uniq command တွေသုံးရင် ရိုးရှင်းတဲ့ site တွေအတွက် ရပါပြီ။ Site ကြီးများအတွက် Python script သုံးရင် memory management, compressed file support, date filter, bot detection စတာတွေက ပိုလွယ်ပါတယ်။ Log file GB ကြီးများဖြစ်ပါက line-by-line processing လုပ်သင့်ပါတယ်။
Quick Solution – One-liner Command
Test အတွက် အမြန်ဆုံးနည်းက access log မှ 4xx/5xx coded line တွေကို URL-based count လုပ်တာပါ။ Apache/Nginx combined format မှာ awk နဲ့ GET/POST/HEAD request detect, status code 4/5 နဲ့ URL path ကို sort, count, top 50 result show လုပ်နိုင်ပါတယ်။
Command logic:
- Log file read
- 4xx/5xx status code filter
- Method, URL extract
- Group by status+URL
- Top 50 show
Shared hosting သုံးသူအနေနဲ့ log ကို download လုပ်ပြီး macOS/Linux terminal မှာ run လုပ်နိုင်ပါတယ်။ Windows user တွေအနေနဲ့ WSL, Git Bash, PowerShell နဲ့ similar analysis လုပ်နိုင်ပါတယ်။ WordPress site ဖြစ်ပါက 404 error တစ်ချို့က deleted media, old plugin path, bot wp-admin access attempt ဖြစ်နိုင်ပါတယ်။ WordPress performance/security အတွက် WordPress hosting ဖြေရှင်းချက်များ, SSL လိုင်စင် တပ်ဆင်ခြင်း content တွေကလည်း အကျိုးတိုးနိုင်ပါတယ်။
Bash Script Example Design
နမူနာ script အောက်ပါ logic နဲ့ production မှာ အသုံးပြုနိုင်ပါတယ်။ Script က access log file ဖြစ်စေရန် path, output file name ကို သင့် environment အတိုင်း ပြင်ဆင်ဖို့လိုပါတယ်။
Script workflow:
- LOG_FILE variable မှ access.log assign
- OUTPUT variable မှ report.csv assign
- awk နဲ့ HTTP request, status code extract
- 400–599 code line တွေ status,url key ပြုလုပ်
- END portion မှ key-wise count print
- Sort by count descending
- Header line ဖြင့် CSV report ပြုလုပ်
Command example: ./find-http-errors.sh /var/log/nginx/access.log hatali-url-raporu.csv Report ထဲမှာ status, url, count column တွေပါဝင်သည်။ ဥပမာ 404,/old-product.html,184, 500,/checkout,37, စသည့် record တွေပါဝင်နိုင်ပါတယ်။ SEO specialist, developer, system admin တို့ data တစ်ခုတည်းကို reference ပြုလုပ်နိုင်ပါတယ်။
Script ကို ပိုတည်ငြိမ်အောင် အောက်ပါ feature တွေ ပြုလုပ်နိုင်ပါတယ် – gzip compressed access.log.1.gz ကို zcat/zgrep နဲ့ support, date filter ထည့်ခြင်း, referer/user-agent လည်း log လုပ်ခြင်း။ Googlebot နဲ့ 404/5xx error တွေ SEO priority အတွက် အလွန်အရေးကြီးပါတယ်။
Python နဲ့ ပိုရှင်းလင်းသော Log Extraction
Project ကြီးများအတွက် Python နဲ့ script တစ်ခုရေးရင် regex နဲ့ method, URL, status code, HTTP version capture လုပ်ပြီး collections.Counter နဲ့ status+URL pair count လုပ်နိုင်ပါတယ်။ gzip module နဲ့ compressed log open, csv module နဲ့ report write, argparse နဲ့ command-line parameter support လုပ်နိုင်ပါတယ်။
Param example:
- --log access.log
- --output errors.csv
- --min-status 400
- --max-status 599
- --top 1000
Script ကို cron job နဲ့ daily/nightly run လုပ်နိုင်ပါတယ်။ ဥပမာ 03:30 AM script run, log analysis, report write to /var/reports/http-errors.
Python approach advantage တစ်ခုက error prioritization ဖြစ်ပါတယ်။ Score formula – count x code weight x bot weight. 5xx = 3, 404 = 1, Googlebot user-agent = 2 multiplier ထည့်ရင် SEO priority higher error တွေ list ထဲမှာ အထက်ဆုံးမှာပါဝင်တယ်။ E-commerce site ကြီးများအတွက် hundreds of thousands error ကို manage လုပ်လို့ရပါတယ်။
Report Interpretation – Error Fix Priority

Report ရပြီးတာနဲ့ အတန်ဆုံးအကြောင်းက data ကို မှန်ကန်စွာ ဖော်ပြခြင်းပါ။ အများဆုံးဖြစ်တဲ့ mistake က URL တစ်ခုစီကို automatic 301 redirect လုပ်တာပါ။ ဒါက short-term 404 error ကိုလျှော့သွားစေသော်လည်း Irrelevant redirect တွေက user experience နှင့် search engine signal ကို ပျက်စီးစေတယ်။ Product မှပျောက်သွားပြီး equivalent product မရှိရင် 410 code သုံးသင့်ပါတယ်။
Priority sequence:
- 5xx error (payment, login, cart, API, homepage) – အလျင်ဆုံး စစ်ဖို့
- Googlebot crawl 4xx error – sitemap, internal link, canonical source
- High-traffic 404 – user experience, redirect/content recovery
- Static file error – missing CSS, JS, image impact Core Web Vitals
- Bot irrelevant crawl – security/rate limit check, SEO priority နိမ့်
ဥပမာ /campaign-2024 URL က 404 error 8000 ကြိမ်/month ဖြစ်ပြီး backlink ရှိနေသလား၊ new campaign page သို့ redirect သင့်ပါတယ်။ /phpmyadmin, /wp-login.php တို့က bot access only ဖြစ်လို့ SEO problem မဟုတ်ပါဘူး။ Security firewall, WAF, rate limit ကို ပိုစဉ်းစားပါ။ Safe connection, user trust အတွက် Hostragons SSL စားပွဲများ ကိုလည်း အသုံးပြုနိုင်ပါတယ်။
Apache vs Nginx – Log Analysis မှာ သတိထားရန်
Apache, Nginx access log format မတူနိုင်သော်လည်း Reverse proxy, CDN, Load balancer, Custom log format တွေကြောင့် တစ်ယောက်နှင့်တစ်ယောက် မတူနိုင်ပါတယ်။ Nginx နောက်မှာ PHP-FPM ရှိလျှင် 502, 504 error တွေ upstream ဖြစ်နိုင်တယ်။ Apache mod_proxy သုံးလျှင် backend application မှ error ဖြစ်နိုင်တယ်။ Access log, error log ကို တစ်ပြိုင်နက် စစ်သင့်ပါတယ်။
Apache error.log မှာ PHP fatal error, .htaccess syntax error, permission issue တွေပါဝင်နိုင်တယ်။ Nginx error.log မှာ upstream timed out, connect failed, permission denied phrase တွေကို တောင်ကြည့်ပါ။ Traffic တက်လာရင် application fix + server resource upgrade လုပ်ဖို့လိုနိုင်တယ်။ Traffic ကြီး project တွေအတွက် Hostragons တံခါးဝလွှာရှိ ကလပ်ဆာ, မြင့်မားတဲ့ စွမ်းဆောင်ရည်ရှိသော hosting solution ကိုစဉ်းစားနိုင်ပါတယ်။
SEO အတွက် 4xx/5xx Log Analysis
2026 SEO standard မှာ Technical health က onsite optimization တစ်ခုတည်း မဟုတ်တော့ပါဘူး။ Search engine တွေက site က fast, accessible, consistent, reliable response တင်ပြဖို့ လိုပါတယ်။ Log analysis က Google Search Console မှာ invisible, delayed issue တွေကို real-time နီးပါး detect လုပ်နိုင်ပါတယ်။ Especially site ကြီးများမှာ crawl budget မပေးသုံးခြင်းကို မတစ်ခါတစ်ရံ prevent လုပ်နိုင်ပါတယ်။
SEO log analysis မှာ စဉ်းစားရန်:
- Googlebot ဘယ် 404 URL ကို crawl လုပ်သလဲ?
- Sitemap မှာ 404/5xx error URL ပါသလား?
- Mobile bot vs desktop bot response မတူသလား?
- 301 redirect chain မှ 404 error URL သွားသလား?
- Peak hour မှာ 503 error ပိုများလာသလား?
ဥပမာ e-commerce site log မှာ 7 days 404 error 32,000 ကြိမ် ဖြစ်ခဲ့တယ်ဆိုပါစို့။ Analysis လုပ်ရင် 60% old filter parameter, 25% deleted product, 10% missing image, 5% bot crawl တွေ ဖြစ်နိုင်တယ်။ ထို့ကြောင့် robots.txt, canonical, sitemap, 301 redirect, product life cycle policy ကို အတူတကွ စဉ်းစားဖို့လိုပါတယ်။ Domain, brand authority ကိုဆက်လက်ထားဖို့ ဒိုမိန်း စာရင်းစစ်ခြင်းနှင့် ဒိုမိန်း မှတ်ပုံတင် ကို အသုံးပြုနိုင်ပါတယ်။
Automation – Cron နဲ့ Regular Report
Log analysis ကို တစ်ခါတစ်ရံသာ မလုပ်ပါနဲ့၊ regular လုပ်လိုက်က early warning system ဖြစ်နိုင်ပါတယ်။ Production site တွေအတွက် daily/hourly report, cron job, email/Slack integration, critical threshold setting တွေက အရေးကြီးပါတယ်။
Threshold example:
- Last 1 hour 500 error > 20 – alert
- 404 error daily total request > 5% – SEO checklist
- Checkout/login URL တွေ 5xx error – urgent alarm
- Googlebot user-agent ပါတဲ့ 5xx error – team channel notification
Report archive လုပ်တဲ့အခါ personal data, security aspect ကိုလည်း စဉ်းစားပါ။ IP, user-agent info တစ်ချို့က personal data ဖြစ်နိုင်ပါတယ်။ IP masking, URL/status/count only log လုပ်ပါ။ Log file ကို public web directory မှာ မထားပါနဲ့။
Common Mistakes & Best Practice
Log analysis မှာ အများဆုံး error တစ်ခုက 404 error တွေကို homepage redirect လုပ်တာပါ။ Search engine မှာ soft 404 signal ဖြစ်နိုင်တယ်။ Second mistake – parameter URL တွေကို same page group မလုပ်တာ။ /product?id=10 vs /product?id=11 error ကို separate record လုပ်သင့်သော်လည်း utm_source tracking parameter တွေ report inflate ဖြစ်နိုင်တယ်။ CDN/load balancer နောက် client IP မမှန်တာက bot/user detection ဆိုးစေတယ်။ X-Forwarded-For header ကို မှန်ကန် handle လုပ်ပါ။
Best practice:
- Status code, URL path, count, first seen, last seen, user-agent group, referer record
- Small site – status-url-count only
- Large site – resource origin analysis, application log/database log/server resource graph တွေနဲ့ 5xx error match
- Staging/test traffic ကို production report မှာ ခွဲထုတ်ပါ။ Test bot, uptime monitor, security scanner မပါအောင် filter whitelist/blacklist user-agent လုပ်ပါ။ Multiple domain hosted server မှာ virtual host log separation/host field add လုပ်ပါ။
Quick Checklist
- Log file ကို correct domain/date range check လုပ်ပါ
- 4xx/5xx code ကို same report show, 5xx error priority higher
- Top 50/100 repeat URL sort
- Googlebot, Bingbot, real user-agent separate tag
- 404 error – internal link, sitemap, backlink source check
- 500, 502, 503, 504 – error log, PHP-FPM, database, resource usage together check
- 301 redirect မှ target page relevance check
- Report ကို cron regular generate, critical threshold alert setup
နိဂုံးချုပ်
Server Access Log မှ 4xx/5xx error URL extraction script က Technical SEO, performance, security audit မှာ လျှင်မြန်တစ်သက်သက် အသုံးပြုနိုင်တဲ့ powerful tool တစ်ခုပါ။ Log format မှန်ကန်စွာ detect, URL, status code, repeat count ကို regular report လုပ်လျှင် broken link, server error, bot crawl budget loss တွေကို ခံစားရမတိုင်ခင် သိနိုင်ပါတယ်။
Small site တွေအတွက် bash command တစ်ခုလောက်နဲ့ရပါတယ်။ Traffic ကြီး project တွေအတွက် Python-based cron script with alert system က ပိုပြီး sustainable ဖြစ်ပါတယ်။ Infrastructure ကို regular monitor လုပ်၊ hosting resource မှန်ကန်ရွေး၊ SSL security layer တိုးမြှင့်လျှင် error rate နိမ့်နိုင်ပါတယ်။ Stable web infrastructure တစ်ခု plan လုပ်ချင်ပါက Hostragons hosting, VPS, domain, SSL solution တွေကို သင့်လိုအပ်ချက်အတွက် စဥ်းစားနိုင်ပါတယ်။
အမြဲမေးလေ့ရှိသော မေးခွန်းများ
Access log မှာ 4xx/5xx error ကို ဘာလို့ ခွဲခြား analyze လုပ်သင့်သလဲ?
4xx error တွေက mostly client-side (page not found, permission, bad request) ဖြစ်ပါတယ်။ 5xx error တွေက server-side (server, application, infrastructure) issue ဖြစ်ပါတယ်။ 5xx error တွေက site accessibility ကို direct effect လုပ်တာမို့ priority ပိုမြင့်ပါတယ်။
404 error တစ်ခုတစ်ခုက SEO issue ဖြစ်ပါသလား?
မဟုတ်ပါ။ Deliberately removed, low traffic, no internal link 404 တွေက normal ဖြစ်ပါတယ်။ Sitemap, backlink, user traffic, Googlebot crawl အများဆုံး 404 error တွေ SEO issue ဖြစ်ပါတယ်။
Script ကို shared hosting မှာ အသုံးပြုနိုင်သလား?
ရပါတယ်။ Terminal access မရှိပါက control panel မှ access log download လုပ်ပြီး Linux, macOS, WSL, Git Bash မှာ analysis လုပ်နိုင်ပါတယ်။ Log format မှန်ကန်ဖတ်နိုင်မှု, report correct interpret လုပ်နိုင်မှု အရေးကြီးပါတယ်။
5xx error troubleshooting မှာ ဘယ်နေရာမှ စတင်စစ်သင့်သလဲ?
Access log မှ error repeat URL, time slot ကို find လုပ်ပါ။ Web server error log, PHP-FPM/app log, database connection, memory, CPU, disk I/O စတာတွေကို parallel စစ်ပါ။
Log analysis ကို ဘယ်လောက် regular လုပ်သင့်သလဲ?
Small site တွေ weekly/daily analysis လုပ်နိုင်ပါတယ်။ E-commerce, news, SaaS, high traffic project တွေ hourly report, critical 5xx error alert system setup လုပ်သင့်ပါတယ်။