การเข้าถึง
- URL ร้านค้า:
https://<SERVER_IP> - URL ผู้ดูแลระบบ:
https://<SERVER_IP>/<ADMIN_FOLDER>/(stored in/root/.cloudzy-creds) - มีการตั้งค่าใบรับรอง SSL แบบลงนามด้วยตนเอง เบราว์เซอร์อาจแสดงคำเตือนใบรับรอง ให้ดำเนินการต่อเพื่อเข้าถึงเว็บไซต์
- ข้อมูลรับรองการเข้าสู่ระบบถูกเก็บไว้ที่:
/root/.cloudzy-creds
ไฟล์และไดเรกทอรีที่สำคัญ
- ไดเรกทอรีเว็บไซต์:
/var/www/litecart - การตั้งค่า LiteCart:
/var/www/litecart/includes/config.inc.php - การตั้งค่า Apache:
/etc/apache2/sites-available/litecart.conf - ใบรับรอง SSL:
/etc/apache2/ssl/litecart.crt - คีย์ส่วนตัว SSL:
/etc/apache2/ssl/litecart.key - ข้อมูลรับรองฐานข้อมูล:
/root/.cloudzy-creds
การจัดการ Apache
ตรวจสอบสถานะ:
systemctl status apache2
รีสตาร์ต Apache:
systemctl restart apache2
ดูบันทึกของ Apache:
journalctl -u apache2 -f
ตรวจสอบความถูกต้องของการกำหนดค่า:
apache2ctl configtest
การเปิดใช้งาน HTTPS ด้วยโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
๒. แก้ไข /etc/apache2/sites-available/litecart.conf และแทนที่ทั้งสอง ServerName <SERVER_IP> directive ด้วยโดเมนของคุณ (เช่น ServerName yourdomain.com;).
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-apache
4. รับใบรับรอง Let's Encrypt:
certbot certonly --apache --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แก้ไข /etc/apache2/sites-available/litecart.conf and replace the SSL certificate paths.
Before:
SSLCertificateFile /etc/apache2/ssl/litecart.crt
SSLCertificateKeyFile /etc/apache2/ssl/litecart.key
After:
SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem
6. รีโหลด Apache เพื่อใช้การเปลี่ยนแปลง:
systemctl reload apache2
7. เปิด browser และไปที่: https://yourdomain.com