[GH-ISSUE #36] Apache mod_xsendfile cannot serve files above root path #25

Closed
opened 2026-02-26 02:31:50 +03:00 by kerem · 3 comments
Owner

Originally created by @mattsches on GitHub (Dec 14, 2015).
Original GitHub issue: https://github.com/koel/koel/issues/36

When running koel on my local Apache 2.4.12 with mod_xsendfile 0.12 enabled, it cannot play any song. The following error occurrs for each song I try to play:

[Mon Dec 14 19:52:39.429049 2015] [:error] [pid 27537] (20023)The given path was above the root path: [client 127.0.0.1:60736] xsendfile: unable to find file: /home/mattsches/music/foo/bar.mp3

The solution seems to be to white-list my music directory by setting the XSendFilePath option in my vhost config:

<VirtualHost *:80>
        ServerName koel.local
        XSendFilePath /home/mattsches/music
        DocumentRoot /var/www/vhosts/koel.local/httpdocs
        <Directory /var/www/vhosts/koel.local/httpdocs>
                DirectoryIndex index.html index.php
                Options FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Not sure what else could be done about this.

Originally created by @mattsches on GitHub (Dec 14, 2015). Original GitHub issue: https://github.com/koel/koel/issues/36 When running koel on my local Apache 2.4.12 with `mod_xsendfile` 0.12 enabled, it cannot play any song. The following error occurrs for each song I try to play: ``` [Mon Dec 14 19:52:39.429049 2015] [:error] [pid 27537] (20023)The given path was above the root path: [client 127.0.0.1:60736] xsendfile: unable to find file: /home/mattsches/music/foo/bar.mp3 ``` The solution seems to be to white-list my music directory by setting the `XSendFilePath` option in my vhost config: ``` <VirtualHost *:80> ServerName koel.local XSendFilePath /home/mattsches/music DocumentRoot /var/www/vhosts/koel.local/httpdocs <Directory /var/www/vhosts/koel.local/httpdocs> DirectoryIndex index.html index.php Options FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> ``` Not sure what else could be done about this.
kerem closed this issue 2026-02-26 02:31:50 +03:00
Author
Owner

@phanan commented on GitHub (Dec 15, 2015):

It looks like a pure Apache config issue to me right?

<!-- gh-comment-id:164599076 --> @phanan commented on GitHub (Dec 15, 2015): It looks like a pure Apache config issue to me right?
Author
Owner

@mattsches commented on GitHub (Dec 15, 2015):

Right, but maybe you want to add this to the readme/docs?

<!-- gh-comment-id:164695773 --> @mattsches commented on GitHub (Dec 15, 2015): Right, but maybe you want to add this to the readme/docs?
Author
Owner

@phanan commented on GitHub (Dec 15, 2015):

I'm not sure. Installing an Apache module sounds out of Koel's scope to me.

<!-- gh-comment-id:164701798 --> @phanan commented on GitHub (Dec 15, 2015): I'm not sure. Installing an Apache module sounds out of Koel's scope to me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#25
No description provided.