Twiki Authentication working on FreeBSD

Install Apache13 (Apache13-modssl could work but not tested)
get it up and running

install twiki from /usr/ports
get basic configuration up and running (be sure to set the mail options in TWikiPreferences)
register yourself on the twiki

Follow authentication setup instructions very carefully.


Enabling Authentication of Users

 

  • If TWiki is installed on a non-authenticated server – not using SSL – and you’d like to authenticate users:

    1. Rename file .htaccess.txt in the twiki/bin directory to .htaccess and change it to your needs. For details, consult the HTTP server documentation (for Apache server: [1], [2]). In particular, the following red part needs to be configured correctly:
             Redirect /urlpathto/twiki/index.html http://yourdomain.com/urlpathto/twiki/bin/view
              AuthUserFile /filepathto/twiki/data/.htpasswd
              ErrorDocument 401 /urlpathto/twiki/bin/oops/TWiki/TWikiRegistration?template=oopsauth

      • ALERT! NOTE: If you had to add a .cgi or .pl file extension to the bin scripts, make sure to do the same for edit, view, preview, and all the other script names in .htaccess.
      • HELP The browser should ask for login name and password when you click on the Edit link. In case .htaccess does not have the desired effect, you need to enable it: Add "AllowOverride All" to the Directory [3] section of access.conf for your twiki/bin directory.
        • This applies only if you have root access: on hosted accounts, you shouldn’t have this problem – otherwise, email tech support.
      • ALERT! NOTE: In the TWiki distribution package, the twiki/data/.htpasswd.txt
        file contains several TWiki core team user accounts and a guest user
        account. You probably want to remove those accounts by deleting the
        entries in .htpasswd. Do not remove the guest user if you want to allow guest logins.
    2. Copy the TWikiRegistrationPub topic to TWikiRegistration, overwriting old version of TWikiRegistration. Do that by either editing the topics in theTWiki web, or by renaming the .txt and .txt,v files in the twiki/data/TWiki directory.
  • Customization:
    • You can customize the registration form by deleting or adding input tags. The name="" parameter of the input tags must start with: "Twk0..." (if this is an optional entry), or "Twk1..." (if this is a required entry). This ensures that the fields are carried over into the user home page correctly.
    • You can customize the default user home page in NewUserTemplate.
  • Register yourself in the TWikiRegistration topic.
    • ALERT! NOTE: When a user registers, a new line with the username and encrypted password is added to the data/.htpasswd file. The .htpasswd
      file that comes with the TWiki installation includes user accounts for
      TWiki core team members that are used for testing on TWiki.org. You can
      edit the file and delete those lines.
  • Create a new topic to check if authentication works.
  • Edit the TWikiAdminGroup topic in the TWiki:Main web to include users with system administrator status.
  • Edit the TWikiPreferences topic in the TWiki:TWiki web to set access privileges.
  • Edit the WebPreferences topic in each web, if necessary: set access priviliges.

That’s it for a basic new web set-up!

Finally, Inside /usr/local/etc/apache/access.conf, add:

<  d i r e c t o r y  /usr/local/www/twiki/bin >
  AllowOverride All
<  d i r e c t o r y  >

This entry was posted in FreeBSD. Bookmark the permalink.