Koozali.org: home of the SME Server

Upgraded SME9.0 -> 9.2 (new install, copied files, db, cloned config) SSI broken

Offline rossbcan

  • 16
  • +0/-0
more precisely, SSI directives in php output not interpreted (appear as comments in html) with V9.2, using same config and ibays as V9.0 (which did work). SSI in .shtml files OK.

have checked this:
All apache help articles / post re SSI. Tried all suggestions.
Diff'd httpd.conf's. Apart from php version and site name aliases, same
Insured no templates-custom are from V9.0, conflicting with V9.2

To be concise: I need the text/html rendered by php to go through the SSI filter, which worked on V9.0

# To use server-parsed HTML files
AddType text/html .shtml

<Directory />
    Options FollowSymLinks
    AllowOverride None
    order deny,allow
    deny from all
    allow from none
    AddOutputFilter includes .php
</Directory>

<Directory /home/e-smith/files/ibays/problemibay/html>
    Options None
    Options +Indexes
    Options +Includes
    AllowOverride None
    order deny,allow
    deny from all
    allow from all
</Directory>

Note that apache versions identical
V9.0 (working) php: LoadModule php5_module modules/libphp54-php5.so
V9.2 (not working) php: LoadModule php5_module modules/libphp5.so

Any suggestions?

Thanks;
Bill

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
At its most basic have you enabled Execution of dynamic content (CGI, PHP, SSI) for an iBay in the Server Manager, found under

 Information bays, select ibay to modify, setting is found there



Added: default is disabled
--
qui scribit bis legit

Offline rossbcan

  • 16
  • +0/-0
yes; dynamic content enabled.

something has changed, I have confirmed that V9.0 and V9.2 configs are identical, have exhausted that path.

Now, treating this as a problem to be debugged. Here's where I am at:

LoadModule filter_module modules/mod_filter.so
AddOutputFilterByType includes text/html
OR
    #FilterDeclare SSI
    #FilterProvider SSI INCLUDES "%{CONTENT_TYPE} =~ m|^text/html|"
    #FilterChain SSI

...both of which are not working.

Regards;
Bill

Offline ReetP

  • *
  • 3,722
  • +5/-0
Note that apache versions identical
V9.0 (working) php: LoadModule php5_module modules/libphp54-php5.so
V9.2 (not working) php: LoadModule php5_module modules/libphp5.so

Hmmm - I don't think so.

libphp54-php5.so

vs

libphp5.so

So, what else have you got installed that you haven't told us about?

My guess is you installed PHP5.4 somehow before and that's got lost somewhere??

Did you take a list of extra RPMs installed on your v9.0 box ?

Any particular reason why did you do a new install ?
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline rossbcan

  • 16
  • +0/-0
Hi ReetP;

"Any particular reason why did you do a new install ?"

Yes: V9.0 was cumulative upgrade of Older -> V7.x -> V8.x - V9.0
hacks upon hacks, working around legacy problems, lost track / trust of the band-aids on band-aids
site becoming unmaintainable. Not only Sme, but CMS (Xoops).
Needed to clean everything up.

"So, what else have you got installed that you haven't told us about?

My guess is you installed PHP5.4 somehow before and that's got lost somewhere??"

Ok, here's what's installed extra, both systems:
php-scl, python-scl, phpmyadmin

On working site (V9.0) ibay: php-scl version: disabled, php -v = PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
On broken site (V9.2) ibay: php-scl version: php54 (no scl-53 available)

Correction: On Working (V9.0) site php-scl version is Php54 (globally)

so, apparently both use same php version
"My guess is you installed PHP5.4 somehow before and that's got lost somewhere??"
If I were to guess, its php-5.3 that's awol.

"Did you take a list of extra RPMs installed on your v9.0 box ?"

here (V9.0): https://www.rossco.org/Downloads/OpenWrt/rpms_9.0.txt
here (V9.2): https://www.rossco.org/Downloads/OpenWrt/rpms.txt

PS: Thanks for taking an interest...

PPSS: Site Capta verification a repetitive annoyance...

Regards;
Bill
« Last Edit: August 15, 2018, 06:54:36 PM by rossbcan »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Can't be quite right as php 5.3.x is default on all CentOS 6 based boxes so all versions of SME v9.

From your file lists you had PHP SCL installed.

I'd suggest you go back, read this page and follow instructions.

https://wiki.contribs.org/PHP_Software_Collections

I'd also suggest you don't use 5.4 as it is EOL. Minimum 5.6 (note 5.3 is EOL as far as PHP is concerened but still has security maintenance from RH)

The contrib adds a control panel to set PHP per ibay or overall.


...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline rossbcan

  • 16
  • +0/-0
Have php-scl installed on both boxes.

The working site uses php-scl54 globally
The non-working site uses php-scl54 for the ibay having problems.
For this particular site, stuck with php54 else, have to re-write a bunch of third party xoops (CMS) php modules.

I am beginning to think it is a fluke that (working box) that php output is filtered for SSI. Is this what Sme does by default, and I somehow broke it?

So, I am focusing on explicitly filtering all text/html for SSI:

deltas (httpd.conf):
global: LoadModule filter_module modules/mod_filter.so
directory:
    FilterDeclare SSI CONTENT_SET
    FilterProvider SSI INCLUDES resp=Content-Type $text/html
    FilterChain SSI
    FilterTrace SSI 1

error_log:
cat /var/log/httpd/error_log | grep mod_filter.c
[Wed Aug 15 13:50:34 2018] [debug] mod_filter.c(117): [client 192.168.1.27] SSI
[Wed Aug 15 13:50:34 2018] [debug] mod_filter.c(122): [client 192.168.1.27] SSI: type: FILE, length: 199
[Wed Aug 15 13:50:34 2018] [debug] mod_filter.c(122): [client 192.168.1.27] SSI: type: EOS, length: 0
[Wed Aug 15 13:50:34 2018] [debug] mod_filter.c(117): [client 192.168.1.27] SSI
[Wed Aug 15 13:50:34 2018] [debug] mod_filter.c(122): [client 192.168.1.27] SSI: type: FILE, length: 147
[Wed Aug 15 13:50:34 2018] [debug] mod_filter.c(122): [client 192.168.1.27] SSI: type: EOS, length: 0
...

Seems that "something" is being filtered, yet view source still has:

<div class="article-text"><!--#include virtual="/Articles/SomeFile.htp"-->

<!--#include virtual="/Files/AboutBR.htp"-->   

and, the virtual content (from included files) is missing

I no longer believe this is a Sme-Server issue, but a custom httpd config issue.

Anyway, if any suggestions / thoughts why filter invoked but content not served, love to hear them.

Thanks;
Bill

Offline ReetP

  • *
  • 3,722
  • +5/-0
I believe there are differences between runnning per ibay and runnning globally.

Personally I'd go to 5.6 globally (5.4 being EOL) and then start debugging your httpd confs from there.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline rossbcan

  • 16
  • +0/-0
Thanks 4 your suggestion.
Cannot use 5.6 globally, breaks legacy site.
I will seek help (for SSI / filter problem) on apache focussed sites.

Regards;
Bill

Offline ReetP

  • *
  • 3,722
  • +5/-0
I think most people will politely tell you to take a hike if you aren't running a supported version of PHP (and they won't include 5.3.x in that)

You really need to address your legacy issues and stop burying them... you have to face it one day, so it may as well be now.....

I know it isn't what you want to hear, but it doesn't make it any less true.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline michelandre

  • *
  • 261
  • +0/-0
Hi rossbcan and ReetP,

Quote
I believe there are differences between runnning per ibay and runnning globally.

I have a WordPress site on SME-8.0 upgraded to SME-9.1 to 9.2 and WordPress always updated.

I have installed PHP-SCL and installed other sites on same SME-9.2. If I set PHP globally, the original site in Primary doesn't work anymore.

I set the PHP of new sites to PHP-5.6 and PHP-7.1 per i-bay and all is working fine.

Also, if you change MemoryLimit, PostMaxSize, and UploadMaxFilesize you have to respect the relation of: MemoryLimit > PostMaxSize > UploadMaxFilesize.

Original site: original PHP

Code: [Select]
#  db accounts show Primary
Primary=ibay
    AllowOverride=all
    CgiBin=enabled
    FollowSymLinks=enabled
    Group=shared
    Indexes=disabled
    MemoryLimit=512M
    Modifiable=no
    Name=Primary i-bay
    PHPBaseDir=/home/e-smith/files/ibays/Primary:/tmp
    PasswordSet=no
    Passwordable=no
    PostMaxSize=52M
    PublicAccess=global
    Removable=no
    UploadMaxFilesize=50M
    UserAccess=wr-admin-rd-group

New site: PHP-5.6
Code: [Select]
#  db accounts show mn-101
mn-101=ibay
    AllowOverride=all
    CgiBin=enabled
    FollowSymLinks=enabled
    Gid=5088
    Group=admin
    Indexes=disabled
    Name=Micronator-101.com
    PHPBaseDir=/home/e-smith/files/ibays/mn-101:/tmp
    PasswordSet=no
    PhpVersion=php56
    PublicAccess=global
    SSL=disabled
    Uid=5088
    UserAccess=wr-admin-rd-group

New site: PHP-7.1
Code: [Select]
#  db accounts show wiki
wiki=ibay
    AllowOverride=all
    CgiBin=enabled
    FollowSymLinks=enabled
    Gid=5092
    Group=admin
    Indexes=disabled
    Name=Pour MediaWiki
    PHPBaseDir=/home/e-smith/files/ibays/wiki:/tmp
    PasswordSet=yes
    PhpVersion=php71
    PublicAccess=global-pw
    SSL=enabled
    Uid=5092
    UserAccess=wr-admin-rd-group

Michel-André



Offline rossbcan

  • 16
  • +0/-0
I think the php version is a dead end, not the problem.
The problem is apache/Sme9.2 AddOutputFilter is not working, perhaps in general:

<Directory />
    ...
    AddOutputFilter includes .php
</Directory>

Above is default Sme httpd.conf

https://httpd.apache.org/docs/2.2/mod/mod_mime.html#addoutputfilter

clearly states that all output from .php files should go through the include filter for SSI processing (as it does on V9.0)

Make a simple testcase file: test.php and place in docroot
#contents:
<html>
<head>
<title>SSI Test</title>
</head>
<body>
<!--#echo var="DATE_LOCAL" -->
</body>
</html>
#end contents

try it: site_url/test.php

On SmeV9.0, date is displayed
On SmeV9.2, nothing is displayed. View source, will see the SSI code

I think it is important to determine whether this is a Sme V9.2 problem, or just mine

Regards;
Bill
« Last Edit: August 15, 2018, 11:08:21 PM by rossbcan »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Hi rossbcan and ReetP,

I have a WordPress site on SME-8.0 upgraded to SME-9.1 to 9.2 and WordPress always updated.

I have installed PHP-SCL and installed other sites on same SME-9.2. If I set PHP globally, the original site in Primary doesn't work anymore.


Unless you believe that this is directly related here then either open a new thread or post a bug. You will just confuse things otherwise.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 3,722
  • +5/-0
I think the php version is a dead end, not the problem.

Quite possibly. However my advice above is still the same, and still correct :-)

Quote
The problem is apache/Sme9.2 AddOutputFilter is not working, perhaps in general:

Possibly, but we haven't actually yet ascertained where it is, so hard to say if it is one thing or or the other.

Next thing to suggest checking.

Can you diff your old httpd.conf and your new one and check if there are any difference sat all?

e.g are there any difference in templates/setup that may be causing a wriggle.

Note that I have checked the change log in e-smith-apache which has the httpd templates.

The last updates were in Jan 2016 and involved disabling SSL v2, v3, and TLSv1, v1.1

I can't remember when 9.2 was released so not sure how relevant that is as you may well have got the latest version with SME v9.0

Also check the mod_deflate module is loaded I guess

Code: [Select]
apachectl -M | grep deflate
or

Code: [Select]
apachectl -M | grep deflate
My test box doesn't by default. Neither do I have any AddOutputFilter lines anywhere.

Code: [Select]
grep -rn AddOutputFilter /etc/httpd/conf/httpd.conf
Code: [Select]
grep -rn AddOutputFilter /etc/httpd/conf/*
Neither can I find any references in the standard templates

Code: [Select]
cd /etc/e-smith/templates/etc/httpd/conf/httpd.conf
grep -rn AddOutputFilter *

So presumably you added a template to load mod_deflate and a template for the filter?
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline rossbcan

  • 16
  • +0/-0
I have already done most of what you suggested, due diligence B4 bothering everyone, just to not be a lazy noob.

It is definitely not a php issue 'cuz the test.php file does not invoke php, just apache.

You are correct: /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/85DefaultAccess
# First, we configure the "default" to be a very restrictive set of
# permissions.

<Directory />
    Options FollowSymLinks Includes
    AllowOverride None
    order deny,allow
    deny from all
    allow from none
    AddOutputFilter includes .php
</Directory>

not using mod_deflate

Is it possible to add the filter to config and do the testcase? May also have to add "Options + Includes". I really need to know whether this is a V9.2 problem implying apache update.

Regards;
Bill

« Last Edit: August 16, 2018, 12:24:19 AM by rossbcan »