I'm just in the midst of putting a client's website on a professional
hosting service and am encountering an odd problem. I can do Server Side
Includes but not NESTED Server Side Includes. Can anyone here suggest a
way to resolve this problem?

Basically, I want to have two or three levels of SSIs. My HTML pages will
contain both normal HTML statemenet and includes that embed other partial
documents. Those partial documents will, in turn, embed OTHER partial
documents. I've used this technique successfully on other servers but for
some reason, only the highest level includes, those in the HTML
documents, work. The SSIs that are nested within the lower level
documents are simply ignored.

I've checked the documentation on the hosting service and they swear they
allow SSI but don't say anything about NESTED SSI. In the past, I've
never had any problem getting nested SSI to work if SSI was supported in
the first place so I'm not sure what to do here.

I'm guessing that I need an .htaccess file with specific directives in
it. At the moment, this is my .htaccess file:

AddType text/html .shtml
AddHandler server-parsed .shtml

However, I'm not sure if the server is actually using Apache or one of
the alternatives. Can someone tell me a way to figure that out? They have
several forms of tech support but their support is TERRIBLE, at least
today. (They were better earlier in the week when we had a problem with
the account.) So I thought I'd try here in the hopes of resolving my
problem sooner. If I get no joy here, I'll contact them again on Monday
and hope that they are more helpful then.

In the meantime, if you can tell me how to get my nested Server Side
Includes to work, I'd be grateful.

For bonus points, I'd love to know how to tell whether a given site is
using Apache or one of the alternatives ;-)

Re: Nested Server Side Includes

I've installed the plugin and it seems to be working but I'm not sure
what I'm looking for. Which particular header tells you whether Apache is
being used? I don't see the word "Apache" anywhere in the output from
Live HTTP Headers....

Frankly, I can't recall the term that describes what Apache is an example
of; that would already give me a clue as to which header I want to
inspect. For example, if Apache and its alternatives were "header
managers", I'd look for a header like "server-header-manager" and see if
it said "Apache 1.3" or whatever.

I've never had trouble with them anywhere else either. Given that the
hosting service open declares that they support them, I had expected this
to work without difficulty. I'm guessing there's _something_ I need to do
on my side, probably with .htaccess (or its equivalent if Apache is not
being used) that I need to do.

I've had SSIs working fine on other servers with little if any trouble. I
don't expect I have to do anything too complicated to get this to work.

Re: Nested Server Side Includes

Another way of doing it is to use PHP. Upload a file called 'info.php' that
contains just one line:

<? phpinfo(); ?>

and then view it in your browser. Assuming PHP is installed on the sever
(and it would be an extremely unusualy shared hosting service which doesn't
support PHP) then you'll get a full listing of everything the server
supports as well as information on what type of software it's running.

Re: Nested Server Side Includes

Thank you! Seriously, I didn't know which header I needed and didn't know
where to look....

Well, now I'm REALLY confused! According to info.php, SERVER_SOFTWARE is
"Apache" (no version number).

I must be using this "Live HTTP" plug-in incorrectly. Live HTTP is
definitely NOT very friendly. It doesn't show a URL in most of its entries
and doesn't show a timestamp so it's very hard to verify which page view
the entry refers to.... I see at least one entry with Microsoft-IIS/7.5 on
it but I have no idea what website that corresponds to. Perhaps that is an
entry for one of the other webpages I have open?

It's a shame that there is no Help documentation for Live HTTP. I can't
find anything at the website that tells you in any detail how to use it.
The author just seems to assume that it is self-explanatory.

Can anyone suggest another free tool that will let me go to a given server
and determine what type of server it is? I'm not going to be happy until I
get consistent results from info.php and some other tool.....

Determing the actual server being used would appear to be essential for
determining the best technique for getting my nested SSIs to work.

Re: Nested Server Side Includes

On 4/15/2012 5:38 PM, Ten Blade wrote:

Live HTTP Headers is quite user friendly. There is a GET or POST
request, including the URL, which is what's being sent to the server.
Immediately following that is the response from the server, which
includes the Server: header, amongst other things.

Remember that almost every page requires multiple requests to the server
- one for the page itself and one for each additional item which must be
downloaded, i.e. images, CSS files, etc.

It does take some knowledge of how HTTP works - but any web developer
should have such a basic understanding, anyway.

Re: Nested Server Side Includes

Well, it's NOT friendly to me! I have written Java servlets and have some
basic familiarity with headers, although I am rusty at both servlets and
headers. I've been looking at the information in Live HTTP Headers off
and on all day and I can figure out for the life of me how to associate
what it contains with what my web page is doing.

As I said, many of the entries lack timestamps and URLs so how am I
supposed to match a given entry to a given web page?

All I'm trying to do is see the Server value for one page but there are a
lot of entries here. I don't know if these entries are in chronological
order from oldest to newest or newest to oldest or if they are in
alphabetical order by URL or something else altogether.

Can you enlighten me? Or suggest a tool that is a little more intuitive?

Re: Nested Server Side Includes

On 4/15/2012 8:12 PM, Ten Blade wrote:

Timestamps don't matter! They are in the order of the request followed
by the response. Then the next request, and the next response. And so
on. IOW, they are in the order that things are requested from the
server, each one followed by the response to that request. The request
has the URL and any data sent in it; the response has the response code
and other associated information.

Re: Nested Server Side Includes

That's already a heck of a lot more information than I've been able to
find anywhere else - information which should have been readily findable
but was left to the imagination of the user. The problem is, I have a
very good imagination and I could imagine several ways it _might_ work
but I was darned if I could prove any of the possibilities.

Yeah, it's dead easy if you already know how it works. It's not so damned
easy if you don't.

Even with what you've told me, I'm still not seeing a single Apache
anywhere in this long list of entries. Of course, it would be easy to
miss it since I don't see anything resembling a search/find so that I can
look for all instances of "server" or "Apache".

Okay, I used the Save All function and opened the resulting file in
Notepad. The vast majority of the "server" entries say "Microsoft-IIS/7.5
but a small handful say Apache without any version number. But most of
the ones that identify the server which concerns me are saying Apache so
I think I'm finally satisfied that info.php and the plugin are agreeing
with one another. Previously, when just eyeballing the many entries, I
had seen no Apaches at all but now that I am actually see "Apache" with
URLs that must be getting served from the hosting service, I'm starting
to feel like this is making a bit of sense.

The last thing I wanted to do is waste a lot of time trying to figure out
how to make SSIs work in Apache if the server wasn't using Apache.
Instead, I wasted a lot of time trying to figure out what the plug-in was
saying.

What a frustrating day! I spent several hours playing with SSIs and
couldn't get them to work even though I think I am imitating exactly what
I did successfully elsewhere. I'm still not sure what to try next to
resolve my SSI problem. But it's late so I'm going to try the hosting
company's tech support tomorrow and hope that they are a heck of a lot
more helpful on weekdays than they were on Saturday.

Re: Nested Server Side Includes

Youi have to remember that any HTML page usually contains multiple files
which may well be served from multiple locations. So it's not at all
uncommon for you to see multiple server types in the responses as well. The
one that matters is the first one, the one that's in the set of responses
to the initial page load request. If that's IIS then that would explain why
SSIs don't work the way they do on Apache.

Someone will probably be along shortly to explain why hosting on IIS is a
bad thing; that's a matter of perspective and it's not necessarily always
the case. But one thing that definitely *is* the case is that
server-specific features, such as SSIs, can't be guaranteed to work
cross-platform. That's one of the reaons why, if portability matters, it's
far better to use a deliberatelr cross-platform scripting system such as
PHP (which, apart from a few more esoteric functions, which run equally
well on any server).

Re: Nested Server Side Includes

On 4/16/2012 2:24 AM, Mark Goodge wrote:
<snip>\

then that would explain why

That is fairly put.

PHP runs well on IIS although it is annoying to not have .htaccess.
Properly set up php on IIS is relatively trouble free although it has
been my experience that there are more people on the IIS side than the
*nix side who should not be managing and setting up servers! YMMV.

Re: Nested Server Side Includes

On 4/20/2012 7:19 AM, Jerry Stuckle wrote:

Perhaps it is something they restrict on their virtual servers. At least
on the one I was working on. I thought it was odd and made a mental
note. I got a response explaining that is was off for security reasons.

I have other complaints about GoDaddy virtual servers, not the least of
which is that the DOCUMENT_ROOT is the set not for the domain's document
root but for the virtual hosting root.