PDA

View Full Version : OSX Server and SSI (Server Side Includes)


John David Eriksen
12-20-2002, 08:50 PM
:mad: I have come to the conclusion that Apples OSX Server SSI documentation leaves alot to be desired. (read sucks). I can find nowhere, a definative complete list of what SSI Commands and arguments are supported. (if anyone know a good URL Pls pass it on) The Apache docs are really no better...

I am trying to migrate from WebStar to OSX Server (using Apache). with fair sucess.. BUT...

I have a simple SSI statement that has worked for years under WebStar, that ABSOLUTLY WILL NOT RUN under apache.

The following code runs the random selection of the two top images at:

<http://www.hotrodsonline.com/>

As follows:

<P><CENTER><!--#config newrandom="17"--><IMG SRC="Art/WelcomeArt/Welcome<!--#echo var="random"-->.jpg" ALIGN="BOTTOM" BORDER="0"><!--#config newrandom="8"--><IMG SRC="Art/TitleArt/<!--#echo var="random"-->.jpg" ALIGN="BOTTOM" BORDER="0"></CENTER>


:) As I said it runs PERFECTLY under WebStar.
:mad: It generates an error under OSX Server (Apache)

And yes I have the latest OSX Server as of last night...!!!

IS the above code, something mac mutant that only runs on Mac webservers using WebStar or is this legal NCSA SSI code..???

Any assistance as to what is wrong would help greatly.

pls respond to john@netmac.net

:cool: Thanks in advance

Jadey
12-20-2002, 09:05 PM
Your code is fine, but you need to turn on SSI support in Apache. Do the following:

Launch terminal and type:

sudo pico /etc/httpd/httpd.conf

Scroll down (control-v) until you get to the lines:

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

Uncomment those 2 lines (remove the # in front of each of them).

Now look in the same file for the following:

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

Add "Includes" to the 2nd line so it looks like:

Options FollowSymLinks Includes

Now save the file in pico by hitting control-x and restart Apache in your Sharing Control panel.

With this configuration, any files that you want to use server side includes on must end in .shtml

Post back with any questions. :)

John David Eriksen
12-20-2002, 11:26 PM
This is OSX SERVER 10.2.3 and this is what the docs say...
_______________________________________
Enabling Server Side Includes (SSI)

Enabling Server Side Includes (SSI) allows a chunk of HTML code or other information to be shared by different Web pages on your site. SSIs can also function like CGIs and execute commands or scripts on the server.

Note: Enabling SSI requires making changes to UNIX configuration files in the Terminal application. To enable SSI, you must be comfortable with typing UNIX commands and using a UNIX text editor.
To enable SSI:

1 In the Terminal application, use a text editor to edit /etc/httpd/httpd_macosxserver.conf

2 Add the following line to each virtual host for which you want SSI enabled:
Options Includes
To enable SSI for all virtual hosts, add the line outside any virtual host block.

3 In Server Settings, click Web and add “index.shtml” to the set of default index files for each virtual host.
By default, the mime_macosxserver.conf file maintained by server settings contains the following two lines:

AddHandler server-parsed shtml
AddType text/html shtml

If your SSI files use a file extension other than .shtml you should add that type to the mime_macosxserver.conf file.

You can add MIME types in Server Settings from the MIME Types tab.
The changes take effect when you restart the Web service.

END--
____________________________________________
Before I made these changes as described above.. the rendered page showed NOTHING (no images no errors nothing...)

After I added the following instruction:
Options Includes

to the file:
/etc/httpd/httpd_macosxserver.conf

As instructed..
It did show something.. the error...
telling me it saw the code but didnt like it 8-\ (wonderful)
____________________________________________
I am now uncertain about the next thing to do...

any advice

:confused: H E L P

John David Eriksen
12-21-2002, 08:49 AM
OK dude...
not withstanding the above comments...

Item one: You instructions to...
________
Launch terminal and type:

sudo pico /etc/httpd/httpd.conf

Scroll down (control-v) until you get to the lines:

# AddType text/html .shtml
# AddHandler server-parsed .shtml
________
OK...
Went there.. looked at it..
the comments DIRECTLY above it in the block said SPECIFICALLY say (because it is OSX Server) DO NOT UNCOMMENT this code... :eek:
B E C A U S E the functionality is handled by the the Server Settings app (which BTW it is correctly set in that app)
with directives in: mime_macosxserver.conf (does not give the full path to file.. and dude... I CAN'T FIND that file period). :confused:
===================
Item two

Now look in the same file for the following:

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

_________________
That text DOES NOT EXIT in the:
/etc/httpd/httpd.conf file...

Period..
===================
:confused:Any other ideas...
I am now TOTALLY confused
a n y o n e...

:( PLEEZE... man I'm sayin pleeze

Thanks in advance

Jadey
12-21-2002, 07:49 PM
Apple's instructions for enabling SSI on OS X Server:

http://docs.info.apple.com/article.html?artnum=106520&SaveKCWindowURL=http%3A%2F%2Fkbase.info.apple.com%2Fcgi-bin%2FWebObjects%2Fkbase.woa%2Fwa%2FSaveKCToHomePage&searchMode=Assisted&kbhost=kbase.info.apple.com&showButton=false&randomValue=100&showSurvey=false&sessionID=anonymous|160289471

And please stop calling this girl "dude" :)

John David Eriksen
12-21-2002, 08:46 PM
And please stop calling this girl "dude"
Opps s o r r y..
____________________
This is OSX Server 10.2.3 something MUST be different as all the configs are already there but still no workie...

dont want all html to be server parsed
Looked at the SHTML only variations ...

its already there and entered properly

I'm fresh outta ideas.

Jadey
12-21-2002, 08:48 PM
It'd help if you posted the errors you're getting from the browser and your error_log

John David Eriksen
12-21-2002, 09:05 PM
Browser Explorer 5.2.2 (5010.1) says: [an error occurred while processing this directive]

Web log:

209.140.3.200 - - [21/Dec/2002:22:00:39 -0500] "GET /hotrod/home/home.shtml HTTP/1.1" 200 11264
209.140.3.200 - - [21/Dec/2002:22:00:39 -0500] "GET /hotrod/home/Art/WelcomeArt/Welcome(none).jpg HTTP/1.1" 404 340

(first is the page listing and the second is the image listing... note the word "none"

404 and 340 error

Error Log shows NOTHING

If you want to mail me direct my address is: john@netmac.net

Thanks

Jadey
12-22-2002, 05:26 PM
Looks like SSI is actually working and there's either a permissions or path problem. Did you try changing permissions? Also, I don't know what the paths are like on OS X Server, but user's home directories start with /User on OS X client, not /home are you certain the path is correct?

John David Eriksen
12-22-2002, 07:25 PM
Now... I thought of that (in the same thought you usually have about running CGI/BIN stuff) but its docs don't say anything about NOT doing it from there and thee is no mention of doing anything special to accomodate SSI in the Apache docs or at NSCA.. soooo I have to assume its OK where it presently is, unless someone has evidence to the contrary. Webstar runn SSI fine just where they are so i am assuming (maybe wrongly)

In osx server the path structure looks like:

[disk name]/library/webserver/documents/[site directory name]/index.html

permissions... I will have to check that everything is OK but that is a good point.. I would not have thought anything would have changed but I have moved files into those directories via a varity of method

ie directly as root / via timbuktu/ via ftp / directly as admin user ect...

however I am getting the same error on all files.. but you are right I should check permissions on all those files.

It just I am now getting the feeling that something in Apples docs is not tellingthe whole story...

some obscure thing was inadvertantly left out of the documentation that is critical to this all running correctly.. but have completely run outta ideas as to what that could be... 8-\

bummed

Jadey
12-22-2002, 08:31 PM
Yeah, if the path on server is /Library/WebServer/Documents, you'll have to change it to that in your include as it's looking for "/hotrod/home/home.shtml" etc.

It's too bad X server is so poorly documented :(

towermac
01-30-2006, 10:14 AM
I feel kind of thick, I thought I had included "includes" in options before, but that fixed me up. Just wanted to let you know.

geoff