Click to See Complete Forum and Search --> : SSI Weirdness :(


Simplayer9
08-18-2001, 10:14 PM
-Quick Summary of thread: SSI works fine in normal /var/www/html dir, but not in users public_html dir, httpd.conf file posted here (http://htnet.cjb.net/~rzinchak/httpd.conf)-


Ok, I can include a file that's relative to another file using virtual (<!--#include virtual="../coranto/headlines.txt" --> ) but I'd rather be able to include it using an absolute path (<!--#include file="/home/user/public_html/coranto/headlines.txt" --> ), however, I can't figure out the path I should use, as I've tried just about every combination. Assuming I am a user and my URL is http://myserver/~user/ how should I include files using an absolute path? (not a relative one)

Also - On other servers, it's normally virtual = absolute path, file = relative path, but it seems different on my server since I can only get virtual to act as a relative path. That is unless this (http://www.carleton.ca/~dmcfet/html/include.html) page is incorrect.)

Thanks for all your help!

[ 27 August 2001: Message edited by: Simplayer9 - Quick Summary added to make replying easier :) ]

[ 27 August 2001: Message edited by: Simplayer9 ]

freebsd
08-19-2001, 05:24 AM
>> <!--#include virtual="../coranto/headlines.txt" -->

First off, unlike PHP's include, SSI takes a little more security measure by not allowing ../ in any situation.

>> Assuming I am a user and my URL is http://myserver/~user/ how should I include files using an absolute path?

You can't include file above your docroot. The absolute path MUST be an absolute path starting from your docroot (/home/user/public_html in this case). That said, you can't include /home/user/private/footer.txt becuase footer.txt is not under your docroot. That is to say, the absolute path by all means is the absolute URL path, not absolute filesystem path.

If you must use absolute filesystem path, use <!--#exec cmd="/server/path/to/file.txt" --> instead.

[ 19 August 2001: Message edited by: freebsd ]

Simplayer9
08-19-2001, 02:01 PM
Thanks for the reply!

>> First off, unlike PHP's include, SSI takes a little more security measure by not allowing ../ in any situation
Weird, because the only way I can include news.txt is <!--#include virtual="../coranto/news.txt" --> (It won't work without the dots since the .shtml is in a different folder than coranto)

>> You can't include file above your docroot
That's alright, I just want to specify a file using an absolute path (starting from my docroot, I guess), otherwise, if the .sthml is moved to a different folder, the SSI doesn't work.

>> If you must use absolute filesystem path, use <!--#exec cmd="/server/path/to/file.txt" --> instead.
I tried using <!--#exec cmd="/home/user/public_html/coranto/news.txt" --> however, this did not work :( I did not get an error or anything, nor did I even see it as a comment when I looked at the output shtml, so I can only assume that it's been blocked for better security, which is probably better anyways.

Perhaps it'll help if I list what I've tried:
Using Virtual:
Works, but only relative - ../coranto/news.txt
Doesn't work - /coranto/news.txt
Doesn't work - coranto/news.txt
Doesn't work - public_html/coranto/news.txt
Doesn't work - /public_html/coranto/news.txt
Doesn't work - /user/public_html/coranto/news.txt
Doesn't work - user/public_html/coranto/news.txt
Doesn't work - ~user/public_html/coranto/news.txt
Doesn't work - home/user/public_html/coranto/news.txt
Doesn't work - /home/user/public_html/coranto/news.txt

Using File:
Doesn't work - ../coranto/news.txt
Doesn't work - /coranto/news.txt
Doesn't work - coranto/news.txt
Doesn't work - public_html/coranto/news.txt
Doesn't work - /public_html/coranto/news.txt
Doesn't work - /user/public_html/coranto/news.txt
Doesn't work - user/public_html/coranto/news.txt
Doesn't work - ~user/public_html/coranto/news.txt
Doesn't work - home/user/public_html/coranto/news.txt
Doesn't work - /home/user/public_html/coranto/news.txt

Anyone know how I can get an absolute path (from docroot or anywhere else)? Maybe my settings are wrong or something?

[ 19 August 2001: Message edited by: Simplayer9 ]

Simplayer9
08-21-2001, 05:50 PM
Maybe it would also help if I post the relevant part of my httpd.conf file (the part for permissions of users)

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI Includes
Order allow,deny
Allow from all
</Directory>

Simplayer9
08-26-2001, 05:07 PM
Some more information for you:
SSI works fine in the normal /var/www/html but not in the user's dir. Please look at my httpd.conf file here (http://htnet.cjb.net/~rzinchak/httpd.conf) and let me know what's wrong.

Simplayer9
08-29-2001, 05:16 PM
Please, someone, help me out - I just can't figure it out :confused: