Truy cập
- URL cửa hàng:
https://<SERVER_IP> - URL quản trị:
https://<SERVER_IP>/<ADMIN_FOLDER>/(stored in/root/.cloudzy-creds) - Một chứng chỉ SSL tự ký đã được cấu hình. Trình duyệt có thể hiển thị cảnh báo chứng chỉ, hãy tiếp tục để truy cập trang.
- Thông tin đăng nhập được lưu tại:
/root/.cloudzy-creds
File và thư mục quan trọng
- Thư mục trang web:
/var/www/litecart - Cấu hình LiteCart:
/var/www/litecart/includes/config.inc.php - Cấu hình Apache:
/etc/apache2/sites-available/litecart.conf - Chứng chỉ SSL:
/etc/apache2/ssl/litecart.crt - Khóa riêng SSL:
/etc/apache2/ssl/litecart.key - Thông tin đăng nhập cơ sở dữ liệu:
/root/.cloudzy-creds
Quản lý Apache
Kiểm tra trạng thái:
systemctl status apache2
Khởi động lại Apache:
systemctl restart apache2
Xem nhật ký Apache:
journalctl -u apache2 -f
Xác thực cấu hình:
apache2ctl configtest
Bật HTTPS với một tên miền
1. Trỏ tên miền của bạn về IP máy chủ.
2. Chỉnh sửa /etc/apache2/sites-available/litecart.conf và thay thế cả hai ServerName <SERVER_IP> chỉ thị bằng tên miền của bạn (ví dụ ServerName yourdomain.com;).
3. Cài đặt Certbot:
apt install -y certbot python3-certbot-apache
4. Lấy một chứng chỉ Let's Encrypt:
certbot certonly --apache --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Chỉnh sửa /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. Tải lại Apache để áp dụng thay đổi:
systemctl reload apache2
7. Mở trình duyệt và truy cập: https://yourdomain.com