SID-02157: Styles and images missing after install
| Status: |
Answered |
TWiki version: |
6.0.2 |
Perl version: |
5.18.2 |
| Category: |
CategoryInstallation |
Server OS: |
Ubuntu 14 |
Last update: |
7 years ago |
Just installed TWiki 6.0.2 on Ubuntu 14 LTS. After the installation, I notice that images such as those on the banner menu are not being loaded. This seems to be the same problem as
http://twiki.org/cgi-bin/view/Support/SID-01478
, but the solutions there did not help.
The webserver user has appropriate permissions to all files in the
/var/www/twiki subdirectory.
My Alias (
/etc/apache2/conf-enabled/twiki.conf) is
Alias /pub/TWiki "/var/www/twiki/pub/TWiki"
My Pub config settings (
.../twiki/lib/LocalSite.cfg) are
$TWiki::cfg{PubUrlPath} = '/<ProjectName>';
$TWiki::cfg{PubDir} = '/var/www/twiki/pub';
where
<ProjectName> is the name of our project that I specified during installation in order to abbreviate URLs. The answer that I linked to above indicates that the Alias must match
{PubUrlPath}, but changing
{PubUrlPath} to
/pub/TWiki generates a configuration complaint that "I was expecting <ProjectName>." If I instead change the Alias to
<ProjectName>, nothing happens. The front page still fails to load styles and images.
I've tried various combinations of Alias,
{PubUrlPath} and
{PubDir}, but nothing fixes the problem.
--
TWiki Guest - 2016-02-23
Discussion and Answer
Let me explain what the directives in the config files do:
-
Alias /pub/TWiki "/var/www/twiki/pub/TWiki" maps URLs beginning with /pub/TWiki to files in /var/www/twiki/pub/TWiki. This is strange because it only maps URLs from the TWiki web. I'd expect something like Alias /pub "/var/www/twiki/pub". Have you used the TWiki/ApacheConfigGenerator or did you create the config file per hand?
- Entries in the apache error log under
/var/log/apache2/error.log should tell you under which path Apache was looking for the files and which type of error occurred, you can check with your installation.
- I am surprised that you have the config file under
/etc/apache2/conf-enabled because /etc/apache2/sites-enabled is the usual path for apache services.
-
$TWiki::cfg{PubDir} = '/var/www/twiki/pub'; looks fine.
- For UrlPath, I'd expect
$TWiki::cfg{PubUrlPath}='/pub', corresponding to the entry in Apache's Alias directive. I don't know where you specified a name of your project "to abbreviate URLs" during installation - could you please explain this?
--
Harald Jörg - 2016-02-23
As Harald mentions, best to use the
ApacheConfigGenerator the generate the
twiki.conf file. In essence, if you have this in
twiki.conf:
ScriptAlias /do "/var/www/twiki/bin
Alias /pub "/var/www/twiki/pub"
then you should have these
twiki/lib/LocalLib.cfg settings:
$TWiki::cfg{ScriptUrlPath} = '/do';
$TWiki::cfg{PubUrlPath} = '/pub';
$TWiki::cfg{PubDir} = '/var/www/twiki/pub';
--
Peter Thoeny - 2016-02-24
Thank you both for your help! The original installation was several weeks ago, and my notes (and memory) are incomplete.
I did use the !
ConfigGenerator, but I don't deny that I may have botched it.
I don't know why I have
/pub/TWiki instead of
/pub, but I doubt that I changed the default settings of my own initiative. I must have misunderstood what the installer or !
ConfigGenerator was asking. I had noticed that most examples don't have the
/TWiki, but I assumed that adding it was something that changed with 6.0.
Harald: During installation, I understood the installer's request for an Alias to mean that I can shorten URL's of the form
/var/www/twiki/pub to
<ProjectName>/pub. That's what I was referring to.
Here's what I have now, and it works!:
In
twiki.conf:
! ScriptAlias /I2U2 "/var/www/twiki/bin"
Alias /pub "/var/www/twiki/pub/"
In
!LocalSite.cfg:
$TWiki::cfg{PubUrlPath} = '/pub';
$TWiki::cfg{PubDir} = '/var/www/twiki/pub';
--
TWiki Guest - 2016-02-26
Thanks for this thread. I too used the config generator and the problem was $TWiki::cfg{PubDir} = '/var/www/twiki/pub'; was set incorrectly in
LocalSite.cfg (I assume this filename changed from
LocalLib.cfg).
--
TWiki Guest - 2018-02-21
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.