-
Notifications
You must be signed in to change notification settings - Fork 1k
Moving videos directory and securing files from direct access to the video source file
This tutorial shows you how to enable Apache XSendFile to prevent your videos from being accessed by external or unauthorized users. It will also help you set up the symbolic link to allow you to move your videos to another location
Get 1-hour support on our Services Site, we will do it for you
- Ubuntu 16
- Apache XSendFile
- SecureVideosDirectory Plugin
- Root Access to the server
- Admin user for YouPHPTube
This is necessary for secure files and configuration assistant
sudo apt-get install libapache2-mod-xsendfile && sudo a2enmod xsendfile
sudo nano /etc/apache2/apache2.conf
<Directory /var/www/html/YouPHPTube/>
Options Indexes FollowSymLinks
XSendFile on
XSendFilePath /var/www/html/YouPHPTube/
AllowOverride All
Require all granted
Order Allow,Deny
Allow from All
</Directory>
sudo nano /var/www/html/YouPHPTube/.htaccess
<IfModule mod_xsendfile.c>
RewriteRule ^videos/([A-Za-z0-9-_.]+)$ view/xsendfile.php?file=$1 [NC,L]
</IfModule>
This guide will walk you through the process of moving the AVideo videos directory to another drive and creating a symbolic link to ensure the videos are accessible from the new location. Please make sure to follow the steps carefully to avoid any potential issues.
Note: Before proceeding, ensure you have a complete backup of your AVideo installation and videos.
Move Videos: Change to the AVideo videos directory and either move or copy the videos to the newly mounted drive:
cd /var/www/html/AVideo/
sudo mv ./videos /newMountedDisk/videosTo create a symbolic link to make the videos accessible from the original location, follow these steps:
Create the Symbolic Link: Create the symbolic link using the ln command:
sudo ln -s /newMountedDisk/videos /var/www/html/AVideo/videosNow, the AVideo videos should be accessible both from the new location (/newMountedDisk/videos) and through the symbolic link (/var/www/html/AVideo/videos).
To ensure everything is working as expected, access your AVideo application and play some videos. Verify that the videos are loading and playing correctly from the new location and through the symbolic link.
The Open Source Video Platform Solution
| Service | Description | Link |
|---|---|---|
| 🎯 | Professional Support - Direct assistance from core developers | Contact |
| ☁️ | AVideo CDN - High-performance video delivery network | Pricing |
AVideo Platform © 2024 - Self-hosted video streaming platform
Made with ❤️ by WWBN and the open source community