在Ubuntu上使用Apache实现防盗版可采取以下措施:
HTTP Referer检查
.htaccess
或Apache配置文件添加规则,限制仅允许指定域名访问资源,如:RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain\.com [NC]
RewriteRule \.(jpg|png|mp4)$ - [F,L]
(需将yourdomain.com
替换为实际域名,支持的文件类型可扩展)。启用mod_rewrite模块
sudo a2enmod rewrite
sudo systemctl restart apache2
使用mod_security模块
sudo apt install libapache2-mod-security2
sudo a2enmod security2
数字版权管理(DRM)
水印技术
访问控制与日志监控
Allow from
指令)。access.log
/error.log
),识别异常访问模式。注意: