Discussion:
Can't get SSI to work
(too old to reply)
Bruce Bowler
2012-08-20 12:32:38 UTC
Permalink
Relative newbie here (but I'm sure that'll be obvious soon enough :-)

I used to manage a machine (2+ years ago) that ran centos and apache.
That machine has been replaced by one running ubunto and apache2. On the
old machine, <-- #include directives "just worked". Now I can't seem to
get them to work to save my life.

I've enabled mod_include.
I've added Options +Include to my httpd.conf.
I've restarted apache

No love. No errors, no warnings, no mention of anything in access or
error logs.

Any ideas most appreciated. It's a private machine behind a firewall so
even "insecure" suggestions welcome.

Bruce
patpro ~ Patrick Proniewski
2012-08-20 12:53:30 UTC
Permalink
Post by Bruce Bowler
Relative newbie here (but I'm sure that'll be obvious soon enough :-)
I used to manage a machine (2+ years ago) that ran centos and apache.
That machine has been replaced by one running ubunto and apache2. On the
old machine, <-- #include directives "just worked". Now I can't seem to
get them to work to save my life.
I've enabled mod_include.
I've added Options +Include to my httpd.conf.
I've restarted apache
No love. No errors, no warnings, no mention of anything in access or
error logs.
Any ideas most appreciated. It's a private machine behind a firewall so
even "insecure" suggestions welcome.
Bruce
And your file is properly parsed? I mean, it's a regular index.html, or
it's a index.shtml (.shtml calls for the mod_include parser, IIRC).

patpro
Bruce Bowler
2012-08-20 13:50:37 UTC
Permalink
Post by patpro ~ Patrick Proniewski
Post by Bruce Bowler
Relative newbie here (but I'm sure that'll be obvious soon enough :-)
I used to manage a machine (2+ years ago) that ran centos and apache.
That machine has been replaced by one running ubunto and apache2. On
the old machine, <-- #include directives "just worked". Now I can't
seem to get them to work to save my life.
I've enabled mod_include.
I've added Options +Include to my httpd.conf.
I've restarted apache
No love. No errors, no warnings, no mention of anything in access or
error logs.
Any ideas most appreciated. It's a private machine behind a firewall
so even "insecure" suggestions welcome.
Bruce
And your file is properly parsed? I mean, it's a regular index.html, or
it's a index.shtml (.shtml calls for the mod_include parser, IIRC).
patpro
I think so (other than it's not an index.html). Here's a sample, with
data changed to protect the innocent...

In the old days, it was a .txt file, and for various reasons that I don't
think are germane to this discussion, I'd like to keep it a .txt file.

<pre> header
data
data
data
</pre>
Bruce Bowler
2012-08-20 15:03:29 UTC
Permalink
Post by patpro ~ Patrick Proniewski
Post by Bruce Bowler
Relative newbie here (but I'm sure that'll be obvious soon enough :-)
I used to manage a machine (2+ years ago) that ran centos and apache.
That machine has been replaced by one running ubunto and apache2. On
the old machine, <-- #include directives "just worked". Now I can't
seem to get them to work to save my life.
I've enabled mod_include.
I've added Options +Include to my httpd.conf.
I've restarted apache
No love. No errors, no warnings, no mention of anything in access or
error logs.
Any ideas most appreciated. It's a private machine behind a firewall
so even "insecure" suggestions welcome.
Bruce
And your file is properly parsed? I mean, it's a regular index.html, or
it's a index.shtml (.shtml calls for the mod_include parser, IIRC).
patpro
and here's the section of index.html that "includes" the file<html>
<head>
<title>
Data page
</title>
</head>
<body>
<font face="courier new">
<a href="run1/index.html">Run 1</a> </br>
<a href="run2/index.html">Run 2</a> </br>
<a href="run3/index.html">Run 3</a> </br>
</font>
<br><br>
Current/most recent mission<br>
<!--#include virtual="/tabular-data.txt" -->
<img src="result1.png" height=100% width=100%><p>
<img src="result2.png" height=100% width=100%><p>
</body></html>

Everything else works, except for include...

Bruce
Álvaro G. Vicario
2012-08-21 07:47:33 UTC
Permalink
Post by Bruce Bowler
I used to manage a machine (2+ years ago) that ran centos and apache.
That machine has been replaced by one running ubunto and apache2. On the
old machine, <-- #include directives "just worked". Now I can't seem to
get them to work to save my life.
I've enabled mod_include.
I've added Options +Include to my httpd.conf.
I've restarted apache
No love. No errors, no warnings, no mention of anything in access or
error logs.
Sorry if I'm saying something obvious but Ubuntu is Debian-based and
Debian loves to change the way in which third-party software is configured.

Make sure that:

1. mod_include is actually enabled.
2. Parsed settings contain an output filter for whatever file extension
you are using.

http://httpd.apache.org/docs/2.2/en/mod/mod_include.html
http://linux.about.com/od/ubusrv_doc/a/ubusg25t08.htm
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Bruce Bowler
2012-08-21 12:06:19 UTC
Permalink
Post by Álvaro G. Vicario
Post by Bruce Bowler
I used to manage a machine (2+ years ago) that ran centos and apache.
That machine has been replaced by one running ubunto and apache2. On
the old machine, <-- #include directives "just worked". Now I can't
seem to get them to work to save my life.
I've enabled mod_include.
I've added Options +Include to my httpd.conf.
I've restarted apache
No love. No errors, no warnings, no mention of anything in access or
error logs.
Sorry if I'm saying something obvious but Ubuntu is Debian-based and
Debian loves to change the way in which third-party software is configured.
Hard to say anything too obvious with me :-) and "no shit" to deb changing
the way things work...
Post by Álvaro G. Vicario
1. mod_include is actually enabled.
There's an entry in /etc/apache2/mods-enabled, so I assume it's actually
enabled. Is there a better way to check?
Post by Álvaro G. Vicario
2. Parsed settings contain an output filter for whatever file extension
you are using.
http://httpd.apache.org/docs/2.2/en/mod/mod_include.html
http://linux.about.com/od/ubusrv_doc/a/ubusg25t08.htm
Either I've forgotten how to read or neither of those links tell me where
(and what, specifically) to put the "parsed settings".

Oh how I miss fedora and friends...

Bruce
patpro ~ Patrick Proniewski
2012-08-21 12:28:52 UTC
Permalink
Post by Bruce Bowler
Post by Álvaro G. Vicario
1. mod_include is actually enabled.
There's an entry in /etc/apache2/mods-enabled, so I assume it's actually
enabled. Is there a better way to check?
httpd -t -D DUMP_MODULES
Post by Bruce Bowler
Post by Álvaro G. Vicario
2. Parsed settings contain an output filter for whatever file extension
you are using.
http://httpd.apache.org/docs/2.2/en/mod/mod_include.html
http://linux.about.com/od/ubusrv_doc/a/ubusg25t08.htm
Either I've forgotten how to read or neither of those links tell me where
(and what, specifically) to put the "parsed settings".
you want to read the "Enabling" part
(<http://httpd.apache.org/docs/2.2/en/mod/mod_include.html#enabling>).
It tells you how to use AddType and AddOutputFilter to activate SSI.
Then you can repport to apache documentation about AddType and
AddOutputFilter directives to learn how to use them.

Also, the line just after AddOutputFilter reads:

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)

That's all you need to know in order to be able to make some tests.

And fedora won't be helpful here. What you need is Apache documentation,
the system under doesn't matter. I use FreeBSD, Mac OS X, Linux
Debian/Redhat and master Apache all the same, whatever OS I use.

cheers,
patpro

Continue reading on narkive:
Loading...