bổ sung apache

This commit is contained in:
2026-04-30 21:39:17 +07:00
parent 176e6bdb8f
commit c10912a756
+34
View File
@@ -153,6 +153,40 @@ server {
}
```
Ví dụ Apache VirtualHost tối thiểu:
```apache
<VirtualHost *:80>
ServerName _
DocumentRoot /opt/ipcam-dashboard/dist
<Directory /opt/ipcam-dashboard/dist>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
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/
</VirtualHost>
```
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