[solved] localhost server side includes (SSI)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
harritapio
Posts: 28
Joined: 2012-06-05 06:05
Location: Pori, Finland
Has thanked: 2 times

[solved] localhost server side includes (SSI)

#1 Post by harritapio »

hello
I have not succeeded to activate apache2.4 "server side includes" on my localhost. I have debian jessie (stable) installation and the web server is running ok, but with SSI services nothing happens.

Any advice is welcome!

regards: Harri
Last edited by harritapio on 2016-10-31 04:59, edited 1 time in total.
Harri

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: localhost server side includes (SSI)

#2 Post by ralph.ronnquist »

Gratuitously: Google's first suggestion is http://httpd.apache.org/docs/current/howto/ssi.html

Been there? Done that?

harritapio
Posts: 28
Joined: 2012-06-05 06:05
Location: Pori, Finland
Has thanked: 2 times

Re: localhost server side includes (SSI)

#3 Post by harritapio »

Yes, I have been there and done the modifications. Unfortunately SSI does not give any response!
Harri

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5423
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 18 times
Been thanked: 81 times

Re: localhost server side includes (SSI)

#4 Post by dilberts_left_nut »

Maybe you should explain what you are trying, what you expect to happen and what actually happens - in detail.
AdrianTM wrote:There's no hacker in my grandma...

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: localhost server side includes (SSI)

#5 Post by ralph.ronnquist »

+lots @dilberts_left_nut

Which particular nothing is it that doesn't happens? Perhaps it is that you do have a page named example.shtml that contains an SSI comment for today's date, and when you access that page you see all else, but that comment is not replaced by today's date?

And you have already followed up on that which "Chas" wrote 83 days ago, to make sure it doesn't apply for you?

harritapio
Posts: 28
Joined: 2012-06-05 06:05
Location: Pori, Finland
Has thanked: 2 times

Re: localhost server side includes (SSI)

#6 Post by harritapio »

Ok, I will try to explain more.

I'm testing new web pages on my local computer (debian jessie stable) before loading them to the server. Localhost is working correctly, and as a matter of fact I can test all pages already now. With SSI I thought to include e.g. standard header/footer to the pages

Code: Select all

<!--#include virtual="file.shtml" -->
I can manage the task without SSI but if I can make it work, it's an interesting option to add some basic functionality to web pages.

When I add this sentence

Code: Select all

<!--#include virtual="file.shtml" -->
into an html page and open it in web browser, the page opens correct but nothing from SSI is included. When I check the "page source" from opened web page I can see the included SSI sentence there but for some reason SSI is not activated. I have checked also apache error log - nothing relevant there.

I have tested the functionality as a normal user and as a root - it makes no difference.

Thank you for your replies!
Harri

User avatar
ralph.ronnquist
Posts: 342
Joined: 2015-12-19 01:07
Location: Melbourne, Australia
Been thanked: 6 times

Re: localhost server side includes (SSI)

#7 Post by ralph.ronnquist »

Again; first google hit for "SSI include virtual"
http://www.htmlgoodies.com/beyond/webma ... ommand.htm says:
You would use the virtual argument if the file you are calling for is located in a position requiring an address starting at the server root. That's an academic way of saying the file isn't in the same directory as the page that's calling for it.
A relative file name might be interpreted relative to the current working directory of the server? To quote further:
Rule of Thumb
Use "file=" when the included file is within the same directory as the page that wants it. Use "virtual=" when it isn't.
.. or maybe your problem is something else?

harritapio
Posts: 28
Joined: 2012-06-05 06:05
Location: Pori, Finland
Has thanked: 2 times

Re: localhost server side includes (SSI)

#8 Post by harritapio »

Good news, I got it working on server!

I used the info you told on previous message and the response from server is ok. I must use .shtml files for SSI but that's ok.

Code: Select all

<!--#include virtual
was false

Code: Select all

<!--#include
is the way to go.

Thank you for your advice!
Harri

Post Reply