title: Install xSendFile in Apache Ubuntu 16.04
body: <p>I want to use the xSendFIle to download large files in PHP. I have tried following the tutorials here <a href="https://tn123.org/mod_xsendfile/" rel="nofollow noreferrer">https://tn123.org/mod_xsendfile/</a> to get it installed.</p>
  
  <p>I did this by 
  1) Cloning the directory</p>
  
  <p><code>git clone https://github.com/nmaier/mod_xsendfile.git</code></p>
  
  <p>2) Installing it using</p>
  
  <pre><code> apxs -cia mod_xsendfile.c
  </code></pre>
  
  <p>3) I edited my virtualhost port 80 to look like this</p>
  
  <ul>
  <li><code>nano /etc/apache2/sites-available#000-default.conf</code></li>
  </ul>
  
  <p><code>&lt;VirtualHost *:80&gt;
     ServerName example.com
     Redirect permanent / https://www.example.com/
      RewriteEngine On
      RewriteCond https://example.com [NC]
      RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
      XSendFile on
      XSendFilePath /var/www/html/hostfolder/web/
  &lt;/VirtualHost&gt;
  </code></p>
  
  <p>At this point, I expected my download to work and download a file inside 
  /var/www/html/hostfolder/web/music/file.zip</p>
  
  <p>Extra information:
  I am using Yii2 framework
  I am hosting with Digital Ocean</p>
  
  <p>Any help on this will be greatly appreciated</p>