Discussion:
Unable to enable SSI in Apache 2.4.29 (Ubuntu)
(too old to reply)
z***@gmail.com
2018-07-25 22:39:57 UTC
Permalink
Hello Everyone.

I am having quite a lot of difficulty trying to enable SSI on an apache instance running on my laptop for development purposes - it's day three - and I'm starting to feel a little slow-witted. I've already run `a2enmod includes`, restarted the service (a few times), and I've amended the apache2.conf file as follows:

<Directory /var/www/>
Options Indexes FollowSymLinks Includes
XBitHack on
AllowOverride None
Require all granted
</Directory>

Because I'm using XBitHack, I set the xbit on my test file (at /var/www/html/index.html) with `chmod +x index.html` from within that directory. The actual symptom is that my test page will load but the SSI instruction was not parsed - no text appears where it should, and the SSI command code is still visible in the page code as a comment.

That command was: <!--#echo var="DATE_LOCAL" -->

Unfortunately I need SSI to continue my work, so I'm wedged here. I'd like to able to do this with apache as it would save me changing the production server as well.

If this is a super obvious problem, I apologise, but unfortunately I just don't see what I've done wrong.
Eli the Bearded
2018-07-26 00:23:38 UTC
Permalink
Post by z***@gmail.com
I am having quite a lot of difficulty trying to enable SSI on an
apache instance running on my laptop for development purposes - it's
day three - and I'm starting to feel a little slow-witted. I've
already run `a2enmod includes`, restarted the service (a few times),
I've never used a2enmod, I've always done the changes myself. Have you
verified that symlinks are created? Did you do a graceful restart or a
full shutdown and start? I'd probably try the later if the former didn't
work.
Post by z***@gmail.com
XBitHack on
...
Post by z***@gmail.com
That command was: <!--#echo var="DATE_LOCAL" -->
Those two work for me (on my non Ubuntu system test).
Post by z***@gmail.com
Unfortunately I need SSI to continue my work, so I'm wedged here. I'd
like to able to do this with apache as it would save me changing the
production server as well.
Have you examined the logs? The comment remaining in the file is a sure
sign of the includes module not firing. Maybe error log during start up
is going to have something useful.

Elijah
------
has only used SSI for proof-of-concept
Zac
2018-07-26 00:49:02 UTC
Permalink
Thanks for your reply!
Post by Eli the Bearded
I've never used a2enmod, I've always done the changes myself. Have you
verified that symlinks are created? Did you do a graceful restart or a
full shutdown and start? I'd probably try the later if the former didn't
work.
It hadn't occurred to me to look for the symlinks, but I believe they are there - I also read the include.load file and verified the binary it refers to is where it says it is.
Post by Eli the Bearded
Have you examined the logs? The comment remaining in the file is a sure
sign of the includes module not firing. Maybe error log during start up
is going to have something useful.
I have, and I find nothing particularly substantial there to go on. You see sigterm kill the process, and then "Apache/2.4.29 (Ubuntu) configured -- resuming normal operations" shortly afterwards, which I suppose I would expect.

I've done both systemctl shutdown apache2 and systemctl restart apache2 and neither seemed to produce much by way of progress. Hell, I've even done a full power cycle on the machine.
Eli the Bearded
2018-07-26 07:00:36 UTC
Permalink
Post by Zac
I have, and I find nothing particularly substantial there to go on. You
see sigterm kill the process, and then "Apache/2.4.29 (Ubuntu)
configured -- resuming normal operations" shortly afterwards, which I
suppose I would expect.
Here's the smallest complete Apache config I can come up with for
getting SSI to work on:

Server version: Apache/2.4.18 (Ubuntu)

https://qaz.wtf/tmp/minimal-ssi.tgz

In fact, the tgz is just 2001 bytes, so I'll include it as a base64
block for posterity below. This config relies on a standard Ubuntu
install, because it loads the modules from the Ubuntu directories.

Edit the ADMIN_ROOT= line in env_vars_ssi.sh then start up Apache with

sh env_vars_ssi.sh start

The server starts on http://localhost:8000/

Logs go to log_ssi/access.log and log_ssi/error.log
The SSI specific config is in conf_ssi/*
There are two test documents in htdocs_ssi/

No Xbit:
http://localhost:8000/test.html

Mode 755:
http://localhost:8000/chmod755.html

Then you can stop the server with

sh env_vars_ssi.sh stop

Run as a regular user, no special permissions required.

As you may be able to surmise from the filenames and structure in this
example, I have a whole series of these used as PoC, and sharing a
single bare apache-admin.conf file. I never got around to making it more
general to as to run on other common distros, however.

Elijah
------
base64 encoded minimal-ssi.tgz:

H4sIAC9tWVsAA+1ae3PbNhL3v+Wn2PoxaXOl+JAouRpZc4osP65+jaykncnlNBQJiTyThEqA
fjTn734LiqKoh23lqnOuV/ySMcnFYgHsYpeLFTkJx6o9th2PaJOLaruhH5UcGg23NgMdUa1W
xNWoWXrxKlCuVM0tw6wZVsUyanp1SzeqVrW2BfqGxn8WCeN2DLA1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OD+bPBXDS611p
RklvgqnrUK1AQ21CI7gbq/HkYxZsLO83U7JVNeUb438Pq/w//z5qQ2O85P/Vgv9P4n+1plek
/78GPv5MXECnB9OCzOV19FlTr5og4sAn+Fj4/K4eUe47BImi5Gga+xXzE7RO0J7Vch1ak21k
liolYx++ez9IIp58n31TnMQ4kKpCTFgSiu+KI/FpZgB0TGI7/chAeWouZs2YzkV8N/nkJPQf
K3Vo0zAUXycHfkTq8GapSgmq+1zBH9Thc83Lhdw3K6ZdQRXotUrF+DIV/lgHx05GHofr0+Ne
p3v+AzAv4Vxoy6V3kYyfEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEqvwb1XZk9IA
UAAA
Zac
2018-07-26 17:09:18 UTC
Permalink
Thanks for your help, Eli. I used your test config as instructed and things worked fine. I identified a few minor differences to my own config, and the situation did not resolve.

However, I did some experimenting and realized that there was a slight difference between what you'd done and what I'd done, and it was this.

I used `chmod +x`
You used `chmod 755`

I since went through and re-chmodded my own test pages and it turns out that this resolved the issue - my original configuration and your new configuration both correctly tell apache to parse my files.

This is particularly concerning as chmod +x is the method stated in the documentation to set a file to be parsed by xbithack.

This response more or less for anyone who follows on after me with a similar issue.
Loading...