server7 ssi not working

I am running sun java web server 7 and trying to support php and can't quite get the server side includes to work. I have tried the general tab under content handling tab under the virtual servers section. Parsed HTML/SSI Settings is enables for all html files. But so far the ssi's are not working.

[308 byte] By [livermorea] at [2007-11-27 5:19:02]
# 1

I tested ssi on my webserver 7.0 and it is working for me.

Here is what I did,

From admin gui, in Content handling tab, I enabled the Server-parsed html

and chose "all html files"

Then I wrote a simple html

<HTML>

<BODY>

Hello from shtml

<!--#echo var="DATE_GMT"-->

</BODY>

</HTML>

When I send the request, I see the date in content.

I tried to enable/disable "With Exec tag" and tested with both conditions and

it worked as expected..

Can you elaborate, what do you mean by ?

"trying to support php and can't quite get the server side includes to work".

Basantka at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...
# 2
ssi engine is part of the webserver while php can be executed as NSAPI php or fastcgi (recommended). Here is the link to php add on for web server 7.0 http://www.sun.com/download/products.xml?id=45c26bc9
Basantka at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

Thanks for the help. I have an index.shtml file and in that file I have two server side includes that do not seem to work.

<!--#include file="/access_root/index-menu-njs.inc" -->

<!--#include virtual="/access_root/index-main.php" -->

I am using the sun provided php add-on. I tried to compile it my self and never got it to work. The sun add-on seems to work just fine. If I add the files manually to the url field (http://"hostname"/index-menu-njs.inc or http://"hostname"/index-main.php) the pages load fine.

obj.conf:NameTrans fn="pfx2dir" from="/access_root" dir="/web/app/access_root/htdocs" (also the document root)"

This issue is not directly php related since the index-menu-njs.inc file will not load either. I tried changing the mime type extension from .inc to .html, but no change in behavior. I have not tried the wadm command yet. I did the ssi configuration through the web based admin console. Under content handeling/general tab I have server-parsed html/ssi settings enabled and parsed files is set to all html files.

Any ideas?

Thanks

livermorea at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...
# 4

In my webserver 7.0, installation, I tried the following shtml (test1.shtml)

<HTML>

<BODY>

Hello from shtml

<!--#include file="/access_root/test1.inc"-->

<!--#include file="/access_root/test.php"-->

</BODY>

</HTML>

It worked as expected. test1.inc was included and content from test.php also

added in the generated html content.

My obj.conf contains the dire

NameTrans fn="pfx2dir" from="/access_root" dir="<same as docroot directory>"

I have a question for you. If you access :

http://<hostname>/access_root/index-menu-njs.inc

or

http://<hostname>/access_root/index-main.php

Does it work fine or not?

Have you put NameTrans statement in right obj.conf file? Virtual servers can

share the same obj.conf file or they can have seperate obj.conf files.

Basantka at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...
# 5
yes I can access both. http://<hostname>/access_root/index-menu-njs.incand http://<hostname>/access_root/index-main.phpHave you put NameTrans statement in right obj.conf file? Yes I only have one virtual server.
livermorea at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...
# 6
When you send the /index.shtml request, what is the response?If response is an error, do you see anything in your error log files?
Basantka at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...
# 7
Some pictures/gif images get posted with no error on web page. I tailed the error log and the access log. No errors and I can see the GET requests in the access log for the gif images.
livermorea at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...
# 8

[nobr]Can you kindly clarify what do you mean by :

"Some pictures/gif images get posted with no error on web page"

Can you try simple test shtml with two include file and test if it works for

you e.g

test.shtml file :

<HTML>

<BODY>

Hello from shtml

<!--#include file="/access_root/test1.inc"-->

<!--#include virtual="/access_root/test.php"-->

</BODY>

</HTML>

test1.inc file :

Hello from test1 included file (inc).<BR>

test.php file :

<?

print "Hello from test.php.";

?>

Then send the request test.shtml to see if it works.

I am still not able to understand the problem. Does index-menu-njs.inc doesn't get

included in response? Or index-main.php doesn't get executed?

Can you explain in detail what is your expected response from webserver and

what is webserver response?[/nobr]

Basantka at 2007-7-12 10:42:20 > top of Java-index,Web & Directory Servers,Web Servers...