Page 1 of 1

Site Broken since upgrades

Posted: Wed Jul 12, 2017 8:51 pm
by gizmola
My site has run serendipity for a lot of years now, and in the past 6 months or so I've gone through the process of updating a bunch of things. I also upgraded the VM to a modern version of Centos, and subsequently upgraded stuff in the lamp stack.

Here's some details:

Code: Select all

A big issue was spartacus being inoperable until I reconfigured it to only use Github. Now that everything is current, it seems I'm left with some issues that at this point go beyond patches.

So in my observations what I've noticed is the following:
  1. Nothing in /archive works properly. To begin with, any reference to /archive/serendipity.css is broken.
  1. Code that worked in the past involving template fallbacks no longer works.
For example, the buttons on the calendar which worked fine for years no longer display. I have tried various more modern templates briefly to test, and many of them are broken in the same manner.

Code: Select all

 <a title="{$CONST.BACK}" href="{$plugin_calendar_head.uri_previous}"><img alt="{$CONST.BACK}" src="{serendipity_getFile file="img/back.png"}" width="16" height="12" style="border: 0px" /></a>
So it seems that the serendipity_getFile tag isn't doing what it used to from my recollection and locating img/back.png from the the default template img directory.

I've done a lot of experimenting and screwing around with Apache. I have seen some posts on SO that talk about this specific version range for apache as having some issues with mod_rewrite and per-directory .htaccess rules. I did a lot of trying out the suggestions and looking at my vhost as well, but none of those suggestions have fixed the problems with /archive.

For now, just to get the site showing my style again I hardwired the path to the serendipity.css in my template, but the exit.php issue means that lots of my site is broken as no outbound links in any of my articles work correctly.

Any help would be very much appreciated!!!

Re: Site Broken since upgrades

Posted: Sat Jul 15, 2017 8:00 pm
by onli
I don't remember having seen /archive/serendipity.css anywhere. Which explains why it does not work. If that worked once, it was forgotten, and probably an accident in the first place - but someone who is longer in the project than me could correct me here.
Code that worked in the past involving template fallbacks no longer works.
That broke in earlier versions and we made an effort to fix it now, but by defining properly this time what shall be the rewrite order. It is not a bug per se that it does not find files in default/ anymore, as that one got deprecated. The html in there was just too old. 2k11 is the new default theme, and also the engine if default/ is not explicitly set as template engine (making it the last fallback). In practice: Easiest solution for you is to copy those files you want to access to 2k11 or into your current theme.

Though I should mention that the idea of using calendars as navigation was a fad from the beginnings of blogs and not something user actually use. I recommend to just avoid it.

Re: Site Broken since upgrades

Posted: Sat Jul 15, 2017 8:54 pm
by gizmola
Thanks onli!

The changed default fallback template information is helpful.

To be clear, what is happening with archives is that anything that is referenced on an /archives page has the /archives relative path. That is serendipity functionality. With my blog, even modern templates are broken in the same manner.

It seems like something fundamental in the rewrite rules doesn't work now.

Here's an example link: ... try_id=119

This is why exit doesn't work in an archived page anymore. The exit script is not found, so the blog falls back to its 404 configuration.

Here is the .htaccess

Code: Select all

# BEGIN s9y
ErrorDocument 404 /blog/index.php
DirectoryIndex /blog/index.php
Options -MultiViews

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA]
RewriteRule ^((archives/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+\.html)/?) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)?$ index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^comments/(.*) index.php?url=/comments/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css)$ index.php?url=/$1 [L,QSA]
RewriteRule ^(serendipity\.js|serendipity_admin\.js)$ index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
#RewriteCond %{REQUEST_URI} !-U
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

<Files *.tpl.php>
    deny from all

<Files *.tpl>
    deny from all

<Files *.sql>
    deny from all

Re: Site Broken since upgrades

Posted: Sat Jul 15, 2017 11:08 pm
by gizmola
The exit.php behavior is part of the Track exits plugin. For now, I've disabled the tracker in all situations. I looked at the plugin code, and it explicitly utilizes a relative path. This obviously is no longer working the way it used to on my blog.

Code: Select all

return sprintf(
                ($entry_id != 0) ? '&entry_id=' . $entry_id : ''