Avideo: SecureVideosDirectory Plugin

Created on 3 Sep 2020  Â·  35Comments  Â·  Source: WWBN/AVideo

This plugin isn't working using any of the video URLs from the source page plays without being blocked. Looked through the HTACCESS file and couldn't see clearly where to place the RewriteRule
Untitled-9

And placing at the end of the file does nothing changes "All fields must be green" Never turns green! Any suggestions?

bug wontfix

All 35 comments

you can ignore it if it is not green. but make sure you have the apache xsendfile enabled

and looks like this issue is related to this one https://github.com/WWBN/AVideo/issues/3569#issuecomment-685871704

Hi Daniel,
kind of same problem here, with or without the token, the video can be accessed directly:
https://videos.nadar.tv/videos/_YPTuniqid_5f5a4ade5275d0.47724181_Low.mp4
https://videos.nadar.tv/videos/_YPTuniqid_5f5a4ade5275d0.47724181_Low.mp4?token=eyJzYWx0IjoiaHR0cHM6XC9cL3ZpZGVvcy5uYWRhci50dlwvIiwidG9rZW5UaW1lT3V0IjoiMjE2MDAiLCJmaWxlbmFtZSI6Il9ZUFR1bmlxaWRfNWY1YTRhZGU1Mjc1ZDAuNDc3MjQxODFfTG93IiwidGltZSI6MTU5OTc1MzE2OH0=

Xsendfile is installed, Apache version check gives me this:

/usr/sbin/apache2 -V

Server version: Apache/2.4.41 (Ubuntu)
Server built:   2020-08-12T19:46:17
Server's Module Magic Number: 20120211:88
Server loaded:  APR 1.6.5, APR-UTIL 1.6.1
Compiled using: APR 1.6.5, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

Plugin SecureVideosDirectory installed and configured as image:
Screen Shot 2020-09-10 at 13 00 12

Instead of configuring the xsendfile to /etc/apache2/apache2.conf, I followed the virtual host's best practices and put the configuration inside /etc/apache2/sites-available folder:

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName videos.nadar.tv
        DocumentRoot /var/www/videos.nadar.tv/public_html
        <Directory /var/www/videos.nadar.tv/public_html/>
            Options Indexes FollowSymLinks
            XSendFile on
            XSendFilePath /var/www/videos.nadar.tv/public_html/
            AllowOverride All
            Require all granted
           Order Allow,Deny
            Allow from All
        </Directory>
</VirtualHost>

Lastly, I've checked the .htaccess in /var/www/videos.nadar.tv/public_html folder and found out similar instruction, except it added restriction to video files with FilesMatch, I suppose it is an update and more strict control for xsendfile:

   # It must be before image not found
    <IfModule mod_xsendfile.c>
        <FilesMatch "\.(mp4|webm|m3u8|mp3|ogg)$">
            RewriteRule    ^videos/([^!#$&'()*+,\/:;=?@[\]]+)$ view/xsendfile.p>
        </FilesMatch>
    </IfModule>

And with all these configurations, the video file cannot be prevented from direct access.

What or where it is the misconfiguration?

Thanks and keep up with this amazing project.

Hi @swimitup

Few things first ...

  • Make sure you restart apache after install xsendfile
  • try to access without the token from an incognito browser. (the server saves the video access in a session, so after the first time you do not need a token anymore)
  • Make sure you are not logged as admin on the same browser you are trying to access the video directly.

If persists, please share the video link here I will check

  1. Apache restarted, as usual when changing any .conf
  2. I tried with or without token, in incognito browser, user logged off, other machine, even from the smartphone: I was able to view the video in all of them.
  3. I was, but once logged out, still seeing it. Cache cleared. Same thing.

The links are:
https://videos.nadar.tv/videos/_YPTuniqid_5f5a4ade5275d0.47724181_Low.mp4

https://videos.nadar.tv/videos/_YPTuniqid_5f5a4ade5275d0.47724181_Low.mp4?token=eyJzYWx0IjoiaHR0cHM6XC9cL3ZpZGVvcy5uYWRhci50dlwvIiwidG9rZW5UaW1lT3V0IjoiMjE2MDAiLCJmaWxlbmFtZSI6Il9ZUFR1bmlxaWRfNWY1YTRhZGU1Mjc1ZDAuNDc3MjQxODFfTG93IiwidGltZSI6MTU5OTc1MzE2OH0=

As I can see if you configure it on sites-enabled you are missing the port 443 (SSL)

you did only for port 80

add the same

   <Directory /var/www/videos.nadar.tv/public_html/>
        Options Indexes FollowSymLinks
        XSendFile on
        XSendFilePath /var/www/videos.nadar.tv/public_html/
        AllowOverride All
        Require all granted
       Order Allow,Deny
        Allow from All
    </Directory>

on port 443

BTW, your apache conf looks a lot different than mine (Ubuntu), and look like you are not using ubuntu as recommended

if you want to test if your xsendfile is working, rename the view/xsendfile.php if your videos still working, it never reaches that file

@DanielnetoDotCom Do you mind making a video on your site of a perfect installation ? Because I'm having this plugin like a year , never used it .

@akhilleusuggo this is just copying and paste the code as is described here, but I do not know about CentOS issues, but on Ubuntu, it works easily.

As I can see if you configure it on sites-enabled you are missing the port 443 (SSL)

you did only for port 80

Done as . Apache restarted.

BTW, your apache conf looks a lot different than mine (Ubuntu), and look like you are not using ubuntu as recommended

I used a LAMP Droplet from Digital Ocean, with Ubuntu 20.04. I omit other directives from the .conf file, pasting only the .

if you want to test if your xsendfile is working, rename the view/xsendfile.php if your videos still working, it never reaches that file

Renamed the view/xsendfile.php and the video still keeps playing. Cache cleared. Incognito. Other device, other browser...

I also tested and edit the /etc/apache2/apache2.conf and add the Directory configuration. Apache restarted. Still able to view the video directly and within AVideo interface...

I uploaded only 2 videos, and both are still reachable:
https://videos.nadar.tv/videos/_YPTuniqid_5f5a3dc035f450.82072521_Low.mp4

As for the .htaccess, remains the same:

    # It must be before image not found
    <IfModule mod_xsendfile.c>
        <FilesMatch "\.(mp4|webm|m3u8|mp3|ogg)$">
            RewriteRule    ^videos/([^!#$&'()*+,\/:;=?@[\]]+)$ view/xsendfile.php?file=$1    [QSA]
        </FilesMatch>
    </IfModule>

So my logical guess is that the XSendFile module is not active, because if so, the Rewrite rule should redirect to a 404, as you stated. But the video can be accessed.
Maybe .htaccess is wrong? No, it works because I can access all website and use other plugins that has Rewrite rules.
XSendFile module not installed?
Using wget I am also able to get the video:

root@nadartv-ubuntu:~# sudo apt-get install libapache2-mod-xsendfile && sudo a2enmod xsendfile
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libapache2-mod-xsendfile is already the newest version (0.12-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Module xsendfile already enabled
root@nadartv-ubuntu:~# systemctl reload apache2
root@nadartv-ubuntu:~# cd /tmp
root@nadartv-ubuntu:/tmp# wget https://videos.nadar.tv/videos/_YPTuniqid_5f5a3dc035f450.82072521_Low.mp4
--2020-09-11 00:05:00--  https://videos.nadar.tv/videos/_YPTuniqid_5f5a3dc035f450.82072521_Low.mp4
Resolving videos.nadar.tv (videos.nadar.tv)... 104.131.73.26
Connecting to videos.nadar.tv (videos.nadar.tv)|104.131.73.26|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1192735 (1.1M) [video/mp4]
Saving to: ‘_YPTuniqid_5f5a3dc035f450.82072521_Low.mp4’

_YPTuniqid_5f5a3dc0 100%[===================>]   1.14M  --.-KB/s    in 0.004s  

2020-09-11 00:05:00 (266 MB/s) - ‘_YPTuniqid_5f5a3dc035f450.82072521_Low.mp4’ saved [1192735/1192735]

root@nadartv-ubuntu:/tmp# 

Renamed the view/xsendfile.php and the video still keeps playing.

that means your xsendfile is not properly configured. I am not sure what is missing, but you have to make it work

I suspected that the problem begin with the Rewrite rule, so I start "messing up" the .htaccess.
First I commented the line that check if xsendfile is enable. Still working. Then I commented the FilesMatch rule and voilà: a 404 page appears, meaning the Rewrite worked and tried to locate the view/xsendfile.php...

    #<IfModule mod_xsendfile.c>
#        <FilesMatch "\.(mp4|webm|m3u8|mp3|ogg)$">
            RewriteRule    ^videos/([^!#$&'()*+,\/:;=?@[\]]+)$ view/xsendfile.php?file=$1>    [QSA]
#        </FilesMatch>
    #</IfModule>

Conclusion: the FilesMatch regex not working...?? Very, very odd.
Reading more about this subject...

humm,

even if you do not have the xsendfile configured and you removed the <IfModule mod_xsendfile.c>, the xsendfile.php will work as expected, but it may slow down your site because it will use PHP to grab the files.

Using Developer Tools/Console from Chrome, I found this while using URL https://videos.nadar.tv/videos/test.mp4 :

Screen Shot 2020-09-11 at 09 49 27

Very odd, since the file is there... https://videos.nadar.tv/view/img/image404.php?notFound=1

Screen Shot 2020-09-11 at 09 54 06

But... The files are chowned by root user, not Apache's default www-data:

Screen Shot 2020-09-11 at 09 54 55

So I changed the owner for this file, but still I am able to view the video directly using https://videos.nadar.tv/videos/test.mp4 ...

Then again I commented the .htaccess FilesMatch:

    # It must be before image not found
    <IfModule mod_xsendfile.c>
#        <FilesMatch "\.(mp4|webm|m3u8|mp3|ogg)$">
            RewriteRule    ^videos/([^!#$&'()*+,\/:;=?@[\]]+)$ view/xsendfile.p>
#        </FilesMatch>
    </IfModule>

And it works.

Screen Shot 2020-09-11 at 10 03 59

But now everything under the "videos" folder can be "found":

Screen Shot 2020-09-11 at 10 05 58

Screen Shot 2020-09-11 at 10 06 07

If I inspect the page, I see that the URL is ok and the token in ok:

https://videos.nadar.tv/videos/_YPTuniqid_5f5a4ade5275d0.47724181_HD.mp4?token=eyJzYWx0IjoiaHR0cHM6XC9cL3ZpZGVvcy5uYWRhci50dlwvIiwidG9rZW5UaW1lT3V0IjoiMjE2MDAiLCJmaWxlbmFtZSI6Il9ZUFR1bmlxaWRfNWY1YTRhZGU1Mjc1ZDAuNDc3MjQxODFfSEQiLCJ0aW1lIjoxNTk5ODMwMjkwfQ==

Screen Shot 2020-09-11 at 10 09 54

It's becoming frustrating...

Maybe even the problem relies on the fact of using "videos" as subdomain? I cannot figure it out how come it would be possible...

Hi

looks like you are getting closer

did you remove the <FilesMatch "\.(mp4|webm|m3u8|mp3|ogg)$"> ?

can you put it back it will make NOT use the xsendfile in your images?

also I am checking this image from your site https://videos.nadar.tv/videos/_YPTuniqid_5f5a4ade5275d0.47724181_thumbsSmallV2.jpg

can you please confirm if the file exists in the videos/_YPTuniqid_5f5a4ade5275d0.47724181_thumbsSmallV2.jpg?

did you remove the <FilesMatch "\.(mp4|webm|m3u8|mp3|ogg)$"> ?

yes, it is commented.

can you put it back it will make NOT use the xsendfile in your images?

done. But once I do that, the videos return to be accessed directly...

also I am checking this image from your site https://videos.nadar.tv/videos/_YPTuniqid_5f5a4ade5275d0.47724181_thumbsSmallV2.jpg

can you please confirm if the file exists in the videos/_YPTuniqid_5f5a4ade5275d0.47724181_thumbsSmallV2.jpg?

Yes, this file exists:

ls -l

-rw-r--r--  1 www-data www-data 11864551 Sep 10 15:50 _YPTuniqid_5f5a4ade5275d0.47724181_HD.mp4
-rw-r--r--  1 www-data www-data  4476726 Sep 10 15:50 _YPTuniqid_5f5a4ade5275d0.47724181_Low.mp4
-rw-r--r--  1 www-data www-data  7835077 Sep 10 15:50 _YPTuniqid_5f5a4ade5275d0.47724181_SD.mp4
-rw-rw-rw-  1 www-data www-data     2218 Sep 10 15:52 _YPTuniqid_5f5a4ade5275d0.47724181_thumbsSmallV2.jpg
-rw-r--r--  1 www-data www-data   364416 Sep 10 15:52 _YPTuniqid_5f5a4ade5275d0.47724181_thumbsSprit.jpg
-rw-rw-rw-  1 www-data www-data     9129 Sep 10 15:52 _YPTuniqid_5f5a4ade5275d0.47724181_thumbsV2.jpg

So, if I remove the FilesMatch, xsendfile works but the rest of the site doesn't (videos do not load, images at videos folder do not read). if I put it back, the site works, the rewriterule do not proceed, hence you are able to access the video directly...

So you are having a problem on your apache FilesMatch, please check this:

https://stackoverflow.com/questions/16718842/why-is-this-filesmatch-not-matching-correctly

you can try this

In order to get it to work we have changed from using FilesMatch to LocationMatch and now the headers are being set perfectly.

We believe this is because the page is being redirected from a JSP page to an HTML page.

Replace this

<FilesMatch "\.(mp4|webm|m3u8|mp3|ogg)$">
            RewriteRule    ^videos/([^!#$&'()*+,\/:;=?@[\]]+)$ view/xsendfile.p>
</FilesMatch>

For this

<LocationMatch "\.(mp4|webm|m3u8|mp3|ogg)$">
            RewriteRule    ^videos/([^!#$&'()*+,\/:;=?@[\]]+)$ view/xsendfile.p>
</LocationMatch>

It is not possible to use LocationMatch within .htaccess as stated in docs:
http://httpd.apache.org/docs/current/mod/core.html#locationmatch

Once I put it in, server returned a 500 error.
Undid the .htaccess modification and inserted the LocationMatch inside apache .conf file:

Screen Shot 2020-09-11 at 11 29 45

Restarted apache. Did not work. Still able to access video directly.

Not sure what is different in your installation, but seems to me you have a problem in your apache version/modules

definitely to make it work you need to resolve the FilesMatch issue,

FYI I have it working on Ubuntu 16.04, 18.04 and 20.04

Very odd.
So I go back and tried a fresh installation to get some proof that there was no problem with the code and installed a fresh copy, with only the securevideosdirectory plugin:
http://test.nadar.tv

Followed the installation guide. apply the .conf directives. did the basic configuration in AVideo. verified the .htaccess, which is the same from original file.
I copied the test.mp4 file to http://test.nadar.tv/videos folder and it didn't work as expected: the video can be accessed directly:
http://test.nadar.tv/videos/test.mp4?token

This eliminate the suspicion regarding the subdomain "videos.nadar.tv"
Definitely there's something wrong with Apache and FilesMatch... So I will debug the Apache rewrite log and see what's going on.

what exactly OS and Apache are you using?

That is what I have and confirmed the FilesMatch works

Ubuntu 16.04:
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2019-10-08T13:31:25

Ubuntu 18.04:
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2020-08-12T21:33:25

Ubuntu 20.04:
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2020-08-12T19:46:17

Server version: Apache/2.4.41 (Ubuntu)
Server built: 2020-08-12T19:46:17

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Also note this is a droplet with fresh install. Nothing else was installed or configured beside what's needed.

It basically looks the same

I also had installed it on a droplet on digital ocean

Check if this makes sense for you https://github.com/bolt/bolt/issues/926

Edited

Actually nevermind, it is too old

Just curious how your Apache access.log looks like?

I mean when try to access a MP4 file

Just curious how your Apache access.log looks like?

I mean when try to access a MP4 file

When I access the URL _http://test.nadar.tv/videos/test.mp4?token_ , this is what access.log shows :

76.68.189.252 - - [11/Sep/2020:17:16:26 +0000] "GET /videos/test.mp4?token HTTP/1.1" 304 184 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36"
76.68.189.252 - - [11/Sep/2020:17:16:26 +0000] "GET /favicon.ico HTTP/1.1" 302 820 "http://test.nadar.tv/videos/test.mp4?token" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36"
**76.68.189.252 - - [11/Sep/2020:17:16:26 +0000] "GET /view/img/image404.php?notFound=1 HTTP/1.1" 404 6963 "http://test.nadar.tv/videos/test.mp4?token" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36"**

The bold line intrigues me.

Good news, I could reproduce it here, I will take a deeper look

And here's the error.log, with the configuration

LogLevel debug rewrite:trace3

inserted into the test.nadar.tv.conf file.

[Fri Sep 11 17:25:48.644188 2020] [authz_core:debug] [pid 51342] mod_authz_core.c(817): [client 76.68.189.252:63267] AH01626: authorization result of Require all granted: granted
[Fri Sep 11 17:25:48.644257 2020] [authz_core:debug] [pid 51342] mod_authz_core.c(817): [client 76.68.189.252:63267] AH01626: authorization result of <RequireAny>: granted
[Fri Sep 11 17:25:48.644280 2020] [rewrite:trace3] [pid 51342] mod_rewrite.c(483): [client 76.68.189.252:63267] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169eee60a0/initial] [perdir \\.(mp4|webm|m3u8|mp3|ogg)$/] applying pattern '^videos/([^!#$&'()*+,\\/:;=?@[\\]]+)$' to uri '/var/www/test.nadar.tv/public_html/videos/test.mp4'
[Fri Sep 11 17:25:48.644290 2020] [rewrite:trace1] [pid 51342] mod_rewrite.c(483): [client 76.68.189.252:63267] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169eee60a0/initial] [perdir \\.(mp4|webm|m3u8|mp3|ogg)$/] pass through /var/www/test.nadar.tv/public_html/videos/test.mp4
[Fri Sep 11 17:25:48.707837 2020] [authz_core:debug] [pid 51343] mod_authz_core.c(817): [client 76.68.189.252:63268] AH01626: authorization result of Require all granted: granted, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.707902 2020] [authz_core:debug] [pid 51343] mod_authz_core.c(817): [client 76.68.189.252:63268] AH01626: authorization result of <RequireAny>: granted, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.707928 2020] [rewrite:trace3] [pid 51343] mod_rewrite.c(483): [client 76.68.189.252:63268] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169eee60a0/initial] [perdir \\.(mp4|webm|m3u8|mp3|ogg)$/] applying pattern '^videos/([^!#$&'()*+,\\/:;=?@[\\]]+)$' to uri '/var/www/test.nadar.tv/public_html/videos/test.mp4', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.707938 2020] [rewrite:trace1] [pid 51343] mod_rewrite.c(483): [client 76.68.189.252:63268] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169eee60a0/initial] [perdir \\.(mp4|webm|m3u8|mp3|ogg)$/] pass through /var/www/test.nadar.tv/public_html/videos/test.mp4, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.708020 2020] [http:debug] [pid 51343] byterange_filter.c(295): [client 76.68.189.252:63268] AH01583: Range: 0- | 0-4476725 (0 : 0 : 4476726), referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.844072 2020] [authz_core:debug] [pid 51344] mod_authz_core.c(817): [client 76.68.189.252:63269] AH01626: authorization result of Require all granted: granted, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.844202 2020] [authz_core:debug] [pid 51344] mod_authz_core.c(817): [client 76.68.189.252:63269] AH01626: authorization result of <RequireAny>: granted, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.844233 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169eee60a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/favicon.ico -> favicon.ico, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.844241 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169eee60a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^videos/([^/]+)/(.*).key$' to uri 'favicon.ico', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.844250 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169eee60a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/favicon.ico -> favicon.ico, referer: http://test.nadar.tv/videos/test.mp4?token3-
(...)
[Fri Sep 11 17:25:48.982780 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^logoff$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982787 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982792 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^like$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982799 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982805 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^dislike$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982812 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982820 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^update/?$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982827 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982833 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^siteConfigurations$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982839 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982845 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^updateConfig$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982855 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.982861 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^charts$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983309 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983319 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^help$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983326 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983332 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^youtubeUpload$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983339 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983345 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^googleAdView$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983351 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983412 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^notifications.json$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983419 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983434 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^sitemap.xml$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983440 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983448 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^robots.txt$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983454 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983460 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^videos/(.*)/index.m3u8$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983465 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983471 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '^vast.xml/?([0-9]+)?$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983478 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983484 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '.*$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983497 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] strip per-dir prefix: /var/www/test.nadar.tv/public_html/view/img/image404.php -> view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983503 2020] [rewrite:trace3] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] applying pattern '.*$' to uri 'view/img/image404.php', referer: http://test.nadar.tv/videos/test.mp4?token3-
[Fri Sep 11 17:25:48.983536 2020] [rewrite:trace1] [pid 51344] mod_rewrite.c(483): [client 76.68.189.252:63269] 76.68.189.252 - - [test.nadar.tv/sid#7f169c58e9d0][rid#7f169de010a0/initial] [perdir /var/www/test.nadar.tv/public_html/] pass through /var/www/test.nadar.tv/public_html/view/img/image404.php, referer: http://test.nadar.tv/videos/test.mp4?token3-

So as you may notice, the rewriterule is indeed applied:

[perdir \\.(mp4|webm|m3u8|mp3|ogg)$/] applying pattern '^videos/([^!#$&'()*+,\\/:;=?@[\\]]+)$' to uri '/var/www/test.nadar.tv/public_html/videos/test.mp4'

And the image404.php not found is related to applying rewrite rules to images not found, which is the /var/www/test.nadar.tv/public_html/favicon.ico ...

Update: sorry, but the rewrite rule was not applied. The log has no reference to changing the pattern '^videos/([^!#$&'()*+,\/:;=?@[\]]+)$' to /view/xsendfile.php?$1 ...

Hi, I made some modifications that may work for you now

Great!
It worked... almost.
So I updated both .htaccess and view/xsendfile.php directly to videos.nadar.tv. Didn't work.
Then I copy only the .htaccess to test.nadar.tv and it did work.
So it might be a problem within the new code from view/xsendfile.php, because the test.nadar.tv remained with the last version of the file, while the videos.nadar.tv was updated.
Copied the last version of view/xsendfile.php to videos.nadar.tv and voilà, it worked.
Try it:
https://videos.nadar.tv/videos/test.mp4?

You do not suppose to copy the files. you suppose to use the git pull.

https://github.com/WWBN/AVideo/wiki/How-to-Update-your-AVideo-Platform

image

You do not suppose to copy the files. you suppose to use the git pull.

https://github.com/WWBN/AVideo/wiki/How-to-Update-your-AVideo-Platform

Sorry, but I did it:

Updating 5fea95c49..b75ed22c7
Fast-forward
 .htaccess          |  6 ++----
 view/xsendfile.php | 17 +++++++++++------
 2 files changed, 13 insertions(+), 10 deletions(-)

Either way, it worked out: I opened a incognito window and it displayed the "invalid token" message.

Screen Shot 2020-09-11 at 16 56 00

Thanks for the support and patience and keep up this awesome project.

Thanks for the update, I am glad it is working

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moses268 picture moses268  Â·  3Comments

gamersalpha picture gamersalpha  Â·  3Comments

akhilleusuggo picture akhilleusuggo  Â·  3Comments

CorpCaleCloud picture CorpCaleCloud  Â·  4Comments

Powerbock picture Powerbock  Â·  3Comments