Thursday, 7 February 2013

Windows WebDAV Double Authentication 401 Requets

Speed up trick for Windows 7 WebDAV Client

One way to conveniently develop remotely with Eclipse + PyDev is to run WebDAV on the remote server and map it as a networked drive in Windows (PyDev over Eclipse Target Managmenet does not play nicely). WebDAV works rather well except it is not the fastest especially on initial project creation /project refreshing and if your share is protected with a username/password; below is how I improved the performance.

Apparently by protocol design and due to security Windows 7 client does not cache it's authentication and so on each request first an anonymous attempt is made followed by an authenticated one:

...
72.38.184.18 - - [22/Jan/2013:23:05:04 +0000] "PROPFIND /Files HTTP/1.0" 401 751
72.38.184.18 - username [22/Mar/2011:23:05:04 +0000] "PROPFIND /Files HTTP/1.0" 301 495
72.38.184.18 - - [22/Jan/2013:23:05:04 +0000] "PROPFIND /Files/ HTTP/1.0" 401 751
72.38.184.18 - username [22/Mar/2011:23:05:04 +0000] "PROPFIND /Files/ HTTP/1.0" 207 1175
72.38.184.18 - - [22/Jan/2013:23:05:07 +0000] "PROPFIND /Files HTTP/1.0" 401 751
...

After a bit of research I was able to implement a work around, allow anonymous access to the PROPFIND requests which are mainly used for directory listings and authenticated access for everything else. Refreshing a python/djagno project will take half as long for example 21876 files took 11 minutes with no authentication vs 21 with authentication

## Development HTTP Site
<VirtualHost *:80>
  ServerAdmin FOO@FOO.com
  ServerName development.FOO.com
  ServerAlias www.development.FOO.com

  # Log file location and settings; logs within project is ok as long as 'links' are made to system 'var/log/apache'
  ErrorLog /var/log/apache2/development.FOO.com-error.log
  CustomLog /var/log/apache2/development.FOO.com-vhost_combined-access.log vhost_combined

  # Canonical to always strip www - see: http://stackoverflow.com/questions/88011/make-apache-automatically-strip-off-the-www
  RewriteCond %{HTTP_HOST} ^www\.(.+)$
  RewriteRule ^(.*)$ ${SERVER_PROTOCOL}://%1/$1 [R=301,L,NC]

  # Authenticated access for the development site version - because without this Google will find you!
  # Just in case we also prevent serving of the password logins file if it is stored in a serving folder.
  Redirect /apache-logins.htdigest http://development.FOO.com
  <Location />
    AuthType Digest
    AuthName "development.FOO.com"
    # AuthDigestDomain which urls (and any under it) this applies - should match location
    AuthDigestDomain /
    AuthDigestProvider file
    AuthUserFile /srv/www/django/development.FOO.com/apache-logins.htdigest
    # uncomment the LimitExcept to receive a small boost for non caching Windows WebDAV client by allowing
    # anonymous directory listing; see http://serverfault.com/questions/250578/webdav-and-windows-7-client
    <LimitExcept PROPFIND>
     Require valid-user
    </LimitExcept>
  </Location>

  WSGIProcessGroup development.FOO.com
  # You can further limit processes, threads and set a inactivity-timer so deamon get unloaded
  WSGIDaemonProcess development.FOO.com display-name=%{GROUP}
  WSGIScriptAlias / /srv/www/django/development.FOO.com/apache-django-development.wsgi

  # Serve static / media files through apache instance and alias/map them to specific urls. to maximize security
  # `Options -Indexes` is enabled to prevent directory listing
  Options -Indexes
  Alias /robots.txt /srv/www/django/development.FOO.com/src/django-project/static/robots.txt
 #Alias /sitemap.xml /srv/www/django/development.FOO.com/src/django-project/static/sitemap.xml
  Alias /favicon.ico /srv/www/django/development.FOO.com/src/django-project/static/favicon.ico
  Alias /media /srv/www/django/development.FOO.com/src/django-project/static/
  Alias /static /srv/www/django/development.FOO.com/src/django-project/static/

</VirtualHost>

Hope this helps you out, feel free to follow me on twitter or google plus: @danielsokolowski and +1 this.

74 comments:

  1. Thank you everyone!Passbeemedia I'm anxious to see what my students write.

    ReplyDelete
  2. Hello, Big thanks for told me about the HTML ... I am a students and i am learn HTML. But this coding is really very helpful for me. For more Swimming Coaches in Sydney, Australia info visit this link . I got lot of information form this website.

    ReplyDelete
  3. Well fantastic website and I can not recommend you guys enough. I really appreciate your post. It is very helpful for all the people on the web. Apple Ibeacon

    ReplyDelete
  4. Amazing!! Of which appears totally wonderful. I love ones creativity in addition to we are certainly trust your factors to figure out in this article. Their a really wonderful support. Thanks intended for sharing. half up half down hairstyles

    ReplyDelete
  5. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!.Visit website

    ReplyDelete
  6. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!Seaside Real Estate

    ReplyDelete
  7. It seems like an educational blog which always some new information to visitors and Enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.hemorrhoids treatment

    ReplyDelete
  8. Medium length hairstyles have always been a favourite for many people. Not only because this is a safer look, but also because it compliments almost any facial shape. Medium length also has a variety of styles to choose from, but almost all are easy to manage and are complimentary to ones natural beauty. Half up half down hairstyles medium length hair

    ReplyDelete
  9. This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this. Meath Builders

    ReplyDelete
  10. Hair is common in mammals on earth, and almost all mammals groom themselves and their body hair as part of hygiene. But it is only Humans, who pay more attention to hairstyles for the hair on their heads. In the past few centuries, new and fashionable hairstyles have become the rage, especially among the rich and famous. In the modern world half up half down hairstyles

    ReplyDelete
  11. Great Information,it has lot for stuff which is informative.I will share the post with my friends.
    Operations Management Assignment

    ReplyDelete
  12. Well thanks for posting such an outstanding idea. I like this blog & I like the topic and thinking of making it right.
    Simulink Assignment Help

    ReplyDelete
  13. The key is to give the peruser a little look into your experience, which urges them to need to take in more by perusing your resume
    Medical Assignment Help

    ReplyDelete
  14. It is a very technical post you have shared. Many inexperienced persons can take a great advantage from this post.
    Dissertation Help

    ReplyDelete
  15. Hi! I just would like to give a huge thumbs up for the fantastic information you’ve got here on this post. I is going to be coming back to your weblog for additional soon.

    Watch The Witch online | Watch Star Wars The Force Awakens full movie

    ReplyDelete
  16. Once you are well-informed about the real estate market and the selling process, selling your own home will become less stressfu.Key West Resort Injury Lawyer

    ReplyDelete
  17. Astonishing!! Of which shows up absolutely brilliant. I cherish ones innovativeness notwithstanding we are positively believe your variables to make sense of in this article. Huge much obliged for let me know about the HTML. I am an understudies and i am learn HTML But this coding is truly extremely supportive for me. And if anyone who want to hire ordercollegepapers.com online academic service please visit our website.

    ReplyDelete
  18. I am certain this post has offered me some assistance with saving numerous hours of perusing other related presents just on find what I was searching for. Much obliged!
    Case Study Solution

    ReplyDelete
  19. Check out Euro Cup 2016 to know everything about Euro Cup 2016,which is due to start on 10th June in France and also watch all the matches live.

    ReplyDelete
  20. All the best blogs that is very useful for keeping me share the ideas
    of the future as well this is really what I was looking for, and I am
    very happy to come here. Thank you very much
    earn to die
    earn to die 2
    earn to die 3
    Hi! I’ve been reading your blog for a while now and finally got the
    earn to die 4
    courage to go ahead and give youu a shout out from
    earn to die 6
    Austin Texas! Just wanted to tell
    earn to die 5
    Hi! I’ve been reading your blog for a while now and finally got the
    happy wheels
    strike force heroes
    slitherio
    you keep up the fantastic work!my weblog
    age of war
    good game empire

    ReplyDelete
  21. I am profoundly pulled in by your post. It is truly a decent and useful one. I will prescribe it to my companions.
    The Merger of UCSF Medical Center and Stanford Health Services Case Solution

    ReplyDelete
  22. Incredible post and I figure I'm likewise a devotee of web journal remarking as it has various advantages.
    Online Programming Assignment Help

    ReplyDelete
  23. Decent post. It is really helpful to us. An opportunity to read a fantastic and imaginary article. Its really a good article. It gives me lots of pleasure and interest.
    Packing machine supplier

    ReplyDelete
  24. I for one such as your post; you have shared great bits of knowledge and encounters. Keep it up.
    Green Gold -an Innovative Sustainable Mining Scheme Case Solution

    ReplyDelete
  25. This is the idea I need for my research paper writing! I was searching for something like that, but it wasn't the thing I need. Thank you very much for this blog and posting http://awriter.org/customwritingscom

    ReplyDelete
  26. Have a look at Veterans Day Quotes if you want to know about veterans day and why is it celebrated.

    ReplyDelete
  27. Pleasant article. Think so new type of elements have incorporated into your article. Sitting tight for your next article.
    Marketing Plan Case Solution

    ReplyDelete
  28. I am so happy to read this. This is the kind of manual that needs to be given and not the random misinformation that's at the other blogs.
    Mechanical Engineering Homework Help

    ReplyDelete
  29. I personally like your post; you have shared good insights and experiences. Keep it up.
    SpineRewriter.com Manual Article Spinning Service

    ReplyDelete
  30. Know about world's best games info, visit our site GAMING PHOBIA

    ReplyDelete
  31. Good way of telling, good post to take facts regarding my presentation subject matter, which i am going to deliver in my college
    Network Layer Project Help

    ReplyDelete
  32. First of all let me tell you, you have got a great blog .I am interested in looking for more of such topics and would like to have further information. Hope to see the next blog soon.Toronto Limo To Airport

    ReplyDelete
  33. Latest Happy Valentines Day quotes and wishes for Girl friend/Boy Friend.

    ReplyDelete
  34. If you love cats, you must check out my blog National Cat Day
    which is solely dedicated to cats. Learn everything you want to know about cats and stay updated. Enjoy with your pets on Cat Day and make her feel special.

    ReplyDelete

  35. We'll take Juggernox one part at a time. Unquestionably, this does happen often. Inevitably, Juggernox could also include Juggernox.

    This column is simply meant to lay the framework first as though I loved Juggernox and I hope that they can make one even better next time. Small world, isn't it? I need reliable future leaders. >>>http://www.kingsizemaleenhancements.com/juggernox/

    ReplyDelete
  36. It is really nice blog that become inspiration to everyone.
    hire a ghostwriter

    ReplyDelete
  37. Thats Good to be hearing here Thanks For More Helpful Tips
    Online Homework Help

    ReplyDelete
  38. Great material. Thanks you for posting this article!
    Buy R Programming Assignment

    ReplyDelete
  39. John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.
    Online VB Project Help

    ReplyDelete
  40. I cherish ones inventiveness notwithstanding we are unquestionably believe your elements to make sense of in this article. It appears like an instructive blog which Research Paper Editors constantly some new data to guests and Enjoying each and every piece of it and I have you bookmarked to look at new stuff you blog entry.

    ReplyDelete
  41. My friend recommended this blog and he was totally right keep up the good work MBA Assignment Writing Service

    ReplyDelete
  42. Term paper service
    This is really a great stuff for sharing. Keep it up .Thanks for sharing.

    ReplyDelete
  43. Science Channel’s are giving a complete knowledge to its viewers about every thing students write done dissertation on this subjects and show its importance.
    Political Economics Assignment Help

    ReplyDelete
  44. matlab tutoring
    I appreciate this work amazing post for us I like it.

    ReplyDelete
  45. Nice article
    CBSE Result 2017

    Very much interesting to read such a nice a posting / article
    CBSE 10th Result 2017

    Nice and informative
    CBSE 12th Result 2017

    ReplyDelete
  46. John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.
    Accounting Homework Assignment Help

    ReplyDelete
  47. HRM Dissertation Help
    John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.

    ReplyDelete
  48. John arnold is an academic writer of the Dissertation-Guidance.java homework solutions
    Who writes quality academic papers for students to help them in accomplishing their goals.

    ReplyDelete
  49. John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.
    help with programming

    ReplyDelete
  50. Performing Conditional Logic in SAS Homework Help
    John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.

    ReplyDelete
  51. John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.
    Value Added Theory Assignment Help

    ReplyDelete
  52. Linear Programming Assignment Help
    John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.

    ReplyDelete
  53. Science Channel's are giving an entire information to its viewers about everything understudies compose done Airport Taxis London thesis on this subjects and demonstrate its significance. Who composes quality scholarly papers for understudies to help them in achieving their objectives.

    ReplyDelete
  54. Thanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well. Thanks for giving me the useful information. I think I need it!
    Rose Day SMS
    Propose Day SMS

    ReplyDelete
  55. good that would certainly be silly) at filtering your water. water softener in regards to the technology made use of in order best.

    ReplyDelete
  56. good reduce chlorine, both preference and also smell, hefty metals, water filter pitcher reviews This water purifier will certainly remove this odor and also great.

    ReplyDelete
  57. good your chosen video clip is posted to the web servers, analyzed and artisto for android Artisto application, in any case, seems to have a set variety of great.

    ReplyDelete
  58. good paying your charges since they want their wedding Wedding Photographers in Bangalore share some of the most effective tips on ways to take nice.

    ReplyDelete
  59. good internet connection. It will certainly functions https://iterrariumtv.com utilize this Terrarium TV Application. As of understand nice.

    ReplyDelete
  60. good mobile phone opt for this application. Not just imobdrodownload.com it permanently due to its high quality. If you encountered best.

    ReplyDelete