Mod layout wraps a page, by saying this I mean that it can place information at both the beginning and the end of a document. This allows you do create a single look and feel throughout a website without using server side includes to "automagically" add content in either of these two locations. You can use it to add standard disclaimers to all of the pages on a server or to place banner adds on the top of all pages (I know, banner adds, ick...). I've even seen people use the header and footer to place the entire contents of a given server inside of tables. There are many possibilities.
You can get it from either here via the web or here via ftp.
You are pretty much free to use it as you please. Check out the License file with the distribution for more details. In all likelihood I will switch to either GNU or Apache style licensing at some point in the future.
Send email to brian@tangent.org.
Fill out the form here.
Yes!. Two mailing lists have been created. One is announce-mod_layout@tangent.org which is only used for sending out announcements about new versions of the software. The other is mod_layout@tangent.org which is for general discussion of the sotware and its uses. Send mail to minordomo@tangent.org with a subject of "subscribe announce-mod_layout" or "subscribe mod_layout" to subscribe to either of the mailing list.
A very distant ancestor can be seen at The Virtual Hospital. I know of a few other large sites, but I do not have their permission to list them here. Send me a URL if you have a site using it and I will probably add it to the page.
From the INSTALL file:
Do you use DSO? If so just type make and
as long as apxs is in your path all things
should go smoothly.
If you are not using DSO you should be :)
If for some reason you need to compile
apache try the following:
1. Change the current directory to the directory containing your apache
source distribution.
2. Call the configure script as you normally would and add the switch:
--add-module=<path-to-mod_layout-directory>/mod_layout.c
3. Make sure the build environment is clean by issuing the following
command:
> make clean
4. Build the new httpd binary with:
> make
5. Install the new httpd binary with:
> make install
Use LayoutHandler. AKA
LayoutHanlder foobar/type
It was removed after version 0.5. Why? I went a different direction in the code. I decided to give people the option of using LayoutHandler to add new types instead of predefining them.
Use the following directives:
LayoutDefaultHandlers Off
LayoutHandler text/html.
Performance. If you have some some non-dynamic content then you would be better off using the *TXT directives (If the content is more then a single line you should consider putting it in a seperate file and using LayoutFile and HeaderFile). This way the content will be loaded directly into Apache (unlike the Layout and Header methods, which make call to Apache to process).
I will probably add more in the future. Email me if you have one that you would like to see added in by default.
Three environmental variables are currently added to environmental namespace for Layout and Header files. They are:
Write a cgi/servlet/PHP script and use the LAYOUT_SCRIPT_NAME environmental variable to determine what content you wish to display.
I personally hate them.
You want to know more?
As of version 0.9 I began to test support for the proxy module. Currently I have only tested ProxyPass and it seems to work (any feedback would be appreciated). In cases where a flash file is used as an Index (or any filetype which is not wrappable) the page that is return will be broken. Also, anything that ProxyPass can not support, mod_layout will not support.
Yes. The most common reason to do this is if you are handling frames (and if you are doing frames don't forget to make the header dynamic and smart enough not to wrap itself). This can be done by turning off the wrapped page using "LayoutDisplayOriginal Off".
Yes, as of version 1.2 you can turn this feature on using "LayoutHandlerGlob On". Keep in mind though that depending on the number of types you are wrapping this can slow things down. More effort is needed to determine how much of a performance hit this really is. BTW If you specify something like "*/*", yes you will wrap everything, but this includes images (which will show up corrupted).
Ok, so you tried adding:
LayoutHandler text/directory
and it didn't work right?
At least for Solaris and Linux (that is the only place I have
tested this on), the following should work:
LayoutHandler httpd/unix-directory
Yes!. You can speficy URI that are to be ignored by using the LayoutIgnoreURI directive. It handles regular expressions.
Yes!. You can speficy URI that are to be ignored for headers by using the LayoutIgnoreHeaderURI directive. A similair directive, LayoutIgnoreFooterURI exists for footers. Both handle regular expressions.
If you turn on LayoutHTTPOverride then your Header (if you have one) will be required to produce the correct HTTP Headers. If you lack a Header it will default to the middle document that was called. In addition you can create a CGI/servlet/PHP script and call it with LayoutHTTPHeader. It is independent of the Header and you can use it it to put HTTP Headers into your outbound connections.
The following is an example which will wrap PHP along
with html documents (this would catch everything from
both version 3 and 4).
Anything below version 2.5 gives you unpredictable results. As of
2.5 they work fairly well as long as you specify a URI for them,
or plain text (even though plain text does show off an annoying Apache
bug). If you want to make sure that the URI is always wrapped you will
want to make sure that the handler type for the ErrorDocument is
handled by mod_layout (otherwise you are going to end up with some
errors wrapped, and others not).
Using redirects for the ErrorDocuments will not work unless you are
using version 2.8 with merge enabled.
The answer is that you have LayoutPostAsync enabled. Right now there is no fix for this. The SSI module rejects attempts on SSI's when it thinks the request was a POST.
This is really just the first component of what will be an entire web publishing system. I have a few others that I have written over the years that I am currently trying to clean up enough to give away. We shall see how ambitious I get :)