Tags:
create new tag
, view all tags

SID-00831: /bin/configure shows up as plain text in browser...

Status: Answered Answered TWiki version: 4.3.2 Perl version: Perl 5.8.8
Category: CategoryInstallation Server OS: CentOS 5.4 kernel 2.6.18-164.el5 Last update: 2 years ago

I'm evaluating TWiki as a small business corporate wiki. I'm going through the basic installation of it.

I'm running the latest version of TWiki on a CentOS 5.4 w/ Apache.

I have TWiki here:

http://twiki.mydomain.com/

The "Welcome to Twiki" page comes up just fine. When I click on "Configure TWiki", it brings up

http://twiki.mydomani.com/bin/configure

Except its just showing the (perl?) script in plain text in my browser window. I assume this should be executing instead of just displaying in the browser?

My perl is default /usr/bin/perl

And I set my absolute path to TWiki in the LocalLib.cfg and file permissions for all files and folders is apache:apache.

What am I missing?

-- JakeEWilson - 2010-05-10

Discussion and Answer

Well I figured out that I needed to make some changes to my httpd conf file. Here are the changes:

<VirtualHost *:80>
	ServerAdmin webmaster@mydomain.com
	DocumentRoot /var/www/twiki.mydomain.com
	ServerName twiki.mydomain.com
	ErrorLog logs/twiki.mydomain.com-error_log
	CustomLog logs/twiki.mydomain.com-access_log common

	<Directory "/var/www/twiki.mydomain.com/bin">
		AllowOverride None
		Order Allow,Deny
		Allow from all
		Deny from env=blockAccess

		Options ExecCGI FollowSymLinks
		SetHandler cgi-script

		# Password file for TWiki users
		AuthUserFile /var/www/twiki.mydomain.com/data/.htpasswd
		AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith)'
		AuthType Basic

		# File to return on access control error (e.g. wrong password)
		ErrorDocument 401 /twiki/bin/view/TWiki/TWikiRegistration

		# Limit access to configure to specific IP addresses and or users.
		# Make sure configure is not open to the general public.
		# It exposes system details that can help attackers.
		<FilesMatch "^(configure)$">
			SetHandler cgi-script
			Order Deny,Allow
			Allow from all
		</FilesMatch>

		# Enable mod_perl for the bin scripts listed
		<IfModule mod_perl.c>
			<FilesMatch \"(attach|edit|manage|rename|save|upload|view|rest|.*auth).*\">
				SetHandler perl-script
				PerlResponseHandler ModPerl::Registry
				PerlSendHeader On
				PerlOptions +ParseHeaders
			</FilesMatch>
		</IfModule>
	</Directory>
</VirtualHost>

I also used the conf generator to create a mod_perl_startup.pl for me. Now, when i try to access /bin/configure the web browser just hangs. Apache logs eventually tell me this:

[Mon May 10 14:47:26 2010] [warn] [client 10.20.0.141] Timeout waiting for output from CGI script /var/www/twiki.mydomain.com/bin/configure, referer: http://twiki.mydomain.com/
[Mon May 10 14:47:26 2010] [error] [client 10.20.0.141] Premature end of script headers: configure, referer: http://twiki.mydomain.com/

Now what do I do? This software sure isn't easy to install.

-- JakeEWilson - 2010-05-10

That is an issue with the TWiki configuration on Apache: The twiki/bin directory seems to be configured as an html directory, it needs to be configured as a CGI directory. You don't need/want mod_perl unless you have thousands of users. Use ApacheConfigGenerator.

-- PeterThoeny - 2010-05-10

Try commenting out the mod_perl preloading lines at the top of the autogenerated conf file and restart apache.

Also the default for perl on CENTOS 5 is /usr/bin ?

-- MatWitts - 2010-06-04

On RHEL5 I had similar problem. I could not figure out a solution. Finally I moved configure to configure.cgi and also in the twiki.conf I change the 192.168.xx.xx address to my ip address and it worked. I was doing it from localhost so I thought this should not matter, but I was trying it as http://twiki/twiki/bin/configure and my hostname has an alias/cname of twiki. Hope this helps.

-- VijayChaugule - 2011-03-27

i tried all of this and none of it worked... i cannot seem to get the configure to execute and apache just displays the script as text on the page... ive even since tried "yum install"'ing mod_perl and reinstalling apache.

can someone please post httpd.conf, twiki.conf files and details on the actual commands they ran for comparison?

is there any way to execute the configure script from the command line to do the same task?

what if i am running this on a text based system without lynx? how am i suppose to access the page if dns is not setup yet. i did not read that any of this is expected by twiki...

-- DanielOlive - 2012-06-18

Daniel, the ApacheConfigGenerator produces a twiki.conf file you can directly use without modifications. Make sure you restart apache after each .conf file update.

-- PeterThoeny - 2012-06-19

I was having the exact same problem. The guide says explicitly that with Cent you won't have to add a ".pl" extension to any of the scripts. I added .pl to the configure script and it works! On to the next step. This thing is ridiculously difficult to install. What give?!

-- WisamAbdulla - 2012-08-14

Wisam, I am not sure why you had to add an extension to the configure script on Cent(OS?). I installed TWiki many times on CentOS. Did you have other installation issues? If so best to open a new question with details.

-- PeterThoeny - 2012-08-15

I agree with each and everyone of the users who are getting frustrated which should be a simple install and ends up taking the weekend and still no sign of solution. I followed each and every line to the T. Installed the modules from CPAN and still no luck the twiki install guide is sooo confusing. All it took was 4 days of research to figure out that I did not have CGI enabled and a simple "sudo a2enmod cgi" did the trick. Please update your install guide.

-- Masood Beiki - 2014-02-25

Masood, thank you for your feedback. I invite you to update the docs directly, TWiki.org is a wiki after all. If you do, please specify what platform this applies to.

-- Peter Thoeny - 2014-02-25

A full day of this. I'm extremely tempted to move to MediaWiki; it doesn't do any good if you have a better product if no one can use it! I've had nothing but problems installing this with a combination of all of the above user comments. Best of luck fixing the errors.

-- Matthew Bennett - 2014-03-07

What is the status, Matthew? If you give specific error messages we can help.

-- Peter Thoeny - 2014-03-07

We had the host enable virtual host configuration file for it; we've enabled the bin file as CGI in apache and pub as non-script file; we've made sure the paths are correct in the generated file; and now it makes the browser open it as a file (basically the script/text) in notepad. We are working with the host to see what else needs to be done to change the server settings; we are working with a sub-domain which might be the cause of the pathway but I'm not sure. I don't want to move the folders around as we've come so far in this pathway already.

Thanks, Matthew.

-- Matthew Bennett - 2014-03-07

Hi Everyone,

Our host was able to help install the software and configure it. I must say Rack Space is awesome! They've gone above and beyond anything imaginable.... meaning don't expect that type of "free" service all the time if you choose to go with them. That being said, we are still getting used to the interface and how it works.

There was A LOT of customization behind the scenes as we are treating this as a private intranet. I suppose this will come along with time of learning the program.

I had one error when selecting edit on any page:

"TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.

Can't locate HTMLpath in @INC (@INC contains: path . path path path path path path path path path path-linux-gnu-thread-multi path path)"

I also had an error when trying to create a back-up:

"ERROR: Can't create backup twiki-backup-2014-03-10-23-27.zip. [Mon Mar 10 23:27:28 2014] backuprestore: Can't exec "/usr/bin/zip": No such file or directory at ....... "/twiki/lib/TWiki/Plugins/BackupRestorePlugin/CaptureOutput.pm" line 89.

ERROR: Can't create backup twiki-backup-2014-03-10-23-27.zip. [Mon Mar 10 23:27:28 2014] backuprestore: Can't exec "/usr/bin/zip": No such file or directory at ......... "/twiki/lib/TWiki/Plugins/BackupRestorePlugin/CaptureOutput.pm" line 89.

If anyone can be of help to use here we would appreciate it. Also, if anyone knows any good business or academic skins we are up for suggestions.

Thanks again! Matthew.

-- Matthew Bennett - 2014-03-11

On the internal error check the apache error log.

On the backup error, make sure the zip utility is available. In case it is not in the default location you can configure it with the $TWiki::cfg{Plugins}{BackupRestorePlugin}{...ZipCmd} settings.

-- Peter Thoeny - 2014-03-11

OK. The Zip Utility wasn't installed on the server by default. Our support team was able to handle the rest.

-- Matthew Bennett - 2014-03-12

The HTML edit error was due to not having one of the modules:

"The following are requred modules for that plugin [ From: http://www.twiki.org/cgi-bin/view/TWiki/TWikiInstallationGuide#Required_CPAN_Modules ]: HTML::Parser >=3.28 Needed by the WysiwygPlugin for WYSIWYG editing HTML::Entities >=1.25 Needed by the WysiwygPlugin for WYSIWYG editing

You already had [ HTML::Entities ] installed, however, [ HTML::Parser ] was missing.

I did an initial CPAN config (needed only once) and accepted all the defaults with the command: [root@jimijobs-east]# perl -MCPAN -e shell

I then installed the [ HTML::Parser ] module with the following command: [root@jimijobs-east]# perl -MCPAN -e 'install HTML::Parser'"

I can tell you write now that I would not recommend this system as integration, not because lack of support but because installation tells volumes about how the program works. I will try it out because the idea is great but you need a community to support it not one or two people. It will get too large and support will fall behind. If your market is towards education and business enterprise I would say use at your own risk in bold.

-- Matthew Bennett - 2014-03-12

right now that is...

-- Matthew Bennett - 2014-03-12

Well, if you want support from the community, there are plenty of TWiki consultants. smile

-- Peter Thoeny - 2014-03-12

when i installed twiki with nginx, /bin/configure pop download window, after i did some configure , i got 502 bad gateway, finally, i followed this https://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-centos-6.0-p2

    root /var/www/html/twiki;

    #access_log  /var/log/nginx/twiki.example.com.access.log  main;

    #index index.html;

    location / {
      deny all;

      location /pub {
        allow all;
      }

      location ~^/bin/configure {
        allow all;
        fastcgi_pass   unix:/var/run/fcgiwrap.socket;
        fastcgi_split_path_info  ^(/bin/[^/]+)(/.*)$;
        include        fastcgi_params;
        fastcgi_param  PATH_INFO        $fastcgi_path_info;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
      }

      location /bin {
        allow all;
        fastcgi_pass   unix:/var/run/fcgiwrap.socket;
        fastcgi_split_path_info  ^(/twiki/bin/[^/]+)(/.*)$;
        include        fastcgi_params;
        fastcgi_param  PATH_INFO        $fastcgi_path_info;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
      }
    }

ps : sorry my english is poor

-- fang xing - 2015-11-07

Thank you for the comment, Fang. Maybe better to describe this at TWikiOnNginx.

-- Peter Thoeny - 2015-11-09

      Change status to:
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.
SupportForm
Status Answered
Title /bin/configure shows up as plain text in browser...
SupportCategory CategoryInstallation
TWiki version 4.3.2
Server OS CentOS 5.4 kernel 2.6.18-164.el5
Web server Apache/2.2.3
Perl version Perl 5.8.8
Browser & version

Edit | Attach | Watch | Print version | History: r21 < r20 < r19 < r18 < r17 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r21 - 2015-11-09 - 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.