Discussion:
Activating server-side includes in main/root directory
(too old to reply)
Michael Stemper
2012-10-01 15:09:13 UTC
Permalink
I cannot figure out how to enable server-side includes in my site's
root directory. (I don't even know if this is the right term. It's
the directory that gets served up in response to "http://127.0.0.1/"
or "http://localhost/".)

I've managed to enable SSI for user directories without any problem,
with the following directives:

<Directory /home/*/public_html/>
Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>

I have tried copying those directives and modifying them to refer to:
<Directory />
<Directory /var/www>
<Directory /var/www/>

None of these has any apparent effect. I restart the server, and call
up my test page, but the content that I expect is not included. The
error log gives the following message when I call up a *.shtml file
from /var/www:

[Sat Sep 29 15:27:55 2012] [warn] [client 127.0.0.1] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed

Since "Options +Includes" is right in there, it would seem that I'm not
specifying the directory properly. What is the proper way to refer to
this directory?
--
Michael F. Stemper
#include <Standard_Disclaimer>
Life's too important to take seriously.
D. Stussy
2012-10-01 22:13:27 UTC
Permalink
"Michael Stemper" wrote in message news:k4cbmp$r9o$***@dont-email.me...
I cannot figure out how to enable server-side includes in my site's
root directory.

...

Since "Options +Includes" is right in there, it would seem that I'm not
specifying the directory properly. What is the proper way to refer to
this directory?
==============================
Note:

<Directory />
Options +Includes

Is definitely BAD coding and dangerous even if syntactically valid. Since it
specifies the root of your entire file system, it's directives should be
absolute, not additional or subtractive to an unspecified default.

The term you're looking for is "document root directory." IT should NOT be
the filesystem's directory. Usually, the user directories are NOT under it
either in the overall file system, so "/home/*/html" (e.g., or whatever you
choose to map as user's HTML pages) should also have an absolute options
statement.
Michael Stemper
2012-10-02 17:23:09 UTC
Permalink
Post by Michael Stemper
I cannot figure out how to enable server-side includes in my site's
root directory.
Since "Options +Includes" is right in there, it would seem that I'm not
specifying the directory properly. What is the proper way to refer to
this directory?
==============================
<Directory />
Options +Includes
Is definitely BAD coding and dangerous even if syntactically valid.
I was trying stuff on a cargo-cult basis. It didn't have the desired
effect, so it's gone.
Post by Michael Stemper
The term you're looking for is "document root directory."
Thanks. How do I specify this directory in the head of a Directory block
in my httpd.conf file?
Post by Michael Stemper
IT should NOT be
the filesystem's directory.
In other words, are you saying that the right way is *not*
<Directory /var/www/>

Since that didn't work (as I mentioned in my original post), that seems
plausible. What, pray tell, is the right way?
Post by Michael Stemper
Usually, the user directories are NOT under it
either in the overall file system, so "/home/*/html" (e.g., or whatever you
choose to map as user's HTML pages)
As I said in my original post, user directories are in
<Directory /home/*/public_html/>
and includes are working just fine for them.
--
Michael F. Stemper
#include <Standard_Disclaimer>
Life's too important to take seriously.
D. Stussy
2012-10-03 06:41:39 UTC
Permalink
Post by Michael Stemper
I cannot figure out how to enable server-side includes in my site's
root directory.
Since "Options +Includes" is right in there, it would seem that I'm not
specifying the directory properly. What is the proper way to refer to
this directory?
==============================
<Directory />
Options +Includes
Is definitely BAD coding and dangerous even if syntactically valid.
I was trying stuff on a cargo-cult basis. It didn't have the desired
effect, so it's gone.
Post by Michael Stemper
The term you're looking for is "document root directory."
Thanks. How do I specify this directory in the head of a Directory block
in my httpd.conf file?
Post by Michael Stemper
IT should NOT be
the filesystem's directory.
In other words, are you saying that the right way is *not*
<Directory /var/www/>
====================
What I said is that it should not be:
<Directory />
====================

Since that didn't work (as I mentioned in my original post), that seems
plausible. What, pray tell, is the right way?
Post by Michael Stemper
Usually, the user directories are NOT under it
either in the overall file system, so "/home/*/html" (e.g., or whatever you
choose to map as user's HTML pages)
As I said in my original post, user directories are in
<Directory /home/*/public_html/>
and includes are working just fine for them.
Michael Stemper
2012-10-03 12:43:10 UTC
Permalink
Post by D. Stussy
Post by Michael Stemper
Post by D. Stussy
IT should NOT be
the filesystem's directory.
In other words, are you saying that the right way is *not*
<Directory /var/www/>
====================
<Directory />
====================
You said it shouldn't be the filesystem's directory. Since the filesystem
considers the directory to be "/var/www/", that would be the filesystem's
directory.

How does one specify directory this in a "Directory" statement? Do you know?
--
Michael F. Stemper
#include <Standard_Disclaimer>
Life's too important to take seriously.
Álvaro G. Vicario
2012-10-03 17:02:11 UTC
Permalink
Post by Michael Stemper
In other words, are you saying that the right way is*not*
<Directory/var/www/>
====================
<Directory />
====================
You said it shouldn't be the filesystem's directory. Since the filesystem
considers the directory to be "/var/www/", that would be the filesystem's
directory.
How does one specify directory this in a "Directory" statement? Do you know?
Please note that some directives expect URLs and some others expect file
system paths. There's nothing intrinsically wrong with e.g.:

<Location />
AllowOverride All
</Location>

... but this:

<Directory />
AllowOverride All
</Directory>

... will inadvertently grant unnecessary stuff for the whole hard disc.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Michael Stemper
2012-10-03 17:16:15 UTC
Permalink
Post by Álvaro G. Vicario
Post by Michael Stemper
In other words, are you saying that the right way is*not*
<Directory/var/www/>
====================
<Directory />
====================
You said it shouldn't be the filesystem's directory. Since the filesystem
considers the directory to be "/var/www/", that would be the filesystem's
directory.
How does one specify directory this in a "Directory" statement? Do you know?
Please note that some directives expect URLs and some others expect file
<Location />
AllowOverride All
</Location>
<Directory />
AllowOverride All
</Directory>
... will inadvertently grant unnecessary stuff for the whole hard disc.
That's great. Do you know how to enable SSI for "/var/www/" (assuming
that's the directory served up in response to "http://localhost/")?
--
Michael F. Stemper
#include <Standard_Disclaimer>
Life's too important to take seriously.
D. Stussy
2012-10-03 20:08:44 UTC
Permalink
Post by D. Stussy
Post by Michael Stemper
Post by D. Stussy
IT should NOT be
the filesystem's directory.
In other words, are you saying that the right way is *not*
<Directory /var/www/>
====================
<Directory />
====================
You said it shouldn't be the filesystem's directory. Since the filesystem
considers the directory to be "/var/www/", that would be the filesystem's
directory.

How does one specify directory this in a "Directory" statement? Do you know?
========================
I said it shouldn't be the file system's ROOT directory.
Michael Stemper
2012-10-04 12:26:18 UTC
Permalink
Post by Michael Stemper
Post by D. Stussy
Post by Michael Stemper
Post by D. Stussy
IT should NOT be
the filesystem's directory.
See these words right here? The words that say "IT should NOT be the
filesystem's directory"? Those are your words.
Post by Michael Stemper
Post by D. Stussy
Post by Michael Stemper
In other words, are you saying that the right way is *not*
<Directory /var/www/>
====================
<Directory />
====================
You said it shouldn't be the filesystem's directory. Since the filesystem
considers the directory to be "/var/www/", that would be the filesystem's
directory.
How does one specify directory this in a "Directory" statement? Do you know?
========================
I said it shouldn't be the file system's ROOT directory.
Take a look at YOUR words directly above.

But, aside from knowing what not to do, do you actually have an answer
to my question?

I'll try asking it again.

1. When I request a document from "http://localhost?", my server serves up
whatever it finds in "/var/www/".
2. I would like to enable server-side includes for this directory.
3. How do I specify this directory in a <Directory xxx> statement?
--
Michael F. Stemper
#include <Standard_Disclaimer>
Life's too important to take seriously.
D. Stussy
2012-10-05 19:09:35 UTC
Permalink
Post by Michael Stemper
Post by D. Stussy
Post by Michael Stemper
Post by D. Stussy
IT should NOT be
the filesystem's directory.
See these words right here? The words that say "IT should NOT be the
filesystem's directory"? Those are your words.
Post by Michael Stemper
Post by D. Stussy
Post by Michael Stemper
In other words, are you saying that the right way is *not*
<Directory /var/www/>
====================
<Directory />
====================
You said it shouldn't be the filesystem's directory. Since the filesystem
considers the directory to be "/var/www/", that would be the filesystem's
directory.
How does one specify directory this in a "Directory" statement? Do you know?
========================
I said it shouldn't be the file system's ROOT directory.
Take a look at YOUR words directly above.
==============
Look at the CONTEXT I was addressing:

<Directory />

That IS the file system's ROOT directory.
==============

But, aside from knowing what not to do, do you actually have an answer
to my question?

I'll try asking it again.

1. When I request a document from "http://localhost?", my server serves up
whatever it finds in "/var/www/".
2. I would like to enable server-side includes for this directory.
3. How do I specify this directory in a <Directory xxx> statement?
=================
As:

<Directory /var/www>

Continue reading on narkive:
Search results for 'Activating server-side includes in main/root directory' (Questions and Answers)
5
replies
can i get question answer of asp.net ?
started 2006-10-11 00:02:47 UTC
software
Loading...