เอกสารนี้แสดงวิธีติดตั้งแบบรวดเร็วสำหรับเพิ่ม TPMAP เข้าไปในระบบที่มีอยู่แล้ว
# จากเครื่อง local
scp -r tpmap_act user@your-server:/tmp/
# หรือใช้ Git
ssh user@your-server
cd /tmp
git clone https://github.com/bogarb12/OpenGISData-Thailand.gitsudo mkdir -p /var/www/tpmap-household-dashboard
sudo mv /tmp/tpmap_act /var/www/tpmap-household-dashboard/
# หรือ
sudo mv /tmp/OpenGISData-Thailand/tpmap_act /var/www/tpmap-household-dashboard/sudo chown -R www-data:www-data /var/www/tpmap-household-dashboard
sudo chmod -R 755 /var/www/tpmap-household-dashboard# หาไฟล์ config ของระบบหลัก
ls /etc/nginx/sites-enabled/
# แก้ไขไฟล์ (เปลี่ยน 'your-site' เป็นชื่อจริง)
sudo nano /etc/nginx/sites-available/your-siteเพิ่มโค้ดนี้เข้าไปใน server { } block:
location /tpmap/ {
alias /var/www/tpmap-household-dashboard/tpmap_act/;
index household-dashboard.html indicators-selector.html;
try_files $uri $uri/ =404;
}บันทึกไฟล์: กด Ctrl+X จากนั้น Y แล้ว Enter
# ทดสอบ config
sudo nginx -t
# Reload nginx
sudo systemctl reload nginxเปิดเบราว์เซอร์และเข้า:
http://your-domain.com/tpmap/household-dashboard.htmlhttp://your-domain.com/tpmap/indicators-selector.html
# ตรวจสอบ path
ls -la /var/www/tpmap-household-dashboard/tpmap_act/
# ตรวจสอบ permissions
sudo chown -R www-data:www-data /var/www/tpmap-household-dashboard
sudo chmod -R 755 /var/www/tpmap-household-dashboard
# ดู error log
sudo tail -f /var/log/nginx/error.log# แก้ permissions
sudo chmod -R 755 /var/www/tpmap-household-dashboard
# ตรวจสอบ SELinux (ถ้ามี)
sudo setenforce 0ระบบนี้ไม่มี external CSS/JS files - ทุกอย่างอยู่ใน HTML แล้ว ถ้ามีปัญหาลองเคลียร์ browser cache
server {
server_name example.com;
root /var/www/wordpress;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
# เพิ่มส่วนนี้
location /tpmap/ {
alias /var/www/tpmap-household-dashboard/tpmap_act/;
index household-dashboard.html;
try_files $uri $uri/ =404;
}
}server {
server_name example.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
}
# เพิ่มส่วนนี้
location /tpmap/ {
alias /var/www/tpmap-household-dashboard/tpmap_act/;
index household-dashboard.html;
try_files $uri $uri/ =404;
}
}server {
server_name example.com;
root /var/www/html;
index index.html;
location / {
try_files $uri $uri/ =404;
}
# เพิ่มส่วนนี้
location /tpmap/ {
alias /var/www/tpmap-household-dashboard/tpmap_act/;
index household-dashboard.html;
try_files $uri $uri/ =404;
}
}ถ้าต้องการใช้ path อื่นแทน /tpmap/:
# ใช้ /household/ แทน
location /household/ {
alias /var/www/tpmap-household-dashboard/tpmap_act/;
index household-dashboard.html;
try_files $uri $uri/ =404;
}
# URL: http://example.com/household/household-dashboard.html# ตรวจสอบ nginx config
sudo nginx -t
# Reload nginx
sudo systemctl reload nginx
# Restart nginx
sudo systemctl restart nginx
# ดู logs
sudo tail -f /var/log/nginx/access.log
sudo tail -f /var/log/nginx/error.log
# ทดสอบด้วย curl
curl -I http://your-domain.com/tpmap/household-dashboard.htmlDEPLOYMENT.md- คู่มือแบบละเอียดnginx-subdirectory-example.conf- ตัวอย่าง configREADME.md- เอกสารหลัก