Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Install xsendfile in easy apache 4 for litespeed and apache

Discussion in 'EasyApache' started by kiavaco, Oct 5, 2017.

  1. kiavaco

    kiavaco Registered

    Joined:
    Oct 5, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    DataCenter Provider
    hi i want install mod_xsendfile in apache but i dont know how can i install it , i want install litespeed and install xsendfile please say to me how can i install xsendfile in apache or litespeed thanks
     
  2. kiavaco

    kiavaco Registered

    Joined:
    Oct 5, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    DataCenter Provider
    please help me i want install xsendfile in easy apache 4 for webserver apache or litespeed thanks
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,633
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    kiavaco likes this.
  4. Shahsavani

    Shahsavani Registered

    Joined:
    Feb 9, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Iran
    cPanel Access Level:
    Root Administrator
    hi
    i'm new to whm
    please help me
    how to install or enable X-Sendfile in easy apache 4 for litespeed and apache
     
  5. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    @Shahsavani, did you read the linked feature request?
    mod_xsendfile support

    You'll need to manually enable the EA4-experimental repository, then you can install it:
    Code:
    yum install ea4-experimental
    yum install ea-apache24-mod_xsendfile
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Shahsavani

    Shahsavani Registered

    Joined:
    Feb 9, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Iran
    cPanel Access Level:
    Root Administrator
    I use the WHM Version 68.0.28.
    It's shown in the EasyApache4 that mod_xsendfile is installed, but it does not work.

    I tested it with a php method.
    This is the PHP method :
    <?php
    if (function_exists('apache_get_modules') && in_array('mod_xsendfile', apache_get_modules())) {
    echo "X-Sendfile is Installed and working";
    }else{
    echo " not working ;(( ";
    }
    ?>
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,633
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Check to ensure you've enabled the module via the .htaccess file in the document root of the website. The module documents how to do this at:

    mod_xsendfile for Apache2/Apache2.2

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Shahsavani

    Shahsavani Registered

    Joined:
    Feb 9, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Iran
    cPanel Access Level:
    Root Administrator
    Hello
    Thank you for answering, but it still does not work
    this is .htaccess file in the document root of the website :
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    <IfModule mod_xsendfile.c>
    XSendFile On
    </IfModule>
    <Files *.php>
    XSendFile On
    </Files>
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,633
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Here's a test PHP script you could try using:

    Code:
    <?php
    header('X-Sendfile: /home/username/public_html/123.txt');
    header('Content-Disposition: attachment;filename=123.txt');
    Simply create that test PHP file and "123.txt" file , then update the path to match the directory it's located at. If it doesn't work, feel free to open a support ticket so we can take a closer look.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Shahsavani

    Shahsavani Registered

    Joined:
    Feb 9, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Iran
    cPanel Access Level:
    Root Administrator
    Hello

    it does not work with header('X-Sendfile: /home/username/public_html/123.txt'); return 0 byte
    But i switch to LiteSpeed and use header('X-LiteSpeed-Location: /home/username/public_html/123.txt'');
    and it's work
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice