From c10912a756bbb9b6e79b468d1fc3cd80e5f0f00b Mon Sep 17 00:00:00 2001 From: Tony Tran Date: Thu, 30 Apr 2026 21:39:17 +0700 Subject: [PATCH] =?UTF-8?q?b=E1=BB=95=20sung=20apache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- INSTALL.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index b4efd19..50cfc63 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -153,6 +153,40 @@ server { } ``` +Ví dụ Apache VirtualHost tối thiểu: + +```apache + + ServerName _ + DocumentRoot /opt/ipcam-dashboard/dist + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^ /index.html [L] + + ProxyPreserveHost On + ProxyPass /api/ http://127.0.0.1:8008/api/ + ProxyPassReverse /api/ http://127.0.0.1:8008/api/ + + ProxyPass /videos/ http://127.0.0.1:8008/videos/ + ProxyPassReverse /videos/ http://127.0.0.1:8008/videos/ + +``` + +Apache cần bật module trước khi reload: + +```bash +sudo a2enmod rewrite proxy proxy_http +sudo systemctl reload apache2 +``` + ## 5) Systemd service (khuyến nghị) ### 5.1 Backend service