1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
|
<HTML>
<HEAD>
<TITLE>Mod_Layout FAQ</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" link="#006666" vlink="#000000">
<H1>Mod_Layout FAQ.</H1>
<H2><A HREF="#_Gen">General Questions</A></H2>
<TABLE><TR><TD width="10"> </TD><TD
<BR> <A HREF="#_1_1">So what is Mod_Layout?</A></BR>
<BR> <A HREF="#_1_2">Where do I get it from?</A></BR>
<BR> <A HREF="#_1_3">What sort of license does it have?</A></BR>
<BR> <A HREF="#_1_4">How can I make suggestions for it?</A></BR>
<BR> <A HREF="#_1_5">How can I report a bug?</A></BR>
<BR> <A HREF="#_1_6">Is there a mailing list?</A></BR>
<BR> <A HREF="#_1_6">How do I get started using it?</A></BR>
<BR> <A HREF="#_1_7">Is there anyplace I can see it at work?</A></BR>
<BR> <A HREF="#_1_8">How do I install it?</A></BR>
<BR> <A HREF="#_1_9">What are the directives?</A></BR>
<BR> <A HREF="#_1_10">I have my own type that I have defined with AddHandler, how can I wrap that?</A></BR>
<BR> <A HREF="#_1_12">Hey, I don't want to wrap CGI's, just HTML, how do I do that?</A></BR>
<BR> <A HREF="#_1_14">What handlers does LayoutDefaultHandlers do?</A></BR>
<BR> <A HREF="#_1_15">What environmental variables does ModLayout add?</A></BR>
<BR> <A HREF="#_1_16">How do I pick different headers and footers for different pages dynamically?</A></BR>
<BR> <A HREF="#_1_17">What about frames?</A></BR>
<BR> <A HREF="#_1_18">Hey, what about using this with the proxy server?</A></BR>
<BR> <A HREF="#_1_19">Can I have just the footer and header display and skip the original content?</A></BR>
<BR> <A HREF="#_1_20">Is it possible to specify text/* in for a LayoutHandler?</A></BR>
<BR> <A HREF="#_1_21">What about directories?</A></BR>
<BR> <A HREF="#_1_22">Can I have it ignore certain files?</A></BR>
<BR> <A HREF="#_1_23">But can I have only certain files not display headers (or footers)?</A></BR>
<BR> <A HREF="#_1_24">How do I modify outbound HTTP headers?</A></BR>
<BR> <A HREF="#_1_25">How do I make this work with PHP?</A></BR>
<BR> <A HREF="#_1_26">So what is up with custom error documents?</A></BR>
<BR> <A HREF="#_1_27">What am I to do if I get 405's with SSI documents?</A></BR>
<BR> <A HREF="#_1_28">Can I use mod_layout directives in .htaccess files?</A></BR>
<BR> <A HREF="#_1_29">What is this merge thing?</A></BR>
<BR> <A HREF="#_1_30">Why are cookies not working, and PHP scripts with Location are failing?</A></BR>
<BR> <A HREF="#_1_31">So, mod_layout is dinking up my plain text documents, what can I do?</A></BR>
<BR> <A HREF="#_1_32">Woops, mod_layout is displaying my php/perl script as code, its not executing it, what happened?</A></BR>
<BR> <A HREF="#_1_33">What is the future?</A></BR>
</TD></TR></TABLE>
<h2> <A HREF="#_AppA">Appendix A. Layout Examples</A></H2>
<H2><A NAME="_Gen"></A>General Questions</H3>
<H3><A NAME="_1_1"></A>So what is Mod Layout?</H3>
<P>Mod_Layout wraps a page. Ok, so what does that mean? It means that it can place
information at both the beginning and the end of a document (or before or after a tag).
This allows you to 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 have even
seen people use headers and footers to wrap the entire content of a given site (they
place the original content in a table and then place additional material all around
the content). With Mod_Layout's ability to work with pretty much any type of
original content (whether produced by text, CGI, Java, PHP or Perl) it is perfect for
development houses that use different technologies or who don't control all of the
different types of content that may go on their site. <br>
There are many possibilities.</P>
<BR><H3><A NAME="_1_2"></A>Where do I get it from?</H3>
<P>You can get it from <A HREF="http://software.tangent.org/">here</A>.</P>
<BR><H3><A NAME="_1_3"></A>What sort of license does it have?</H3>
<P>You are pretty much free to use it as you please. The LICENSE
is BSD (basically the same as Apache's).</P>
<BR><H3><A NAME="_1_4"></A>How can I make suggestions for it?</H3>
<P>Send email to <A HREF="mailto:brian@tangent.org.">brian@tangent.org.</A></P>
<BR><H3><A NAME="_1_5"></A>How can I report a bug?</H3>
<P>Fill out the form <A HREF="http://software.tangent.org/submit.pl?section=modlayout&tid=bugs">here</A>. </P>
<BR><H3><A NAME="_1_6"></A>Is there a mailing list?</H3>
<P>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 software and its uses. Send mail to <A HREF="mailto:minordomo@tangent.org.">minordomo@tangent.org</A> with a subject of "subscribe announce-mod_layout" or "subscribe mod_layout" to subscribe to either of the mailing lists. </P>
<BR><H3><A NAME="_1_6"></A>How do I get started using it?</H3>
<P>First you need to decide what sort of layout you need. Do you just need a Footer? If that is the
case you can just add LayoutFooter directives as needed. Now, if you want something a bit more complicated,
like a single look and feel throughout your site, then you need to decide if you want to use merge or not.
What merge does is insert footers and headers before and after tags found in the output of the original
document. By default it will use <body> tags. This can be a be very handy since as long as your
HTML is valid, you can create documents on the fly that have propper HTML. <br> If you want to include in
your headers and footers all of the propper HTML (and have your original documents just to be snippets of
HTML) you can run without merge (on the same token, if you don't care about valid HTML since browsers
seem to get it "right" you can do this too).</P>
<BR><H3><A NAME="_1_7"></A>Is there anyplace I can see it at work?</H3>
<P>I use it at <A HREF="http://tangent.org/">http://tangent.org/</A> Comments should be on, so you can see how
the different headers and footers are used to make the site (yeah, and it
proves that while I can write code, I stink at HTML). In the Appendix of
this Faq you will find the HTTP directives I use to create the site</P>
<BR><H3><A NAME="_1_8"></A>How do I install it?</H3>
<P>Look at the file called INSTALL that comes with your copy of mod_layout</P>
<BR><H3><A NAME="_1_9"></A>What are the directives?</H3>
<LI><A HREF="directives/LayoutHeader.html">LayoutHeader</A></LI>
<LI><A HREF="directives/LayoutFooter.html">LayoutFooter</A></LI>
<LI><A HREF="directives/LayoutHandler.html">LayoutHandler</A></LI>
<LI><A HREF="directives/LayoutProxy.html">LayoutProxy</A></LI>
<LI><A HREF="directives/LayoutComment.html">LayoutComment</A></LI>
<LI><A HREF="directives/LayoutDefaultHandlers.html">LayoutDefaultHandlers</A></LI>
<LI><A HREF="directives/LayoutDisplayOriginal.html">LayoutDisplayOriginal</A></LI>
<LI><A HREF="directives/LayoutIgnoreURI.html">LayoutIgnoreURI</A></LI>
<LI><A HREF="directives/LayoutIgnoreHeaderURI.html">LayoutIgnoreHeaderURI</A></LI>
<LI><A HREF="directives/LayoutIgnoreFooterURI.html">LayoutIgnoreFooterURI</A></LI>
<LI><A HREF="directives/LayoutHTTPHeaderOff.html">LayoutHTTPHeaderOff</A></LI>
<LI><A HREF="directives/LayoutFooterOff.html">LayoutFooterOff</A></LI>
<LI><A HREF="directives/LayoutHeaderOff.html">LayoutHeaderOff</A></LI>
<LI><A HREF="directives/LayoutHTTPHeader.html">LayoutHTTPHeader</A></LI>
<LI><A HREF="directives/LayoutTimeFormat.html">LayoutTimeFormat</A> </LI>
<LI><A HREF="directives/LayoutPostAsync.html">LayoutPostAsync</A> </LI>
<LI><A HREF="directives/LayoutMergeErrorIgnore.html">LayoutMergeErrorIgnore</A> </LI>
<LI><A HREF="directives/LayoutMerge.html">LayoutMerge</A> </LI>
<LI><A HREF="directives/LayoutMergeBeginTag.html">LayoutMergeBeginTag</A> </LI>
<LI><A HREF="directives/LayoutMergeEndTag.html">LayoutMergeEndTag</A> </LI>
<LI><A HREF="directives/LayoutCache.html">LayoutCache</A> </LI>
<LI><A HREF="directives/LayoutCacheNeeded.html">LayoutCacheNeeded</A> </LI>
<LI><A HREF="directives/LayoutAppend.html">LayoutAppend</A> </LI>
<LI><A HREF="directives/LayoutAppendHeader.html">LayoutAppendHeader</A> </LI>
<LI><A HREF="directives/LayoutAppendFooter.html">LayoutAppendFooter</A> </LI>
<LI><A HREF="directives/LayoutIgnoreTag.html">LayoutIgnoreTag</A> </LI>
<LI><A HREF="directives/LayoutIgnoreTagHeader.html">LayoutIgnoreTagHeader</A> </LI>
<LI><A HREF="directives/LayoutIgnoreTagFooter.html">LayoutIgnoreTagFooter</A> </LI>
</P>
<BR><H3><A NAME="_1_10"></A>I have my own type that I have defined with AddHandler, how can I
wrap that?</H3>
<P>Use LayoutHandler. An example would be:</P>
<P>LayoutHandler type/subtype</P>
<BR><H3><A NAME="_1_12"></A>Hey, I don't want to wrap CGI's, just HTML, how do I do that?</H3>
<P>Use the following directives:</P>
<P>LayoutDefaultHandlers Off</P>
<P>LayoutHandler text/html.</P>
<BR><H3><A NAME="_1_14"></A>What handlers does LayoutDefaultHandlers do?</H3>
<LI>server-parsed</LI>
<LI>text/html</LI>
<LI>text/plain</LI>
<LI>perl-script</LI>
<LI>cgi-script</LI>
<LI>application/x-http-cgi</LI>
<LI>application/x-httpd-php</LI>
<BR>
<P>I will probably add more in the future. Email me if you have one
that you would like to see added in by default.</P>
<BR><H3><A NAME="_1_15"></A>What environmental variables does ModLayout add?</H3>
<P> Four environmental variables are currently added to environmental namespace for Layout and Header files. They
are:
<LI> LAYOUT_SCRIPT_NAME
<LI> LAYOUT_PATH_INFO
<LI> LAYOUT_QUERY_STRING
<LI> LAYOUT_LAST_MODIFIED
<P>
They represent the parsed information that made up the original request. You can set the look of LAYOUT_LAST_MODIFIED by using the LayoutTimeFormat directive).
</P>
<BR><H3><A NAME="_1_16"></A>How do I pick different headers and footers for different pages dynamically?</H3>
<P> Write a cgi/servlet/PHP script and use the LAYOUT_SCRIPT_NAME environmental variable to determine what content you wish to display.
<BR>
<BR><H3><A NAME="_1_17"></A>What about frames?</H3>
<P>I personally hate them.</P>
<P>You want to know more? <sighs> Ok, your best bet is to
have documents with them ignored at the moment. To do this
use LayoutIgnoreTag and specify the tag "<form>".</P>
<BR><H3><A NAME="_1_18"></A>Hey, what about using this with a proxy server?</H3>
<P>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 file (or any filetype which
is not wrappable) the page that is returned will be broken. Also,
anything that ProxyPass cannot support, Mod_Layout will support.</P>
<BR><H3><A HREF="#_1_19"></A>Can I have just the footer and header display and skip the original content?</H3>
<P>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). You can turn off the original content by using "LayoutDisplayOriginal Off".</P>
<BR><H3><A HREF="#_1_20"></A>Is it possible to specify text/* in for a LayoutHandler?</H3>
<P> Yes, all handlers use fnmatch regular expressions. Look at your system's main pages to determine syntax. BTW If
you specify something like "*/*", yes you will wrap everything, but this includes images (which will show up corrupted). </P>
<BR><H3><A NAME="_1_21"></A>What about directories?</H3>
<P>Ok, so you tried adding: <br>
LayoutHandler text/directory<br>
and it didn't work right?<br>
At least for Solaris and Linux (that is the only place I have
tested this on), the following should work:<br>
LayoutHandler httpd/unix-directory<br>
</P>
<BR><H3><A NAME="_1_22"></A>Can I have it ignore certain files?</H3>
<P> Yes!. You can speficy URI that are to be ignored by using the
LayoutIgnoreURI directive. It handles regular expressions. </P>
<BR><H3><A NAME="_1_23"></A>But can I have only certain files not display headers (or footers)</H3>
<P> 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. </P>
<BR><H3><A NAME="_1_24"></A>How do I modify outbound HTTP headers?</H3>
<P>LayoutHTTPOverrideHeader and LayoutHTTPOverrideURI can be used to have mod_layout ignore producing headers for scripts. Keep in mind though if you are using merge and you have headers, that those headers will be what will produce HTTP headers.</P>
<BR><H3><A NAME="_1_25"></A>How do I make this work with PHP?</H3>
<P>It has worked out of the box with php (AKA no needing to add handlers) since version 2.11.5</P>
<BR><H3><A NAME="_1_26"></A>So what is up with custom error documents?</H3>
<P> As of version 2.11.5 this all works like you think it should. </P>
<BR><H3><A NAME="_1_27"></A>What am I to do if I get 405's with SSI documents?</H3>
<P> 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 will be fixed eventually
<P>
<BR><H3><A NAME="_1_28"></A>Can I use mod_layout directives in .htaccess files?</H3>
<P>If you enable .htaccess files, mod_layout will work in them.
</P>
<P>
<BR><H3><A NAME="_1_29"></A>What is this merge thing??</H3>
<P> Merge is a really cool feature that was added as
of version 2.8. What it does is insert your headers
and footers inside of the original content. By default it
inserts the headers after the <BODY*> tag and the
footers before the </BODY> tag. You can modify which
tags are used. If you are looking to do correctly formatting
HTML, this is for you.
</P>
<BR><H3><A NAME="_1_30"></A>Why are cookies not working, and php scripts with Location are failing?</H3>
<P>This was all fixed in version 2.11.4 so it is no longer an issue.</P>
<BR><H3><A NAME="_1_31"></A>So, mod_layout is dinking up my plain text documents, what can I do?</H3>
<P>You need to install a tex->html handler. You could use <A HREF="http://software.tangent.org/projects.pl?view=mod_text2html">mod_text2html</A>.</P>
<BR><H3><A NAME="_1_32"></A>Woops, mod_layout is displaying my php/perl script as code, its not executing it, what happened?</H3>
<P> You did something like this: LayoutHeader /usr/local/apache/htdocs/footer.pl instead of LayoutHeader /footer.pl. You need to reference from a document root (or scriptalias root).
<BR><H3><A NAME="_1_33"></A>What is the future?</H3>
<P>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 :) </P>
<BR>
<H2><A NAME="_AppA"></A>Appendix A. Layout Examples</H2>
<br>
<h3> Simple Copyright Example </h3>
<p>This will tack a simple Copyright on to the bottom of all of your pages</p>
<BLOCKQUOTE>
<VirtualHost www.foo.com:80><BR>
LayoutFooter "Copyright Foobar, 2000"<BR>
</VirtualHost><BR>
</BLOCKQUOTE>
<h3> Header and Footer example. </h3>
<p> This Site uses merge to insert a banner and dynamic footer. </p>
<p>This will tack a simple Copyright on to the bottom of all of your pages</p>
<BLOCKQUOTE>
<VirtualHost www.foo.com:80><BR>
LayoutMerge On<br>
LayoutHeader "<IMG SRC="/site_logo.gif" ALT="Foobar incorporated"><BR>
LayoutFooter /footer.php<BR>
</VirtualHost><BR>
</BLOCKQUOTE>
<h3> HTML only example </h3>
<p>This will tack a simple Copyright on to the bottom of all of your pages</p>
<BLOCKQUOTE>
<VirtualHost www.foo.com:80><BR>
LayoutFooter "Copyright Foobar, 2000"<BR>
LayoutDefaultHandler OFF<br>
LayoutHandler text/html<br>
</VirtualHost><BR>
</BLOCKQUOTE>
<h3> Hosting Service. </h3>
<BLOCKQUOTE>
<p> This is a typical way hosting services use mod_layout. You
will notice how the header and fotter are kept in a scriptalias
directory where the user can not get at them.<p>
httpd.conf<br>
----------<br>
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"<br>
LayoutHeader /cgi-bin/header.pl<br>
LayoutFooter /cgi-bin/header.php<br>
<VirtualHost example.com><BR>
...<br>
</VirtualHost><BR>
<VirtualHost 2example.com><BR>
...<br>
</VirtualHost><BR>
</BLOCKQUOTE>
<h3> Advanced site. </h3>
<BLOCKQUOTE>
<p> This example is from tangent.org. Notice how it uses different headers
and footers for different subdirecties. Note that all content ending
with rss are ignored. Also note that user's home directories will not
be wrapped in this example. Comments are enabled so you can see
where different content begins and ends.<p>
<VirtualHost 205.153.154.37:80><BR>
###### <BR>
###### www.tangent.org<BR>
###### <BR>
ServerName www.tangent.org<BR>
ServerAlias shiitake.tangent.org shiitake.tangent.org tangent.org portabello portabello.tangent.org www<BR>
UseCanonicalName On<BR>
ErrorDocument 404 /404.pl<BR>
RandomQuote On<BR>
RandomQuoteFile /usr/local/apache/conf/quotes<BR>
DocumentRoot /usr/local/apache/htdocs-Tangent<BR>
UserDir public_html<BR>
CustomLog /usr/local/apache/logs/www_tangent_org.access combined<BR>
ErrorLog /usr/local/apache/logs/www_tangent_org.error<BR>
LayoutComment On<BR>
LayoutIgnoreURI *.rss<BR>
<Directory /usr/local/apache/htdocs-Tangent/><BR>
LayoutHeader /usr/local/apache/htdocs-Tangent/header.html<BR>
LayoutFooter /footer.pl<BR>
LayoutHandler httpd/unix-directory<BR>
LayoutMerge On<BR>
</Directory><BR>
<Directory /usr/local/apache/htdocs-Tangent/mod_layout/><BR>
LayoutHeader /mod_layout/header.html<BR>
</Directory><BR>
<Directory /usr/local/apache/htdocs-Tangent/mod_repository/><BR>
LayoutHeader /mod_repository/header.html<BR>
</Directory><BR>
<Directory /usr/local/apache/htdocs-Tangent/mod_random/><BR>
LayoutHeader /mod_random/header.html<BR>
</Directory><BR>
<Directory /usr/local/apache/htdocs-Tangent/mod_cgi_debug/><BR>
LayoutHeader /mod_cgi_debug/header.html<BR>
</Directory><BR>
<Directory /usr/local/apache/htdocs-Tangent/mod_relocate/><BR>
LayoutHeader /mod_relocate/header.html<BR>
</Directory><BR>
<Directory /usr/local/apache/htdocs-Tangent/mod_filter/><BR>
LayoutHeader /mod_filter/header.html<BR>
</Directory><BR>
<Directory /usr/local/apache/htdocs-Tangent/DBIx-Password/><BR>
LayoutHeader /DBIx-Password/header.html<BR>
</Directory><BR>
<BR>
</VirtualHost><BR>
</BLOCKQUOTE>
</BODY>
</HTML>
|