Question
Neither the wikiHome.gif image in testenv nor the robot image from
TWikiLogos is rendering.
I have read the 3 or 4 existing topics on images not rendering, but the syntax errors they mention do not exist in my version.
Apache appears to be wanting to treat files in these directories as CGIs, but I cannot understand why.
The error in the Apache error_log is:
[Mon Aug 09 13:26:44 2004] [error] [client 127.0.0.1] Options ExecCGI is off in this directory: /home/httpd/twiki/pub/wikiHome.gif, referer: http://localhost/twiki/bin/testenv
Some permissions stuff:
[root@ftgme2 ftg]# cd /home
[root@ftgme2 home]# ls -ld httpd
drwxr-xr-x 3 apache apache 4096 Aug 2 19:50 httpd/
[root@ftgme2 home]# cd httpd
[root@ftgme2 httpd]# ls -l
total 4
drwxrwxr-x 7 apache apache 4096 Aug 4 12:11 twiki/
[root@ftgme2 httpd]# cd twiki
[root@ftgme2 twiki]# ls -l
total 564
-rwxr-xr-x 1 apache apache 625 Aug 5 21:09 99_twiki.conf*
drwxrwxr-x 2 apache apache 4096 Aug 9 09:16 bin/
drwxr-xr-x 8 apache apache 4096 Aug 9 13:33 data/
-rwxr-xr-x 1 apache apache 782 Jan 4 2003 index.html*
-rwxr-xr-x 1 apache apache 212 Aug 4 12:20 install.sh*
drwxr-xr-x 4 apache apache 4096 Dec 11 2002 lib/
-rwxr-xr-x 1 apache apache 19440 Feb 1 2003 license.txt*
drwxr-xr-x 8 apache apache 4096 Aug 9 13:33 pub/
-rwxr-xr-x 1 apache apache 4334 Feb 1 2003 readme.txt*
drwxr-xr-x 2 apache apache 4096 Aug 9 13:33 templates/
-rwxr-xr-x 1 apache apache 453477 Feb 1 2003 TWikiDocumentation.html*
-rwxr-xr-x 1 apache apache 52417 Feb 1 2003 TWikiHistory.html*
[root@ftgme2 twiki]# cd pub
[root@ftgme2 pub]# ls -l
total 32
-rw-r--r-- 1 apache apache 1078 Jan 14 2000 favicon.ico
drw-r--r-- 2 apache apache 4096 Feb 1 2003 icn/
drw-r--r-- 3 apache apache 4096 Nov 18 2002 Know/
drw-r--r-- 2 apache apache 4096 Apr 7 2002 Main/
drw-r--r-- 2 apache apache 4096 Apr 21 2002 Sandbox/
drw-r--r-- 2 apache apache 4096 Dec 4 2001 Trash/
drw-r--r-- 8 apache apache 4096 Nov 18 2002 TWiki/
-rw-r--r-- 1 apache apache 2877 Jun 8 1999 wikiHome.gif
[root@ftgme2 pub]#
The perl script mentioned in the install docs was run to change "nobody:" to "apache:".
Here are the httpd.conf additions, added by means of a 99_twiki.conf file in /etc/httpd/conf.d:
ScriptAlias /twiki/bin/ "/home/httpd/twiki/bin/"
ScriptAlias /wiki "/home/httpd/twiki/bin/view"
Alias /twiki/ "/home/httpd/twiki/"
<Directory "/home/httpd/twiki/bin">
Options +ExecCGI
SetHandler cgi-script
Allow from all
AllowOverride All
</Directory>
<Directory "/home/httpd/twiki">
Options +ExecCGI
SetHandler cgi-script
Allow from all
</Directory>
<Directory "/home/httpd/twiki/pub">
Options FollowSymLinks +Includes
AllowOverride None
Allow from all
</Directory>
<Directory "/home/httpd/twiki/data">
deny from all
</Directory>
<Directory "/home/httpd/twiki/templates">
deny from all
</Directory>
The TWiki.cfg is the distribution one with the hostname changed to mine.
Here is the .htaccess file from twiki/bin:
# bin/.htaccess.txt
#
# Controls access to TWiki scripts - rename this to '.htaccess' to make
# Apache use it.
# 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
#
# The path here must be a system file pathname, not a URL - first part should
# match the $dataDir setting in TWiki.cfg
AuthUserFile /home/httpd/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
# File to return on access control error (e.g. wrong password)
# The path here must be a URL path, not a file pathname - first part should
# match the $scriptUrlPath in TWiki.cfg
ErrorDocument 401 /twiki/bin/oops/TWiki/TWikiRegistration?template=oopsauth
<Files ~ "[^/]*\.html$">
SetHandler blabla
allow from all
</Files>
<Files "viewauth">
require valid-user
</Files>
<Files "edit">
require valid-user
</Files>
<Files "preview">
require valid-user
</Files>
<Files "save">
require valid-user
</Files>
<Files "attach">
require valid-user
</Files>
<Files "upload">
require valid-user
</Files>
<Files "rename">
require valid-user
</Files>
<Files "manage">
require valid-user
</Files>
<Files "installpasswd">
require valid-user
</Files>
<Files "*">
allow from all
</Files>
Here is the output of the CVS version of testenv:
Test the environment for TWiki
Please read the TWikiInstallationNotes for more information on TWiki installation.
Environment variables:
DOCUMENT_ROOT /var/www/html
GATEWAY_INTERFACE CGI/1.1
HTTP_ACCEPT text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_ACCEPT_ENCODING gzip,deflate
HTTP_ACCEPT_LANGUAGE en-us,en-gb;q=0.8,en;q=0.5,fr;q=0.3
HTTP_CACHE_CONTROL max-age=0
HTTP_CONNECTION keep-alive
HTTP_HOST localhost
HTTP_KEEP_ALIVE 300
HTTP_USER_AGENT Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040708
PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
QUERY_STRING
REMOTE_ADDR 127.0.0.1
REMOTE_PORT 35482
REQUEST_METHOD GET
REQUEST_URI /twiki/bin/testenv
SCRIPT_FILENAME /home/httpd/twiki/bin/testenv
SCRIPT_NAME /twiki/bin/testenv
SCRIPT_URI http://ftgme2.selectbs.com/twiki/bin/testenv
SCRIPT_URL /twiki/bin/testenv
SERVER_ADDR 127.0.0.1
SERVER_ADMIN root@localhost
SERVER_NAME ftgme2.selectbs.com
SERVER_PORT 80
SERVER_PROTOCOL HTTP/1.1
SERVER_SIGNATURE
Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/3mdk) mod_perl/1.99_14 Perl/v5.8.5 auth_mysql/1.11 mod_auth_pgsql/2.0.2b1 auth_radius/1.7PR1 mod_layout/4.0.1a mod_ssl/2.0.50 OpenSSL/0.9.7d DAV/2 PHP/4.3.8 mod_auth_remote/0.1 mod_auth_shadow/2.0 Server at ftgme2.selectbs.com Port 80
SERVER_SOFTWARE Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/3mdk) mod_perl/1.99_14 Perl/v5.8.5 auth_mysql/1.11 mod_auth_pgsql/2.0.2b1 auth_radius/1.7PR1 mod_layout/4.0.1a mod_ssl/2.0.50 OpenSSL/0.9.7d DAV/2 PHP/4.3.8 mod_auth_remote/0.1 mod_auth_shadow/2.0
CGI Setup:
Operating system: Unix (linux)
Perl version: 5.8.5
@INC library path: ../lib
/usr/lib/perl5/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.1
/usr/lib/perl5/vendor_perl
.
Note: This is the Perl library path, used to load TWiki modules, third-party modules used by some plugins, and Perl built-in modules.
TWiki module in @INC path:
OK, TWiki.pm found (TWiki version: 01 Feb 2003)
Required Perl modules:
CGI (3.05)
CGI::Carp (1.28)
File::Copy (2.08)
File::Spec (0.87)
FileHandle (2.01)
Optional Perl modules:
Algorithm::Diff (1.01)
MIME::Base64 (3.01)
POSIX (1.08)
Encode (2.01)
Note: Optional module 'Unicode::MapUTF8' not installed - check TWiki documentation to see if your configuration needs this module.
Note: Optional module 'Unicode::Map' not installed - check TWiki documentation to see if your configuration needs this module.
Note: Optional module 'Unicode::Map8' not installed - check TWiki documentation to see if your configuration needs this module.
Note: Optional module 'Jcode' not installed - check TWiki documentation to see if your configuration needs this module.
Digest::MD5 (2.33)
Digest::SHA1 (2.10)
MIME::Base64 (3.01)
Net::SMTP (2.29)
PATH_INFO:
Note: For a URL such as http://localhost/twiki/bin/testenv/foo/bar, the correct PATH_INFO is /foo/bar, without any prefixed path components. Test this now - particularly if you are using mod_perl, Apache or IIS, or are using a web hosting provider. The page resulting from the test link should have a PATH_INFO of /foo/bar.
mod_perl: Not used for this script (mod_perl loaded into Apache)
User: apache
Note: Your CGI scripts are executing as this user.
Warning: Since your CGI script is not running as user nobody, you need to change the locks in the *,v RCS files of the TWiki distribution from nobody to apache. Otherwise, changes to topics will not be logged by RCS.
Group(s): apache apache
Test of TWiki.cfg Configuration:
$defaultUrlHost: http://ftgme2.selectbs.com
Note: This must match the protocol and host part (with optional port number) of the TWiki URL.
Warning: This does not match HTTP_HOST
$scriptUrlPath: /twiki/bin
Note: This must match the 'cgi-bin' part of the URL used to access the TWiki cgi-bin directory.
$pubUrlPath: /twiki/pub
Note: This must be the URL of the public directory.This is not set correctly if the /twiki/pub/wikiHome.gif image below is broken:
$pubDir: /home/httpd/twiki/pub
Note: This is the public directory, as seen from the file system. It must correspond to $pubUrlPath.
$templateDir: /home/httpd/twiki/templates
Note: This is the TWiki template directory, as seen from the file system.
Warning: Security issue: This directory should not be writable by the apache user.
$dataDir: /home/httpd/twiki/data
Note: This is the data directory where TWiki stores all topics.
$mailProgram: /usr/sbin/sendmail -t -oi -oeq
Note: This is the mail program TWiki uses to send mail.
$rcsDir: /usr/bin
Note: This is the directory where RCS is located.
RCS Version: 5.7
Note: This is the version of RCS which will be used.
$lsCmd: /bin/ls
Note: This is the file list program TWiki uses to list topics.
$egrepCmd: /bin/egrep
Note: This is a program TWiki uses for search.
$fgrepCmd: /bin/fgrep
Note: This is a program TWiki uses for search.
$safeEnvPath: /bin:/usr/bin
Note: This is used to initialise the PATH variable, and is used to run the 'diff' program used by RCS, as well as to run shell programs such as Bourne shell or 'bash'.
Path and Shell Environment
Original PATH: /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
Note: This is the PATH value passed in from the web server to this script - it is reset by TWiki scripts to the PATH below, and is provided here for comparison purposes only.
Current PATH: /bin:/usr/bin
Note: This is the actual PATH setting that will be used by Perl to run programs. It is normally identical to $safeEnvPath, unless that variable is empty.
diff: GNU diff was found on the PATH - this is the recommended diff tool.
Note: The 'diff' command is used by RCS to compare files.
Environment
| TWiki version: |
01 Feb 2003 |
| TWiki plugins: |
as distributed |
| Server OS: |
Mandrake Linux 10.0 |
| Web server: |
Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/3mdk) mod_perl/1.99_14 |
| Perl version: |
5.8.5 |
| Client OS: |
Mandrake Linux 10.0 |
| Web Browser: |
Mozilla 1.7 |
--
FrankGriffin - 09 Aug 2004
Follow-up
Can you type in the url path to the wikiHome.gif image in the browser and see it? Do you get the same error?
I'm not sure why you have:
<Directory "/home/httpd/twiki">
Options +ExecCGI
SetHandler cgi-script
Allow from all
</Directory>
in your httpd.conf. This should not be required, and may well be causing the problem (setting handler type cgi-script in the pub directory).
--
CrawfordCurrie - 14 Aug 2004
Answer