-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathINSTALL-COMMANDS.txt
More file actions
110 lines (79 loc) · 3.95 KB
/
INSTALL-COMMANDS.txt
File metadata and controls
110 lines (79 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# คำสั่งสำหรับติดตั้ง TPMAP Dashboard
# คัดลอกคำสั่งเหล่านี้ทีละบรรทัดแล้วรันบนเซิร์ฟเวอร์
# ============================================================
# วิธีที่ 1: ใช้สคริปต์อัตโนมัติ (แนะนำ)
# ============================================================
cd /var/www/OpenGISData-Thailand
chmod +x install-tpmap.sh
./install-tpmap.sh
# ============================================================
# วิธีที่ 2: ติดตั้งแบบ Manual (ทีละขั้นตอน)
# ============================================================
# ขั้นตอนที่ 1: ไปที่ directory
cd /var/www/OpenGISData-Thailand
# ขั้นตอนที่ 2: ดึงไฟล์ tpmap (ถ้ายังไม่มี)
git remote add upstream https://github.com/chingchai/OpenGISData-Thailand.git
git fetch upstream
git checkout upstream/master -- tpmap_act/
# ขั้นตอนที่ 3: ตรวจสอบว่ามีไฟล์
ls -la tpmap_act/
# ขั้นตอนที่ 4: ตั้งค่าสิทธิ์
sudo chown -R www-data:www-data /var/www/OpenGISData-Thailand/tpmap_act
sudo chmod -R 755 /var/www/OpenGISData-Thailand/tpmap_act
# ขั้นตอนที่ 5: สำรอง nginx config เดิม
sudo cp /etc/nginx/sites-available/procurement-system /etc/nginx/sites-available/procurement-system.backup
# ขั้นตอนที่ 6: แก้ไข nginx config
sudo nano /etc/nginx/sites-available/procurement-system
# เพิ่มโค้ดนี้ก่อน closing brace } ของ server block:
#
# location /tpmap/ {
# alias /var/www/OpenGISData-Thailand/tpmap_act/;
# index household-dashboard.html indicators-selector.html;
# try_files $uri $uri/ =404;
# }
#
# บันทึกด้วย: Ctrl+X, จากนั้น Y, แล้ว Enter
# ขั้นตอนที่ 7: ทดสอบ config
sudo nginx -t
# ขั้นตอนที่ 8: Reload nginx
sudo systemctl reload nginx
# ขั้นตอนที่ 9: ทดสอบ
curl -I http://localhost/tpmap/household-dashboard.html
# ============================================================
# คำสั่งตรวจสอบ
# ============================================================
# ดูสถานะ nginx
sudo systemctl status nginx
# ดู error log
sudo tail -f /var/log/nginx/error.log
# ดู access log
sudo tail -f /var/log/nginx/access.log
# ทดสอบ nginx config
sudo nginx -t
# ดูไฟล์ที่มี
ls -lh /var/www/OpenGISData-Thailand/tpmap_act/
# ============================================================
# URL ที่เข้าถึงได้
# ============================================================
# TPMAP Dashboard:
# http://49.231.27.66/tpmap/household-dashboard.html
# http://49.231.27.66/tpmap/indicators-selector.html
# http://49.231.27.66/tpmap/indicators-38-snippet.html
# Procurement System:
# http://49.231.27.66/
# http://49.231.27.66/api/
# ============================================================
# การแก้ปัญหา
# ============================================================
# ถ้าได้ 404 Not Found:
ls -la /var/www/OpenGISData-Thailand/tpmap_act/household-dashboard.html
sudo tail -f /var/log/nginx/error.log
# ถ้าได้ 403 Forbidden:
sudo chown -R www-data:www-data /var/www/OpenGISData-Thailand/tpmap_act
sudo chmod -R 755 /var/www/OpenGISData-Thailand/tpmap_act
# ถ้า nginx config ผิด:
sudo nginx -t
sudo nano /etc/nginx/sites-available/procurement-system
# คืนค่า config เดิม:
sudo cp /etc/nginx/sites-available/procurement-system.backup /etc/nginx/sites-available/procurement-system
sudo systemctl reload nginx