LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-13-2005, 03:55 AM   #1
snip128
Member
 
Registered: Jan 2004
Location: Delaware
Distribution: gentoo
Posts: 96

Rep: Reputation: 15
apache 2 problem (ssi)


ok, i have a webpage, using modified headers and footers for directory listing...part of the header includes..

Code:
<!--#echo var="REQUEST_URI" -->
from what i understand, in order to make that display the current path, i need to have ssi (server side includes) up and running...i have added..

Code:
AddType text/html .shtml
AddHandler server-parsed .shtml
to both the apache.conf and "default" site configuration...i linked /etc/apache2/mods-available/include.load to /etc/apache2/mods-enabled/include.load, so the include_module should be running. I have also added Options +Includes to the default site file under <Directory /> and <Directory /var/www> sections...the files with <!--#echo var="REQUEST_URI" --> are shtml files... (.header.shtml and .readme.shtml)...it still only says "index of" and leaves the rest blank (in the source, the words index of are before <!--#echo var="REQUEST_URI" -->) soo...it'd be nice if i could get this working...do i need something besides ssi to get this working? did i miss configuring something?

thx for the help,
chris

oh, im running debian linux in case that matters.. >.>
 
Old 08-13-2005, 09:45 PM   #2
eerwitt
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
In apache2 I usually take out:
AddHandler server-parsed .shtml
And leave in the AddType text/html .shtml

Also make sure you do not have any other Options overriding the option for +Includes. So for example I would have something like this, I also think debian sarge requires IncludesNoExec to be on:

AddType text/html .shtml
NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www/
<Directory />
Options +Includes IncludesNoExec FollowSymLinks
SetOutputFilter INCLUDES
AllowOverride None
</Directory>
</VirtualHost>

I would test with something simple like:
<!--#echo var="DATE_LOCAL" -->

The last thing I would check is to make sure the link is correct, if it is creating a problem look for a sigfault in the errorlog.
 
Old 08-14-2005, 01:57 AM   #3
snip128
Member
 
Registered: Jan 2004
Location: Delaware
Distribution: gentoo
Posts: 96

Original Poster
Rep: Reputation: 15
ummm ok! the <!--#echo var="DATE_LOCAL" --> WORKED! but the <!--#echo var="REQUEST_URI" --> still doesnt...i coulda sworn that was in a list of ssi commands...do i have to configure it or something? is there something besides ssi that would do it??

EDIT: hmmm...ok im getting somewhere now...it doesnt work in subdirectories! it treats it as a comment from subdirectories...does that help any? it only works if the script is in a file in /var/www...

Last edited by snip128; 08-14-2005 at 02:51 AM.
 
Old 08-14-2005, 01:03 PM   #4
eerwitt
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
Hrmm, it sounds like either you have an Options statement overriding those subdirectories or you have set it up to only be the root directory. It would be nice if you uploaded your config. Otherwise if I were configuring my root directory and all other directories to be ssi I would have the following directory block in my config:
NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www/
<Directory /var/www/>
Options +Includes IncludesNoExec FollowSymLinks
SetOutputFilter INCLUDES
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel debug
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>

 
Old 08-14-2005, 01:43 PM   #5
snip128
Member
 
Registered: Jan 2004
Location: Delaware
Distribution: gentoo
Posts: 96

Original Poster
Rep: Reputation: 15
heres the config files

apache2.conf

default site configuration

hehe, i forget why i needed to add the /var/www/uftp sdirectory to the site config lol..nd in apache2.conf, ignore the sun lines LOL i deleted those cuz it misconfigured... >.>
 
Old 08-14-2005, 02:15 PM   #6
eerwitt
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
For the virtual host config file change:
<Directory />
Options FollowSymLinks
AllowOverride none
#AddType text/html .shtml
#AddHandler server-parsed .shtml
SetOutputFilter INCLUDES
</Directory>
To:
<Directory />
Options Indexes FollowSymLinks +Includes IncludesNoExec
AllowOverride none
SetOutputFilter INCLUDES
</Directory>


And Change This:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride all
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# RedirectMatch ^/$ /apache2-default/
AddType text/html .shtml
AddHandler server-parsed .shtml
</Directory>
To:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes IncludesNoExec
SetOutputFilter INCLUDES
AllowOverride all
Order allow,deny
allow from all
</Directory>

Give that a try and I believe it will work.
 
Old 08-14-2005, 03:41 PM   #7
snip128
Member
 
Registered: Jan 2004
Location: Delaware
Distribution: gentoo
Posts: 96

Original Poster
Rep: Reputation: 15
nope, still doesnt work =/ eh i think i found the problem though...

.htaccess files

im still trying to figure out how these work...i used to think that i needed them in every directory so that the index directory listing will load the readme.shtml and header.shtml but i deleted them, and it still uses the header and readme like 3 subdirectories down...and the script doesnt work...but anyway, when i put the .htaccess file i use in /var/www the ssi no longer works...

so basically, is there somewhere i can specify for it to use the .readme.shtml and .header.shtml in ever directory, so i can delete the .htaccess files (the easy way), or is there a way i can add a directive or something to the .htaccess files to make it work? (the hard way)
 
Old 08-14-2005, 03:47 PM   #8
eerwitt
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
Yes, you can put directives directly into your htaccess file. In this case those htaccess files probably have an option directive that is overriding the one in your config file. Make sure the option directives in your .htaccess files have the following:
Options +Includes

I am not sure as to what you mean by using the .readme.shtml files. Hrmm,
 
Old 08-14-2005, 04:49 PM   #9
snip128
Member
 
Registered: Jan 2004
Location: Delaware
Distribution: gentoo
Posts: 96

Original Poster
Rep: Reputation: 15
i cant add +Options to .htaccess files =/ when i do it says "Internal Server Error" blah blah blah lol umm...yea..the .header.shtml and .readme.shtml just add a header and footer to the index directory listing, and makes the directory listing use the style of the .header.shtml file, effectively making them look very nice..this is whats in my .htaccess file..

Code:
Options Indexes
IndexOptions -FancyIndexing +IgnoreCase +SuppressDescription NameWidth=* +SuppressHTMLPreamble +FoldersFirst
HeaderName .header.shtml
ReadmeName .readme.shtml
 
Old 08-14-2005, 06:44 PM   #10
eerwitt
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
For the .htaccess file you would add +Includes under the already existing Options directive like so
Options Indexes +Includes IncludesNoExec
IndexOptions -FancyIndexing +IgnoreCase +SuppressDescription NameWidth=* +SuppressHTMLPreamble +FoldersFirst
HeaderName .header.shtml
ReadmeName .readme.shtml
Or you can just put the HeaderName and ReadmeName under the main config like so and not use your .htaccess:
<IfModule mod_autoindex.c>
IndexOptions FancyIndexing IgnoreCase VersionSort SuppressHTMLPreamble
ReadmeName /var/www/footer.shtml
HeaderName /var/www/header.shtml
</IfModule>
 
Old 08-14-2005, 10:45 PM   #11
snip128
Member
 
Registered: Jan 2004
Location: Delaware
Distribution: gentoo
Posts: 96

Original Poster
Rep: Reputation: 15
Talking

yea, i just redid the .htaccess files...since it apparently controls all the subdirectories though, it was extremely easy...works just great now, thanks a lot for all your help eerwitt!
 
Old 08-14-2005, 11:09 PM   #12
eerwitt
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
No prob, glad it works.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Config Hell: SSI SocialEngineer Linux - Networking 3 08-01-2005 10:22 PM
SSI and Apache 2 krumholz Linux - General 6 10-05-2003 08:50 PM
problem with SSI configration on apache 2.0 garfield Linux - Newbie 0 10-12-2002 06:32 AM
ssi in apache lustra Linux - Networking 0 02-28-2002 07:41 PM
Apache and SSI? phek Linux - Newbie 2 10-24-2001 05:26 PM


All times are GMT -5. The time now is 02:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration