Page 2 of 3
Re: SSI problem
Posted: Wed Jan 22, 2014 11:06 am
by pepe_carlos
Hello again,
I try this and the example works
I configured the httpd.conf and included the text indicated in the link:
Code: Select all
Options +Includes
AddType text/html .shtml
AddHandler server-parsed .shtm
I put the test.shtml in /usr/local/nagios/share with the source code:
when i accessed to this shtml this show:
Wednesday, 22-Jan-2014 17:14:13 CET
but ssi still doesn't work

Re: SSI problem
Posted: Wed Jan 22, 2014 11:37 am
by tmcdonald
Looks like it is working to me. What makes you think it is not? The only thing I can see that might be wrong is you wrote "shtm" instead of "shtml" in your config, bottom line.
Re: SSI problem
Posted: Wed Jan 22, 2014 11:43 am
by pepe_carlos
Sorry, but this mistake was copy/paste problem here

(in httpd.conf is ok)
although the example works, the content in ssi file continue without appear in web page extinfo.cgi
Re: SSI problem
Posted: Wed Jan 22, 2014 11:49 am
by tmcdonald
Well of course it won't appear there because you named it test.shtml
extinfo-footer.ssi is the name of the file that the CGI pulls from. I thought you were saying the example doesn't work. You will need to put your code in the appropriate file and add the .ssi handler to the httpd.conf file. The CGI won't pull in just any old file in the SSI directory.
Re: SSI problem
Posted: Wed Jan 22, 2014 12:06 pm
by pepe_carlos
Sorry, but i don't understand this:
put your code in the appropriate file and add the .ssi handler to the httpd.conf file
In what file put the code? in ssi file? What I need to modify the httpd.conf file?
Thanks.
Re: SSI problem
Posted: Wed Jan 22, 2014 12:11 pm
by tmcdonald
You had said previously that you put your code into extinfo-footer.ssi, and in my last post I said that's where it should go. And if you are using .ssi files and not .shtml files, then you will need to make that change in the httpd.conf file. Change the .shtml extension to .ssi and save.
Re: SSI problem
Posted: Wed Jan 22, 2014 12:30 pm
by pepe_carlos
I put the next configuration in httpd.conf:
Code: Select all
Options +Includes
AddType text/html .ssi
AddOutputFilter INCLUDES .ssi
and restart the apache, but still doesn't work

Re: SSI problem
Posted: Wed Jan 22, 2014 12:37 pm
by tmcdonald
That's because you didn't make the changes I suggested.
tmcdonald wrote:You had said previously that you put your code into extinfo-footer.ssi, and in my last post I said that's where it should go.
You need to open the extinfo-footer.ssi file in a text editor, type in whatever you want to be displayed on the page, save the file and close it. Putting your code in test.shtml will not work because the CGI program does not look for a file named test.shtml and therefor cannot include it.
tmcdonald wrote:And if you are using .ssi files and not .shtml files, then you will need to make that change in the httpd.conf file. Change the .shtml extension to .ssi and save.
You need to open the httpd.conf file in a text editor, and change
Code: Select all
Options +Includes
AddType text/html .shtml
AddHandler server-parsed .shtml
to
Code: Select all
Options +Includes
AddType text/html .ssi
AddHandler server-parsed .ssi
Re: SSI problem
Posted: Wed Jan 22, 2014 12:48 pm
by pepe_carlos
That's exactly what I've done but not working
Re: SSI problem
Posted: Wed Jan 22, 2014 5:44 pm
by tmcdonald
Can you show us a directory listing of the SSI folder, with permissions? Also, post the section of your httpd.conf that you've been editing, and the actual SSI file you are writing.