Re: mod_layout change HTTP header

- = k o l i s k o = - <[email protected]> Sat, 24 Feb 2007 15:54:18 +0100
Newsgroups gmane.comp.apache.mod-layout
Message-ID <[email protected]>
Thank you for response Brian,

What i want to do?

I want a simple thing to do. I want generate my own HTTP headers by PHP and 
than add a footer before </body> tag by mod_layout without change HTTP 
headers generated by PHP.

Reason is easy. I have lot of websites on my server which has .png images 
stored in mysql database. These images are displayed by PHP. Somethink 
like /showimage.php?id=123. It means that showimage.php get image from mysql 
and display it by generate HTTP Content-Type: image/png header using standard 
header() function in PHP.

I know that one solution is ignore URI showimage.php in this specific case. 
But on server is lot of projects, lot of web sites, lot of customers and 
this "Ignore URI" solution is not possible for me. Becouse the name of php 
file which generate HTTP header is not given. Every PHP file name can 
generate HTTP header information. So i dont know "filename" of all file which 
generate its own HTTP headers.

And generating of png images by PHP is only one example. Server generate f.e. 
pdf files with application/pdf content type header or another content types.

 I think that want easy thing and hope that it is possible to do by 
mod_layout. Or if it is not possible to do by mod_layout, what is better for 
my need?

Thank you for help!
kolisko




On Friday 23 of February 2007 23:19:51 Brian Aker wrote:
> Hi!
>
> mod_layout for Apache 1.3 grabs the document after the generator is
> done with it. To do this it turns off the headers for the original
> document and then generates its own headers. What are you wanting to do?
>
>  From looking at your description it looks like a second check for
> content-type should be made to avoid scrambling output like yours
> (though you can do this through ignore uri bits as well).
>
> Cheers,
> 	-Brian
>
> On Feb 23, 2007, at 11:26 AM, - = k o l i s k o = - wrote:
> > Hi all,
> >
> > i have installed mod_layout on Debian Sarge server (versions bellow)
> >
> >
> > cut /etc/apache/httpd.conf
> >
> > LayoutMerge ON
> > LayoutFooter "foot"     # only for test
> >
> > When i have easy test.php page like this all work well:
> >
> > <html>
> > <body>
> > <?
> > echo "test body";
> > ?>
> > </body>
> > </html>
> >
> >
> > this is output from 'dog' tool:
> >
> > HTTP/1.1 200 OK
> > Date: Fri, 23 Feb 2007 18:58:51 GMT
> > Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 mod_layout/
> > 3.2.1
> > X-Powered-By: ModLayout/3.2.1
> > Connection: close
> > Content-Type: text/html
> >
> >
> > <html>
> > <body>
> > test bodyfoot</body>
> > </html>
> >
> >
> > It is all ok
> >
> > BUT
> >
> > When when i use a simple php code with function header(), which
> > adds/change
> > HTTP headers, it looks that mod_layout always replays the headers
> > by itself.
> > I use changing HTTP headers to "image/png" value becouse i generate
> > dynamic .png images by php scripts.
> >
> > This is second simple test.php page:
> >
> > <?
> > Header("Content-Type: image/png");
> > Header("NewHeder: value");
> > ?>
> >
> > output from dog:
> >
> > HTTP/1.1 200 OK
> > Date: Fri, 23 Feb 2007 19:08:43 GMT
> > Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 mod_layout/
> > 3.2.1
> > X-Powered-By: ModLayout/3.2.1
> > Connection: close
> > Content-Type: text/html
> >
> >
> > You can see no HTTP headers generated by test.php script
> >
> > when i turn off LayoutFooter and LayoutMerge in httpd.conf and
> > restart apache,
> > dog show me:
> >
> > HTTP/1.1 200 OK
> > Date: Fri, 23 Feb 2007 19:14:47 GMT
> > Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 mod_layout/
> > 3.2.1
> > X-Powered-By: PHP/4.3.10-18
> > NewHeder: value
> > Connection: close
> > Content-Type: image/png
> >
> >
> > Any idea why mod_layout change HTTP header? I use mod_layout
> > becouse only want
> > add a text or simple html code before "</body>" tag without change
> > HTTP
> > headers or without change anything else....
> >
> > Thank you for help!!!
> >
> > kolisko
> >
> > versions on my Debian Sarge server - dpkg -l :
> >
> >
> > ii  apache         1.3.33-6sarge3 versatile, high-performance HTTP
> > server
> > ii  apache-common  1.3.33-6sarge3 support files for all Apache
> > webservers
> > ii  apache-dev     1.3.33-6sarge3 development kit for the Apache
> > webserver
> > ii  apache-ssl     1.3.33-6sarge3 versatile, high-performance HTTP
> > server with
> > ii  apache-utils   1.3.33-6sarge3 utility programs for webservers
> > (transitiona
> > ii  apache2        2.0.54-5sarge1 next generation, scalable,
> > extendable web se
> > ii  apache2-common 2.0.54-5sarge1 next generation, scalable,
> > extendable web se
> > ii  apache2-mpm-pr 2.0.54-5sarge1 traditional model for Apache2
> > ii  apache2-utils  2.0.54-5sarge1 utility programs for webservers
> > ii  libapache-mod-layout 3.2.1-2        Apache web page content
> > wrapper
> > ii  libapache2-mod 4.0.1a-2.2     Apache2 web page content wrapper
> > ii  libapache2-mod 4.3.10-18      server-side, HTML-embedded
> > scripting languag
> > _______________________________________________
> > Mod_layout mailing list
> > [email protected]
> > http://lists.tangent.org/mailman/listinfo/mod_layout
>
> --
> _______________________________________________________
> Brian "Krow" Aker, brian at tangent.org
> Seattle, Washington
> http://krow.net/
> http://tangent.org/
> _______________________________________________________
> You can't grep a dead tree.
>
>
> _______________________________________________
> Mod_layout mailing list
> [email protected]
> http://lists.tangent.org/mailman/listinfo/mod_layout