Koozali.org: home of the SME Server

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

Offline ReetP

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

Yes, but as you haven't said that, and we are not at your terminal watching, we have absolutely no idea of what you have or haven't done. Better to go back to the start and check properly. Otherwise we end up with a http://xyproblem.info/ problem.

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

Most likely, but again, it is just a case of elimination and so we know where we stand. See above.....

Quote
You are correct: /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/85DefaultAccess

And that is why it is important to explain EXACTLY what you have done. you know in your head. We don't.

Quote
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.


As and when I get 5 minutes free I will try and take a look. Note that if it is an issue with apache, then it isn't per se a SME problem as we only run with what CentOS throw us usually.

It will be an Apache bug and that will have to be bugged upstream, though you should enter one on the bug tracker here and refer upstream.

Regarding your comment on Options + Indexes I'd suggest you give it a try yourself and see if it works.

From reading the manual it would seem that this is probably the case. You may want to do a bit more reading and testing:

https://httpd.apache.org/docs/2.2/en/mod/core.html#options

Quote
Options Directive
Includes
    Server-side includes provided by mod_include are permitted.

https://httpd.apache.org/docs/2.2/mod/mod_include.html

Quote
Enabling Server-Side Includes

Server Side Includes are implemented by the INCLUDES filter. If documents containing server-side include directives are given the extension .shtml, the following directives will make Apache parse them and assign the resulting document the mime type of text/html:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

The following directive must be given for the directories containing the shtml files (typically in a <Directory> section, but this directive is also valid in .htaccess files if AllowOverride Options is set):

Options +Includes

For backwards compatibility, the server-parsed handler also activates the INCLUDES filter. As well, Apache will activate the INCLUDES filter for any document with mime type text/x-server-parsed-html or text/x-server-parsed-html3 (and the resulting output will have the mime type text/html).

For more information, see our Tutorial on Server Side Includes https://httpd.apache.org/docs/2.2/howto/ssi.html.

...
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 meant to paste this too

Syntax:   AddOutputFilter filter[;filter...] extension [extension] ...

E.g

AddOutputFilter INCLUDES .shtml

Yours has no Filter set??

Let us know how you get along.
...
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 mmccarn

  • *
  • 2,626
  • +10/-0
Your test file displays the date on my SME 9.2 server if I put it in .../Primary/html, make these changes to httpd.conf, and restart httpd-e-smith:

Code: [Select]
# diff -u /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.works
--- /etc/httpd/conf/httpd.conf 2018-08-16 08:20:24.345693239 -0400
+++ /etc/httpd/conf/httpd.conf.works 2018-08-16 08:20:16.794359181 -0400
@@ -1133,8 +1133,8 @@
 
 
 <Directory /home/e-smith/files/ibays/Primary/html>
-    AddType application/x-httpd-php .php .php3 .phtml
-    AddType application/x-httpd-php-source .phps
+    AddType text/html .php
+    AddHandler server-parsed .php
     php_admin_value open_basedir /home/e-smith/files/ibays/Primary/
 </Directory>

* If I don't delete the existing "AddType application/x-httpd-php .php..." directive, the file downloads as a text file instead of rendering in the browser

* It also worked to put the new lines in the global config instead of the <Directory...> section, as long as the .php "AddType" directive is removed from the <Directory...>

Offline mmccarn

  • *
  • 2,626
  • +10/-0
I also got the file to work (in my Primary ibay) by doing this:
Code: [Select]
db accounts setprop Primary AllowOverride All
expand-template /etc/httpd/conf/httpd.conf
sv t httpd-e-smith

Then adding these two lines to /home/e-smith/files/ibays/Primary/html/.htaccess:
Code: [Select]
AddType text/html .php
AddHandler server-parsed .php

[edit]
NOTE: I did not need to make any custom changes in /etc/httpd/conf/httpd.conf for this to work -- that is, I did not have to delete the application/x-httpd-php directive from the <Directory...> section
« Last Edit: August 16, 2018, 02:39:08 PM by mmccarn »

Offline rossbcan

  • 16
  • +0/-0
I have also had some success:

CONFIRMED: This is not a Sme-Server bug.
What I did:
Disabled remi-php (set to default) for dysfunctional ibay and globally. Ie; use Sme-Server default php version.
php -v: PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

This (native php version) is NOT a mistake. Did a Sme-server netinstall (about 2 months ago), applied all updates yesterday. The only php related changes were installing scl-php.

My best guess as to what was happening is that when apache reconciles all config, swapping in php-remi redirection, php related settings such as "AddOutputFilter includes .php" are not passed to remi php.

So, this is NOT a php version problem, but an attribute if how php-scl does its redirection and not accepting previous apache related configuration.

Since native Sme-Server php is adequate for my legacy sites, I will not pursue this further until Sme updates (php) break things.

Once again, thanks for your help. I found this "problem" to be extremely counter-intuitive and, your due diligence suggestions to be extremely necessary (although annoying - my hubris).

I am not sure if you (Sme team) want to follow up with the php-scl team with what I consider a bug.

Regards;
Bill

Offline ReetP

  • *
  • 3,722
  • +5/-0
It's annoying to not get to the bottom of the issue (and nothing is confirmed until it is confirmed !). Just realised I made a post quoting something you had already said (reading/replying on mobile is a PITA) so apologies for that.

You can check what the php-scl contrib actually does to httpd.conf

There are 3 added templates for httpd.conf (rpm -ql smeserver-php-scl)

/etc/e-smith/templates/etc/httpd/conf/httpd.conf
80phpscl-cgi
90php_rhscl

/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf (not sure why this one is custom)
20LoadModule80PHP

There ARE differences between running PHP per ibay and globally (you originally said the the working server had it globally and the non working per ibay)

Try swapping between the standard, global, and per ibay settings and diff up your httpd.conf file for starters.

Note for PHP SCL I have found I also need to add various configs per ibay or I get some complaints eg

db accounts....

PHPBaseDir=/home/e-smith/files/ibays/products/html/:/usr/share/pear/:/usr/share/pear-addons/:/tmp/:/opt/remi/php71/root/usr/share/pear/

PHPUploadDir=/home/e-smith/files/ibays/products/html/tmp/

Again it is unlikely to affect you though.

I think the issue is more likely to be how apache is configured for what you want it to do - you just need the right magic sauce to configure it correctly.

If you do think it is a bug then you should try and read upstream bug reports searching for your issue first - it is very unlikely that you would be the first to experience it. Second, add one to our bug tracker, and greater minds than mine can take a look.

Also note the comments from @mmccarn - he knows a lot more about it than me.

Ok, back to playing Samba 4 on docker....
...
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
gonna have to not follow up with php-scl. Tight schedule(s) to meet.
this thread should help those with similar issues

Fyi, U helped me, thanks

[Edit: Ad links not allowed and removed]

Regards;
Bill
« Last Edit: August 17, 2018, 10:23:42 AM by ReetP »

Offline ReetP

  • *
  • 3,722
  • +5/-0
gonna have to not follow up with php-scl. Tight schedule(s) to meet.

It may surprise you that most of us have day jobs too, and SME isn't the only thing in our lives.

Quote
this thread should help those with similar issues

Unlikely as it fixes nothing, and leaves no real solution.

Unfortunately the distro can't progress when people are 'too busy' to help fix these things.

What if we were 'too busy' working to actually write code for SME?

We do our best, and when issues like this arrive we spend time (that we could be coding or earning money or spending with our families) trying to help out, but we can't do it all by ourselves.

I hope in future you can find time in your busy schedule to help out, and put back something into the software that helps earn you a crust.
...
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