Tags:
create new tag
view all tags

Question

Hello there. I am getting no errors or warnings from /bin/configure script, but I get this error when attempting to register my first user from the registration screen...

Forbidden You don't have permission to access /twiki/bin/register/Main/WebHome on this server.

The server log has this:

[Sun Apr 16 09:35:09 2006] [error] [client 70.135.101.255] client denied by server configuration: /home/jalvarez/public_html/twiki/bin/register

I asked my hosting svc. tech to look at my .htpasswd file, because the browser presents a permissions-related msg.

The hosting tech replied: "I am not quite sure how to handle these - if, perhaps, you need a ScriptAlias line in your httpd.conf entry relating to /twiki/bin, or if it's something else. Please make sure all of your settings are correct"

I had started by placing a blank text file named .htpasswd (perms 755) in the /twiki/data folder as instructed in the twiki install doc...

In config I chose - LoginManager - Twiki::Client::TemplateLogin

PasswordManager - Twiki::Users::HtpasswdUser

filename: /home/jalvarez/public_html/twiki/data/.htpasswd

Any ideas on what I need to do/check?

Many thanks, Jose

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux, 2.6.9-11.ELsmp
Web server: 1.3.34
Perl version: 5.8.7
Client OS: Win2K
Web Browser: IE6/Firefox
Categories: Registration

-- JoseAlvarez - 16 Apr 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.

Hi again. I guess this time I am to blame smile

Do you remember that I've suggested a .htaccess file to put into your bin directory? Is this file still in place?

If yes: It contains the following lines:

<FilesMatch "register">
       deny from all
</FilesMatch>

This was a interim hack I suggested so that your website wouldn't be flooded by spammers' registrations before you got configure up and running. This setting would result in exactly the error message you quoted.

I think that now is the time to implement a "real" bin/.htaccess with the settings you need.

For template login, there isn't much to do in Apache's configuration. I guess that you need just one line in bin/.htaccess:

SetHandler cgi-script

However, if it is an open internet TWiki you might want to protect it against spammers.

See the configure setting for NeedVerification (check that your hosting environment allows sending mail) and probably BlackListPlugin.

-- HaraldJoerg - 18 Apr 2006

Hello Harald.

Good to hear from you! And with such welcome information...I started laughing when I read your post above, because I do remember your mentioning the .htaccess in place was just a stopgap until we got things rolling.

I'll make the changes immediately and work on the plugin you mentioned.

Thanks for remembering! Jose

-- JoseAlvarez - 19 Apr 2006

This is the contents of the /bin/.htaccess file. I changed the deny from all to allow from all, but still don't get a successful registration.

Interestingly, if I try to submit the registration page without specifying a country, I get a twiki message stating that I can't register without specifying a country. Once I choose USA and re-submit, I get... address change to "http://www.synapse-technology.com/twiki/bin/register/Main/WebHome

...with the IE message "The page cannot be displayed." Maybe this helps isolate where the hangup is.

Content of /bin/.htaccess :

SetHandler cgi-script

AuthUserFile /home/jalvarez/public_html/twiki/data/.htpasswd
AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith). Cancel to register if you do not have one.'
AuthType Basic

<FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|.*auth).*">
       require valid-user
</FilesMatch>

<FilesMatch ".*">
       allow from all
</FilesMatch>

<FilesMatch "register">
       allow from all
</FilesMatch>

-- JoseAlvarez - 19 Apr 2006

Have the problem in the crosshairs:

Tried registering from Firefox in hopes of getting more error data through the optional browser...sure enough: The registration process is hanging up on the attempt to send the registering user a confirmation email. The problem involves the Net::SMTP script, and is a restriction on relaying mail through the server. I have notified the hosting service of this, but really don't know what it takes to resolve.

-- JoseAlvarez - 19 Apr 2006

I got this back from the hosting provider:

If you are not setting up SMTP authentication, this could be the reason. Try this text:

SMTP Authentication

The Net::SMTP class supports three authentication schemes; PLAIN, LOGIN and CRAM MD5. (SMTP Authentication: [RFC2554]) To use SMTP authentication, pass extra arguments to SMTP.start/SMTP#start.

# PLAIN
Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain',
'Your Account', 'Your Password', :plain)
# LOGIN
Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain',
'Your Account', 'Your Password', :login)

# CRAM MD5
Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain',
'Your Account', 'Your Password', :cram_md5)

-- JoseAlvarez - 19 Apr 2006

(a minor hint first: If you are quoting plain text files, please enclose them between <verbatim> and </verbatim>, each in a line of its own, to avoid re-formatting)

The first part is easy to fix: Delete most of the stuff from your bin/.htaccess so that it looks like:

SetHandler cgi-script

<FilesMatch ".*">
       allow from all
</FilesMatch>

The other lines you have in your file are activating Apache login, but you wrote that you want to use Template login.

However, the mail problem is serious since TWiki's Net::SMTP interface does not allow to configure a userid/password pair for SMTP authentication (but on the other hand, I can understand why a hosting service wants authentication). Unfortunately TWiki can't be convinced to even try sendmail if Net::SMTP is installed. I'm afraid you need to hack the code to overcome this.

Since Net::SMTP is capable of authentication, you could add one line:

Index: lib/TWiki/Net.pm
===================================================================
--- lib/TWiki/Net.pm    (revision 9868)
+++ lib/TWiki/Net.pm    (working copy)
@@ -292,6 +292,7 @@
     } else {
         $smtp = Net::SMTP->new( $this->{MAIL_HOST} );
     }
+    $smtp->auth('your_user_id','your_password');
     my $status = '';
     my $mess = "ERROR: Can't send mail using Net::SMTP. ";
     die $mess."Can't connect to '$this->{MAIL_HOST}'" unless $smtp;

Replace 'your_user_id' and 'your_password' by the obvious. I'm sorry to say that this is a blind guess, I have no chance to test it in my installation frown

-- HaraldJoerg - 19 Apr 2006

Harald...you da' man! The SMTP authentication hack worked perfectly. Things are now running smoooothly, only thanks to your knowledgeable and dependable helps... have even ventured into installing several plugins and a skin...no problem.

Where does one mail the bottle of champagne?

Cheers, Jose

-- JoseAlvarez - 23 Apr 2006

That's the right attitude cool!

-- PeterThoeny - 23 Apr 2006

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2006-04-23 - 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-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.