Tags:
create new tag
view all tags

Question

In the standard Wikis that come with the installation kit, there are a number of references to $PUBURL$, which is different than $PUBURLPATH$. It seems to be the path used for the TWiki logo and other graphics. Yet instead of it looking like:

    http://www.mydomain.com/my_account/cgi-bin/twiki/pub

it comes out as:

    http://www.mydomain.comhttp://www.mydomain.com/my_account/cgi-bin/twiki/pub

when I show it on the Twiki.TWikiVariables topic.

It's even mentioned in the TWiki.cfg file as something to be defined:

#       %PUBURL%         public URL (root of attachment URL)

Yet it's not actually defined there, so far as I can see.

The testenv script doesn't display it, and if I add code to display it, it says it's undefined. My other variables, as shown in testenv, look good.

Any suggestions on why it would be coming out messed up this way? frown

  • TWiki version: 01 Dec 2001
  • Web server:Apache/1.3.6 (Unix) mod_perl/1.20
  • Server OS:
  • Web browser: MS IE 5.5
  • Client OS: Windows 2000 Pro

-- StewStryker - 12 Jul 2002

From Peter's answer I see that I originally messed up the TWiki.cfg, where I had set:

#                   %PUBURLPATH% : Public data path of TWiki URL (root of attachments) :
$pubUrlPath       = "http://www.mydomain.com/~myaccount/cgi-bin/twiki/pub";

instead of as it should be:

$pubUrlPath       = "/~myaccount/cgi-bin/twiki/pub";

Thanks to Peter!

-- StewStryker - 14 Jul 2002

Answer

%PUBURL% and %PUBURLPATH% get expanded in TWiki.pm:

    $_[0] =~ s/%PUBURL%/$urlHost$pubUrlPath/go;
    $_[0] =~ s/%PUBURLPATH%/$pubUrlPath/go;

Check your $pubUrlPath setting in TWiki.cfg

-- PeterThoeny - 13 Jul 2002

This is quite helpful to me (as a lurker), but something would be more helpful to me -- a nice clear, concise statement (one sentence??) of how to specify these locations given a specific location of Apache, TWiki, and whatever else is relevant. (IIRC, some of these things must be specified in relation to the location of the Apache "home directory" (or something like that), and that probably changes if you use a virtual web server. It's something I'll attempt again next time I try to install TWiki, but it's something I never did quite figure out -- I just eventually got lucky. (Unfortunately, my question is probably not as clear as it needs to be.)

-- RandyKramer - 13 Jul 2002

In our Feb 2003 release TWiki installation, on an Apache server, while tackling the problem discussed above, I stumbled upon the fact that the "PreviewBackground image" in our TwikiPreferences was not being rendered, while the other images (or rather attachments in the /pub/) were getting rendered.

Playing around with the script in TWiki.pm, I found that (i) taking out $urlHost from the %PUBURL% and %ATTACHURL% , and (ii) retaining the entire url path in the $pubUrlPath allowed all images/attachments to be rendered without any problems

i.e.

TWiki.pm

    $_[0] =~ s/%PUBURL%/$pubUrlPath/g;
#    $_[0] =~ s/%PUBURL%/$urlHost$pubUrlPath/g;       
    $_[0] =~ s/%PUBURLPATH%/$pubUrlPath/g;
    $_[0] =~ s/%ATTACHURL%/$pubUrlPath\/$_[2]\/$_[1]/g;
#    $_[0] =~ s/%ATTACHURL%/$urlHost$pubUrlPath\/$_[2]\/$_[1]/g;
    $_[0] =~ s/%ATTACHURLPATH%/$pubUrlPath\/$_[2]\/$_[1]/g;

and

TWiki.cfg

$pubUrlPath       = "http://twiki.aidindia.org/pub";

Am I opening up a bigger problem with this fix? Any input would be greatly appreciated.

thanx, guru.

-- DwijiGuru - 06 Dec 2004

That is an incorrect configuration, do not remove the $urlHost. Set your $pubUrlPath to "/pub", and you should be fine.

-- PeterThoeny - 06 Dec 2004

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2004-12-06 - 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.