Tags:
create new tag
view all tags

Question

I was reading on this site about the fact that I need to modify the view script in order to lock down the /pub folder contents.

There seemed to be two ways to go about this and I was wondering if anyone can let me know the best way to do it, and how... the directions I saw were not exactly clear enough for this noobie... smile

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Debian
Web server: Firefox
Perl version:  
Client OS: Windows
Web Browser: FireFox
Categories: Security

-- StevenColbert - 26 Jul 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Looks like I'll answer my own question... smile

Per: TWikiVMDebianStableCreationLog

Add the following three lines to /twiki/twiki_httpd.conf

  RewriteEngine on
  RewriteRule ^/twiki/pub/TWiki/(.*)$ /twiki/pub/TWiki/$1 [L,PT]
  RewriteRule ^/twiki/pub/([^\/]+)/([^\/]+)/([^\/]+)$ /twiki/bin/viewfile/$1/$2?filename=$3 [L,PT]

-- StevenColbert - 27 Jul 2006

See also SecuringAttachments.

-- PeterThoeny - 29 Jul 2006

For hosted TWiki where the rewrite rules are in  the .htaccess file the mapping rules are are somewhat different. Note the lack of slashes at the start of each path and that this version allows more than one directory level:

RewriteOptions inherit
RewriteEngine On
# set RewriteBase when using in .htaccess; see Apache docs
RewriteBase /twiki
# basically leave /pub/Twiki unchanged
  RewriteRule ^pub/TWiki/(.*)$ pub/TWiki/$1 [L,PT]
# send all other /pub/* to /bin/viewfile/<path>?filename=<file>
  RewriteRule ^pub/(.*)/([^\/]*)$ bin/viewfile/$1?filename=$2 [L,PT]

ChuckEhrlich - 21 Aug 2006

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2020-04-26 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.