I'm not sure why this is, but when I hit "Version Control" on the project page at http://drupal.org/project/xsendfile , it tells me that there is no source available.

I'd like to contribute some cleanup to the README along with some extra documentation for getting started - at least for the missing Apache stuff. I had to inspect the code to figure out where the configuration pages were, for example - would be nice to have easy to follow steps in there.

Once git is up I can submit a patch :)

Thanks!

CommentFileSizeAuthor
#4 xsendfile_empty_repository.jpg30.09 KBdamien_vancouver

Comments

damien_vancouver’s picture

Title: No 7.x-1.x code available in git Version Control tab » Documentation improvements
Component: Code » Documentation

I got everything working, and it works great!

I'm hijacking my own thread here and just making it somehwere I can post notes that can go into the documentation patches.

Debian specific instructions

- As of Debian 6 and above, the module is available as a package (yay!) You can just '''apt-get install libapache2-mod-xsendfile''' to install version 0.9 of the module.

- I had to build by source on Debian 5 though, which allowed me to get the very latest version (with improved FCGI support and large file performance fixes). Here are Deb/Ubuntu/Apache2 build from source commands that should work with current distros:

apt-get install apache2-prefork-dev build-essential
wget --no-check-certificate "https://tn123.org/mod_xsendfile/mod_xsendfile-0.12.tar.gz#hash(sha256:9078ec28697d672a7f8aa3a19180109c1ccf73dc6aa335e856d1129344566b7e)"
tar xzvf mod_xsendfile-0.12.tar.gz
cd mod_xsendfile-0.12
apxs2 -cia mod_xsendfile.c
a2enmod xsendfile
apache2ctl configtes t
# if no errors from configtest,it's probably safe to:  /etc/init.d/apache2 restart

mod_xsendfile directives have changed/improved

The module instructions on the settings page tell you to add the following to .htaccess:

XSendFile on
XSendFileAllowAbove on

However, XSendFileAllowAbove was deprecated in mod_xsendfile 0.10, and replaced with XSendFilePath instead (which allows multiple locations) - see https://tn123.org/mod_xsendfile/ in the changelog at the end. Another however - XSendFilePath is only allowed in a Virtualhost file, not in .htaccess.

So that means with the new version, if you want to serve up private file content from a directory outside your Drupal site's web root, you have to put the directives in the virtualhost file. Which is a better place for them anyway. Though .htaccess will work as long as your mod_xsendfile is old enough.

<IfModule mod_xsendfile.c>
  XSendFile on

  # mod_xsendfile >= 0.10 needs XSendFilePath /path/to/private/files/directory
  XSendFilePath /var/www/drupal/private_files

  # mod_xsendfile < 0.10 only needs XSendFileAllowAbove On:  XSendFileAllowAbove On
</IfModule>

Also, we should instruct people to place these directives in their apache Virtualhost file, rather than in .htaccess (as the next Drupal core update will clobber any changes there)

Testing it works

I did this by stepping through in XDebug, but that's not feasible on a prod server. Is there any way via Apache logs to see that it's actually working? If not, could/should we add a Debugging option to the settings that could cause a watchdog log or something saying that a file had been transferred by XSendFile (or not, as the case may be). That plus some simple instructions would be enough for more novice users to convince themselves that yes, it's on, and yes, my file is still downloading.

I'll be putting this on production this evening hopefully. If I have any other relevant details we can document, will add here. I'll write up proper instructions rather than the above point form when/if I get to a patch.

EDIT: I discovered that if it's not working, you get 0 byte files back. Easy to test!

marcoka’s picture

so git is working for you now?

damien_vancouver’s picture

It should be, but I got held up on promoting to production.. I am waiting on some developers to install the module on a bunch of sites and get them tested on the dev server first. It should make it to production in the next couple days, and I'll confirm it's all working here then and organize the above into some better apache docs.

damien_vancouver’s picture

StatusFileSize
new30.09 KB

I was mistaken, Git is still not working for me.

I attached a screenshot of what I see when I hit the "Version Control" tab. I should see cloning instructions there but don't.

Maybe something under "Releases" when you edit the project?

marcoka’s picture

damien_vancouver’s picture

Hm, OK I guess you need to do those steps and then push in a 7.x-1.x branch in order for anyone else to check out and make patches.

I can help you with that if you want to give me access (even temporarily) by adding me to the maintainers in the maintainers tab..

or those instructions should do the job pretty much.

What puzzles me is how the 7.x-1.0-beta1 release even got up for download. Usually those come from git. Did it let you upload the .tar.gz or something?

marcoka’s picture

ok i give you maintainer access.

damien_vancouver’s picture

Assigned: Unassigned » damien_vancouver
Status: Active » Needs work

OK, I set up the repository and created a 7.x-1.x branch, and put code from 7.x-1.0-beta1 in there.

If you now look at the "Version Control" tab it should have instructions for you on how to check out the 7.x-1.x branch.

It also has other instructions on how to commit back and so on.

The 7.x-1.x-dev release should show up for download overnight.

I'm assigning this docuemntation issue to me and setting it to "needs work" for the time being.