Tags:
create new tag
view all tags

Question

I'm installing my first Twiki. Previously setup MediaWiki successfuly for archive project, but this platform seems ideal for collaboration. Installation on hosted server is proving to be a challenge...Upon request, hosting provider sent me error log entries that show .htaccess to be part of problem.

Error log entry:

[Tue Nov 29 21:22:55 2005] [alert] [client 71.139.73.100] /home/jalvarez/public_html/twiki/bin/.htaccess: Invalid command '/home/jalvarez/public_html/twiki', perhaps mis-spelled or defined by a module not included in the server configuration

I have tried editing the .htaccess file in /twiki/bin several times. There's probably something there I'm not getting right.

I have also tried accessing /twiki/bin/testenv but it generates the same error as /twiki/bin/view. The hosting provider did supposedly setup the /twiki/bin folder as a CGI location.

Would one of you kindly take a look at my setup and advise? [Attempted] installation at synapse-technology.com/twiki

Many thanks. Jose

Environment

TWiki version: TWikiRelease04Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux, 2.6.9-11.ELsmp
Web server: Apache 1.3.34
Perl version: 5.8.7
Client OS: Win2000 desktop
Web Browser: IE6
Categories: Installation, Htaccess

-- JoseAlvarez - 30 Nov 2005

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.

Please? Will someone kindly look at our setup and help get us up and running? Jose

-- JoseAlvarez - 06 Dec 2005

Try installing DakarRelease - its much easier to install, reliable and better functionality.

-- MartinCleaver - 06 Dec 2005

Thanks Martin. I have removed the old Twiki version and installed Dakar. Having taken the initial steps, such as setting permissions, .cfg files, I believe as needed before running configure.cgi, the hosting service has sent the latest log msg for my attempt at running /twiki/bin/configure.cgi:

Premature end of script headers: /home/jalvarez/public_html/twiki/bin/configure.cgi

Any thoughts on this msg?

Thanks very much for the assistance. Jose

-- JoseAlvarez - 07 Dec 2005

I do not think this has anything to do with Cairo vs Dakar. You have a cgi setup issue.

  • Check the #!/usr/bin/perl line
  • Check file permissions of the scripts. In some environments you get a "Premature end of script headers" message if the group flag is set to writable. Set it to read only.
  • Check the Apache configurations
  • Try to run this hello world program:
    #!/usr/bin/perl
    print "Content-type: text/html\n\n";
    print "Hello world!\n";

See related PrematureEndOfScriptHeadersError, AttachFailurePrematureEndofScriptHeader, RunawayViewProcesses, TestEnvQuitsAfterUseTwikiPm, PerlScriptErrorAfterInstalling

-- PeterThoeny - 07 Dec 2005

Thanks for the suggestions Peter. In a moment of frustration I opted for an easy installation of TikiWiki - which was never my first choice. I will now work with your suggestions in hopes of yet Twikiing along merrily...Thanks again for the follow-up.

Cheers, Jose

-- JoseAlvarez - 13 Dec 2005

Update: Checked permissions on /bin folder, group permissions are set to 5, read-only for group. This seems OK.

I believe my problem is simply the fact that twiki_httpd.conf cannot be referenced on a hosted server - confirmed the hosting provider will not allow update to httpd.conf to reference twiki_httpd.conf. Therefore, seemingly back to .htaccess configuration. Is there a generic .htaccess configuration that can be utilized for the /twiki tree on my site?

With humble appreciation of your knowledge and time, Jose

-- JoseAlvarez - 13 Dec 2005

Found htaccess.txt in twiki distribution, redirected /twiki/index.html to /twiki/bin/view... now get this msg from address bar: Not Found The requested URL /twiki/bin/view was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache/1.3.34 Server at www.synapse-technology.com Port 80

-- JoseAlvarez - 13 Dec 2005

Just guessing: If it was configure.cgi, maybe you have view.cgi as well? Some hosters require extensions like that to allow program execution.

About the server configuration: Apache usually checks a file called .htaccess in the directory of every request, or in one of the parent directories. The syntax in .htaccess is identical to that of httpd.conf.

Which directives are allowed in your local /home/jalvarez/public_html/twiki/.htaccess is a matter of what your provider allows, but this may still be different from "allowing update to httpd.conf".

It could be helpful if you post your .htaccess as well. From the first line of your error report "Invalid command '/home/jalvarez/public_html/twiki'" it looks like a syntax error in your configuration.

-- HaraldJoerg - 13 Dec 2005

Okay...some time has passed, but we are still very interested in conquering the Twiki install (test-run other wikis, but we want yours!). This install is on a hosted server, our Twiki is [partially] installed at http://synapse-technology.com/twiki ... sincere thanks for reviewing this for us!

I still can't get the configure script to run. I tried editing the supplied .htaccess (the one to be placed in the twiki/bin folder), but am not sure if the strings are supplied by "configure", or if I need to add them to the /twiki/bin/.htaccess file myself. I got a message requesting login with my wiki name? Just guessing here, I added a camelcase name, JoseAlvarez, to the section in the /twiki/bin/.htaccess that specifies names allowed to run configure, then get this message:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@synapse-technologyPLEASENOSPAM.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache/1.3.34 Server at www.synapse-technology.com Port 80

I am including the contents of .htaccess files and Twiki config files below.

FILE CONTENTS: .htaccess for /twiki directory...

# Sample Root '.htaccess' file

# Controls access to TWiki 'root' directory (parent of the 'bin' directory)
# - rename this file to '.htaccess' to have Apache use it.

# Turn off directory indexing in this and sub directories
Options -Indexes

# Redirect any access to 'index.html' to the 'view' script (i.e. Main.WebHome)
# Disabled by default - uncomment if required, will hide the real index.html.
#
# The first path here must be a URL path, not a file pathname
Redirect /urlpath/to/twiki/index.html http://synapse-technology.com/twiki/bin/view

FILE CONTENTS:

.htaccess for /twiki/pub directory...

# Sample '.htaccess' file for 'pub' subdirectory

# Controls access to TWiki 'pub' subdirectory - copy this into 'pub', 
# naming it '.htaccess', to have Apache use it.

# This is useful if you install TWiki on a web host, or an intranet host
# where you can't edit the Apache http.conf file.  If you can edit the
# http.conf file, just set the 'Allow from all' there (or locate these
# directories outside the Web-visible directory tree.)

# Allow all access
Allow from all

# Deny people from looking at the index
# Bare in mind that this is largely inadequate
# See http://twiki.org/cgi-bin/view/Codev/SecuringAttachments
# and http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item610
# If you think you have a solution it is in your best interests to share it 
# so others can test your idea.
options -Indexes

FILE CONTENTS: .htaccess in bin folder...

# bin/.htaccess.txt
#
# Controls access to TWiki scripts - to make Apache use it, rename this
# file to '.htaccess' and REPLACE THE FOLLOWING STRINGS WITH PATHS
# SPECIFIC TO YOUR INSTALLATION. Most required values can be seen in the
# Path Settings section of =configure=.
#
# {DataDir}
#    Get the value from =configure=
# {DefaultUrlHost}
#    Get the value from =configure=
# {ScriptUrlPath}
#    Get the value from =configure=
# {Administrators}
#    Space-separated list of the login name(s) of the person(s) allowed
#    to run the configure script

JoseAlvarez

# Use CGI & Perl to handle all files in 'bin' directory, i.e. run as scripts
# - this should remove the need to rename files to end in '.pl' etc,
# if your web hosting provider permits this.  Remove if using mod_perl.
SetHandler cgi-script

# Password file for TWiki users
#

# Authentication type (htpasswd file) (comment out this if you configure htpasswd / LDAP support)
AuthUserFile {DataDir}/.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

#for htdigest password suport uncomment the following
#AuthDigestDomain {DefaultUrlHost}{ScriptUrlPath}/viewauth {DefaultUrlHost}{ScriptUrlPath}/edit {DefaultUrlHost}{ScriptUrlPath}/preview {DefaultUrlHost}{ScriptUrlPath}/save {DefaultUrlHost}{ScriptUrlPath}/attach {DefaultUrlHost}{ScriptUrlPath}/upload {DefaultUrlHost}{ScriptUrlPath}/rename {DefaultUrlHost}{ScriptUrlPath}/manage {DefaultUrlHost}{ScriptUrlPath}/installpasswd {DefaultUrlHost}{ScriptUrlPath}/passwd
#AuthDigestFile {DataDir}/.htdigest
# For "Digest" authentication to work properly, this string must match
# the value of configuration variable $authRealm
#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 Digest

#for LDAP password support uncomment the following (and fix up the paths)
#AuthLDAPURL ldap://yourldapserver/dc=yourldapserver,dc=com?uid?sub?(objectClass=posixAccount)
#AuthLDAPGroupAttribute memberUid
#AuthLDAPGroupAttributeIsDN off
#<Limit GET POST PUT>
#    require group cn=mygroup,ou=groups,dc=yourldapserver,dc=com
#</Limit>
#AuthName ByPassword
#AuthType Basic

# File to return on access control error (e.g. wrong password)
# By convention this is the TWikiRegistration page, that allows users
# to register with the TWiki. Apache requires this to be a *local* path.
ErrorDocument 401 {ScriptUrlPath}/view/TWiki/TWikiRegistration

# Turn off directory indexing in this and sub directories
Options -Indexes

<FilesMatch "[^/]*\.html$">
       SetHandler blabla
       allow from all
</FilesMatch>

# configure should be restricted to a small number of users
<FilesMatch "configure.*">
       require user "{Administrators}"
</FilesMatch>

# These are scripts that might change content. The regular expression uses ".*"
# at the end so it matches the scripts even if you had to add a .cgi or .pl
# extension. If you want to require login for any other scripts, modify the
# regular expression below as appropriate.

# NB. The resetpasswd & passwd scripts are used to reset and change passwords.
# They do their own validation of the user and therefore
# should not use "require valid-user"

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

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

FILE CONTENTS: LocalLib.cfg in /twiki/bin directory...

# TWiki Enterprise Collaboration Platform, http://TWiki.org/
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. For
# more details read LICENSE in the root of this distribution.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# LocalLib.cfg: local path settings for TWiki

use vars qw( $twikiLibPath $CPANBASE );

# -------------- Path to lib directory containing TWiki.pm. 
#
# REQUIRED
# The absolute path to the 'lib' directory in your installation..

$twikiLibPath = '/home/jalvarez/public_html/twiki/lib';


# -------------- Extra path components to include in @INC
# OPTIONAL
# If you need to use perl modules that are not installed in the standard
# directories (e.g. you have downloaded extra modules for use with plugins)
# then you can add the absolute paths to those modules below. You can list
# as many directories as you want, separated by commas.

# @localPerlLibPath = ( '/path/to/dir' );

# http://www.perl.com/pub/a/2002/04/10/mod_perl.html?page=3 has good advice
# on installing CPAN modules without superuser privileges.


# -------------- Only needed to work around an Apache 2.0 bug on Unix
# OPTIONAL
# If you are running TWiki on Apache 2.0 on Unix you might experience
# TWiki scripts hanging forever. This is a known Apache 2.0 bug. A fix is 
# available at http://issues.apache.org/bugzilla/show_bug.cgi?id=22030.
# You are recommended to patch your Apache installation.
#
# As a workaround, uncomment ONE of the lines below. As a drawback,
# errors will not be reported to the browser via CGI::Carp any more.

# open(STDERR, ">>/dev/null");      # throw away cgi script errors, or
# open(STDERR, ">>/tmp/error.log"); # redirect errors to a log file


1; # Required for successful module loading

-- JoseAlvarez - 24 Mar 2006

Please don't give up on our installation?

-- JoseAlvarez - 31 Mar 2006

Sorry, but most of your .htaccess files are wrong. Let's start all over.

In twiki/.htaccess, replace the last line by

Redirect /twiki/index.html http://www.synapse-technology.com/twiki/bin/view/

Your twiki/pub/.htaccess looks ok.

For the moment, I'd suggest that you simply rename your twiki/bin/.htaccess to twiki/bin/.htaccess.invalid and start with a new one. We'll try to take one step after the other, starting with the one and only goal to get the configure script running. For that, your twiki/bin/.htaccess should look like the following:

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">
       deny from all
</FilesMatch>

Then open http://www.synapse-technology.com/twiki/bin/configure in your browser, and see what happens. If there's again a "premature end of script headers" you should ask your provider for the complete error log for that request: Usually it contains more information on what exactly went wrong.

If you have shell access, you could go to /home/jalvarez/public_html/twiki/bin and say perl -wc configure to your computer, just to make sure that all CPAN dependencies are there. And perhaps which perl, too, to see whether perl is installed where the shebang line in the configure script.

It is intentionally that nobody can register right now. We'll take that later, or your TWiki will be taken by spammers before you have a change to react.

If the configure script works, have another look at the installation guide http://www.synapse-technology.com/twiki/INSTALL.html!

Good luck!

-- HaraldJoerg - 31 Mar 2006

A sincere thank you for the instructions, Harold Joerg. I will be walking through them carefully - soon - and will post my results. Cheers, Jose.

-- JoseAlvarez - 06 Apr 2006

Hello. Here is the message showing on the server log for each attempt to access configure script:

[Thu Apr 6 04:49:57 2006] [error] [client 67.38.13.168] Premature end of script headers: /home/jalvarez/public_html/cgi-bin/view.cgi [Thu Apr 6 04:49:57 2006] [error] [client 67.38.13.168] File does not exist: /home/jalvarez/public_html/500.shtml Can't locate CGI/Session.pm in @INC (@INC contains: /home/jalvarez/public_html/twiki/lib/CPAN/lib//arch/ /home/jalvarez/public_html/twiki/lib/CPAN/lib//5.8.7/i686-linux/ /home/jalvarez/public_html/twiki/lib/CPAN/lib//5.8.7/ /home/jalvarez/public_html/twiki/lib/CPAN/lib// /home/jalvarez/public_html/twiki/lib . /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl) at (eval 9) line 1.

Thanks again for reviewing this with us.

-- JoseAlvarez - 06 Apr 2006

Now this one is straightforward: Install the CPAN module CGI::Session.

-- HaraldJoerg - 07 Apr 2006

Well, Harald, the techs at the hosting service seem to have installed CGI::Session. It is listed in the Perl listing...the following show:, duplication not understood.

/twiki/bin/configure still does not respond, however. I'll ask for current error logs again to see where the hang is now...

CGI::Session CGI::Session CGI::Session::Driver CGI::Session::Tutorial CGI::Session::Tutorial CGI::Session::Driver::postgresql CGI::Session::Driver::sqlite CGI::Session::Driver::sqlite CGI::Session::Driver::DBI CGI::Session::Driver::file CGI::Session::Driver::file CGI::Session::ID::static CGI::Session::ID::md5 CGI::Session::ID::md5 CGI::Session::Serialize::freezethaw CGI::Session::Serialize::yaml CGI::Session::Serialize::yaml CGI::Session::Serialize::default CGI::Session::Test::Default CGI::Session::Test::Default

-- JoseAlvarez - 08 Apr 2006

Current server log is below. Once again, many thanks...

Can't locate CGI/Session.pm in @INC (@INC contains: /home/jalvarez/public_html/twiki/lib/CPAN/lib//arch/ /home/jalvarez/public_html/twiki/lib/CPAN/lib//5.8.7/i686-linux/ /home/jalvarez/public_html/twiki/lib/CPAN/lib//5.8.7/ /home/jalvarez/public_html/twiki/lib/CPAN/lib// /home/jalvarez/public_html/twiki/lib . /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl) at (eval 9) line 1. [Thu Apr 6 04:49:59 2006] [error] [client 67.38.13.168] Premature end of script headers: /home/jalvarez/public_html/cgi-bin/view.cgi [Thu Apr 6 04:49:59 2006] [error] [client 67.38.13.168] File does not exist: /home/jalvarez/public_html/500.shtml

-- JoseAlvarez - 11 Apr 2006

Hmm.... There are a couple of things which don't fit together.

The excerpt from the error log is from a view request and not from configure. configure doesn't need CGI::Session.

The view executable seems to be located in /home/jalvarez/public_html/cgi-bin/view.cgi. Is this the correct destination? The rest of the files seem to be located at /home/jalvarez/public_html/twiki/, and you mentioned /home/jalvarez/public_html/twiki/bin/configure.cgi above.

Anyway: I guessed that a possible URL for your configure script would be http://www.synapse-technology.com/cgi-bin/configure.cgi and indeed, this doesn't hang. The error message it produces is, however, strange:

Couldn't read TWiki locales/ directory! at configure.cgi line 1072.

Honestly, this looks as if the script at your installation is broken. Even if configure can't find the locales dir, it would not croak, and display the message in its regular output, and it would read

Couldn't read TWiki {LocalesDir}!

Maybe there's still a mixture of Cairo and Dakar in your configuration files? Or that you edited scripts instead of config files?

-- HaraldJoerg - 11 Apr 2006

Perhaps I will backup the files I have edited with your help, then delete the installation, and re-install from fresh distribution package...to eliminate possibility of additional errors along the way. Harald, my sincere thanks to you for continuing to work through this with me...I'll get back to you.

Cheers.

-- JoseAlvarez - 13 Apr 2006

At one point, in my early efforts to comprehend how twiki worked, I placed a copy of the /bin folder directly under /public_html. I have just sent another email to the server techs, asking them what needs to be done to make /home/jalvarez/public_html/twiki/bin a valid location for CGI scripts...

I found an old reference to the incorrectly placed copy of the bin folder in /twiki/bin/setlib.cfg. I had lost track of that after reading that locallib.cfg overrides it! Will respond further after reply from hosting tech. Jose

-- JoseAlvarez - 14 Apr 2006

Hello Harald. I retained the two .cfg files from /bin and /lib, deleted the rest of the installation, and uploaded files from the latest package 4.0.1. Uploaded /bin/LocalLib.cfg and /pub/LocalSite.cfg.

Still no configure script, fresh error log forthcoming.

As always, thanks for staying with me on this. Jose

-- JoseAlvarez - 15 Apr 2006

I have a configuration screen! Yes! I'll let you know if I hit another snag. Three cheers for Harald Joerg!!!

Jose

-- JoseAlvarez - 15 Apr 2006

Sometimes persistence pays off smile

Congratulations!

-- HaraldJoerg - 15 Apr 2006

It is really nice seeing people help each other. This is true open source spirit! Thank you Harald.

-- PeterThoeny - 16 Apr 2006

Yes, thank you both for the friendly and knowledgeable assistance you have provided us. There is much to learn, but with kind souls in our midst good things happen.

Truth is, now I'm stuck with a registration screen that won't let me register my first user - the one to become admin...so I can't yet edit any pages...reading documentation to see if I can figure it out...

-- JoseAlvarez - 16 Apr 2006

Hi

I have configured the TWiki in my server ( shared hosting server - godaddy )

http://theonline.in/twiki/bin/view/ ---- > there is no view folder in the bin directory.

Please help me to proceed further.

Regards Arun Balaji

-- Arun Balaji - 2013-07-29

Arun, please do not cross-post questions. This is a cross-post of SID-01770.

-- Peter Thoeny - 2013-07-29

Edit | Attach | Watch | Print version | History: r25 < r24 < r23 < r22 < r21 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r25 - 2013-07-29 - 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.