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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSI Help needed

Status
Not open for further replies.

mekOne

Technical User
Jan 5, 2002
2
US
I'm hosted on a friends server, and from what i can tell, he may have SSI enabled.

Below are some samples of the httpd.conf and the url

(1) I don't know if Includes has to be here under Options

<Directory &quot;/usr/local/apache/htdocs&quot;>
Options Indexes FollowSymLinks MultiViews


(2) Here it doesn't look like he has cgi's enabled, but I've got them to work (probably because I have them enabled in my Virtualhost area. Would this effect SSI?

# To use CGI scripts:
#
#AddHandler cgi-script .cgi

#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml


(3) My Virtualhost part, edited to show what I think is relivent. Everything works proper. cgi's execute fine from the cgi-bin and I'm not trying to execute a cgi using SSI, just display a text file (further below)

<VirtualHost 192.132.13.69>
ServerName ServerAlias anti-hero.net
ScriptAlias /cgi-bin/ /content/.. /ahn/cgi-bin/
Options +Includes +Indexes
</VirtualHost>


(4) is the page I have the SSI commands in. Everything, it seems is sorted properly.

I should also note that I've tried the .htaccess edit trick and that didn't work either. Also, I've never been able to use striaght directory browsing. Finally, is the file I'm trying to call.

Any help would be great.

-Evan
 
Hi,



















In Apache often statements apply to a particular context, e.g.global, directory, virtual host, and you can place many directives at all of these different levels.









On (1), the Includes statements there apply to the directory container and does not include the SSI related option 'Includes'.



















For (2), if you had SSI enabled globally but not cgi then it wouldn't work if the SSI tags invoked cgi stuff.



















On (3), yes the virtualhost container can have cgi + ssi turned on in isolation to the rest of the server. However, you don't have the 'ExecCGI' option to use cgi in the directory shown (maybe you have a separate cgi directory container). Also, be a bit careful about using + signs in Options Directives - e.g. +Includes (etc). The plus indicates to add to an existing set of options and if there are no pre-existing options then it does nothing. Sometimes for simplicity its easier to just list all the options again fully and use - (minus) for those you don't want just in case they are already there. Using your illustration, an example embedded cgi directory would be :



















<VirtualHost 192.132.13.69>



















ServerName








ServerAlias anti-hero.net









ScriptAlias /cgi-bin/ /content/../ahn/cgi-bin/









Options Includes Indexes



















<Directory &quot;/content/../ahn/cgi-bin/&quot;>









AllowOverride None









Options ExecCGI









Order allow,deny









Allow from all









</Directory>



















</VirtualHost>



















(4) The 'Indexes' keyword on the Options directive controls whether you can browse the directory 'ftp' style. Even if its on, it would only work if there is no DirectoryIndex (e.g., index.html) in a directory .

















Also remember that your SSI tags should be a relative URL - mod_include will construct a self-referential URL using the ServerName.















<!--#include virtual=&quot;/news/news/news.txt&quot; -->


Finally, on modules, make sure you have mod_include and mod_cgi enabled in your httpd.conf.












Hope this helps
 
Okay, i think my problem is in the LoadModule area... i searched through the httpd.conf and didn't find ANY LoadModule lines... but then why would cgi's work if there aren't ANY LoadModule lines anywhere in the httpd.conf?

thanks for all the help.
 
Hi,

If you have a Mandrake Apache install then the module stuff would be in '/etc/httpd/conf/addon-modules' and not in the main httpd.conf .

Otherwise, if you compiled it yourself it is possible that you left out module support all together. In old versions of Apache (pre 1.3) you had to compile everything in but from 1.3 it supports dynamically loadable modules as long as it has been compiled for that.

What version do you have there ?

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top