เข้าถึง Etherpad
- อินเตอร์เฟซผู้ใช้:
https://<SERVER_IP> - ส่วนติดต่อผู้ดูแลระบบ:
https://<SERVER_IP>/admin - ข้อมูล Admin: Username
admin, รหัสผ่านเก็บไว้ใน.envasADMIN_PASSWORD
เพิ่มผู้ใช้ผ่านการตั้งค่าผู้ดูแลระบบ
1. โปรดเยี่ยมชม: https://<SERVER_IP>/admin
2. ไปที่ Settings
3. ไฟล์คอนฟิกของ JSON จะแสดงขึ้นมา
4. ค้นหาตำแหน่งของ users ส่วน:
"users": {
"admin": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "${ADMIN_PASSWORD:null}",
"is_admin": true
},
"user": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "test",
"is_admin": false
}
},
5. เพิ่มผู้ใช้ใหม่ (ใช้ syntax ของ JSON ให้ถูกต้อง):
"users": {
"admin": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "${ADMIN_PASSWORD:null}",
"is_admin": true
},
"user": {
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
"password": "test",
"is_admin": false
},
"newuser": {
"password": "strongpassword",
"is_admin": false
}
},
6. คลิก Save Settings
7. คลิก Restart Etherpad
ไฟล์และไดเรกทอรีที่สำคัญ
- การติดตั้งแอปพลิเคชัน:
/root/etherpad - ไฟล์ Docker Compose:
/root/etherpad/docker-compose.yml - ตัวแปรสภาพแวดล้อม:
/root/etherpad/.env - ข้อมูลฐานข้อมูล PostgreSQL:
/var/lib/docker/volumes/etherpad_postgres_data/_data - ข้อมูล runtime ของ Etherpad:
/var/lib/docker/volumes/etherpad_etherpad-var/_data - ไดเรกทอรี่ปลั๊กอิน:
/var/lib/docker/volumes/etherpad_plugins/_data - Nginx การกำหนดค่า:
/etc/nginx/sites-available/etherpad - SSL certificates:
/etc/nginx/ssl/
การจัดการบริการ
แสดงรายชื่อ containers:
docker ps
รีสตาร์ท containers:
docker compose -f /root/etherpad/docker-compose.yml restart
ติดตาม log ของ Etherpad:
docker compose -f /root/etherpad/docker-compose.yml logs -f
รีสตาร์ท Nginx:
systemctl restart nginx
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/etherpad
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้าง Let’s Encrypt certificate ที่ใช้ได้:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แทนที่ SSL paths ใน Nginx config:
vim /etc/apache2/sites-available/etherpad
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. รีสตาร์ท Nginx เพื่อใช้การเปลี่ยนแปลง:
systemctl restart nginx
7. เปิด browser และไปที่: https://yourdomain.com
หมายเหตุ
- Etherpad ทำงานอยู่หลัง Nginx reverse proxy เพื่อจัดการ SSL termination และเพิ่มความปลอดภัย
- ใบรับรองแบบ self-signed อาจทำให้เบราว์เซอร์แสดงคำเตือน ซึ่งเป็นเรื่องปกติหากไม่ได้ใช้ Let's Encrypt
- เบราว์เซอร์บางตัวอาจแสดงข้อผิดพลาด หรือทำให้ Etherpad ทำงานไม่ถูกต้อง
- Etherpad ได้รับการทดสอบและยืนยันว่าทำงานได้บน Firefox ซึ่งแนะนำให้ใช้เพื่อความเข้ากันได้ที่ดีที่สุด