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" --> Code:
AddType text/html .shtml thx for the help, chris oh, im running debian linux in case that matters.. >.> |
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. |
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... |
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> :) |
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... >.> |
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. |
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) |
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, ;) |
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 |
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> |
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! :D
|
No prob, glad it works. :)
|
All times are GMT -5. The time now is 08:54 PM. |