Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shtml on Mac Tiger with Apache 1

Status
Not open for further replies.

Shrp

IS-IT--Management
Jan 9, 2002
82
US
I have Apache running on my PowerBook running Mac OSX 10.4.4 (not server). It's the version of Apache that came with Tiger, the OS.

I want to enable shtml files, but the include lines are not interpreted, and they don't result in an error. A "view source" just spits out the html and the include line.

I have the following lines uncommented in my httpd.conf:

/private/etc/httpd% grep shtml httpd.conf
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddType text/html .shtml
AddHandler server-parsed .shtml

I have the following line in my shtml file in attempt to include the html code in a file called 'h.txt':
<!--#include virtual="h2.txt" -->

The shtml and h.txt files are both world-read/execute.

If I upload these same shtml files to my website, they work just fine.

Thanks!
 
Do you have mod_include loaded in your httpd.conf?

LoadModule include_module modules/mod_include.so

You also need to set
Options +Includes
in the locations/directories where you want to enabled SSI

Jeb Beasley
 
I had the mod_include loaded, but the 'Options +Includes' setting did the trick! Thanks so much!
 
Greetings, I hope it's ok to pull this post from the past instead of repeating the exact same topic with a new one.

I've got the same setup (except I'm on 10.4.5) and problem that Shrp did, but I've changed my /etc/httpd/httpd.conf file and it hasn't seemed to make a difference. The following lines are in that file:

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

<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymlinks MultiViews Includes
AllowOverride None
Order allow,deny
Allow from all
</Directory>

LoadModule includes_module libexec/httpd/mod_include.so

Not necessarily in that order (does placement matter in this file?). I have restarted the webserver, and the test .shtml file I'm using has a simple date command that works fine on my webhost, but not on my computer. I have also tried using "+Includes" instead of just "Includes", but it didn't seem to make a difference.

I very much appreciate any help! Thanks,

-Joe
 
Hi

Joe said:
(does placement matter in this file?).
Yes. You have to load the modules before the settings which implies them. So be sure that [tt]LoadModule[/tt] is before the other above quoted settings.

( No idea how looks a usual configuration on Mac, but if there is a [tt]ClearModuleList[/tt] directive after the [tt]LoadModule[/tt]s, then you have to put also an [tt]AddModule[/tt] for each loaded module to activate them. )

A typical beginner mistake is to put a directive into the httpd.conf and forgetting to take a look if there is another similar directive below or in a .htaccess file, which overrides the newly inserted one. Just a thought, but you could check that too.

Feherke.
 
It turns out the final answer is that I had successfully turned it on, but I could not see the result from my own computer - someone from outside my local network loaded my test file and it worked fine. :p So next I have to figure out how to get the SSI to resolve locally. (I'll do some research before bothering you good folks, but if you know off the top of your head, feel free to pipe up! ;-))

Thank you all for your help!

-Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top