Forum Moderators: phranque

Message Too Old, No Replies

Please help me with mod_layout

Please help me with mod_layout

         

hexstar

2:51 am on May 24, 2006 (gmt 0)

10+ Year Member



Please, I need help with getting mod_layout to work. Basically, I'm trying to get a html page for header and footer to work for ads on sites, running Suse 10, Apache 1.3.34, and cPanel version 10.8.2-RELEASE 83, currently only the header html file contains ad code, it's the google javascript ad code. I've tried putting in

LayoutDefaultHandlers Off
and
LayoutHandler text/html

but in the error_log for apache I still get an 500 error for the header and footer saying "premature end of script" like it's expecting it to still be a cgi/php script...running the latest version of the mod_layout module ( 3.2.1) which compiled and installed without errors, can anyone please help? What am I doing wrong? What do I need to do to get this to work? Thanks!

coopster

9:57 pm on May 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Doesn't seem like many folks are playing around with this particular external module. But I guess I could see why. If I were to want to implement a similar feature I would likely go with PHP and use the auto_append_file [php.net] and auto_prepend_file [php.net] configuration directives. Although I do not know the detailed workings of the mod-layout extension, I can tell you that a certain bonus with the PHP method is that you could always drop the header/footer from certain directories/files if you decided you wanted/needed to do so.

hexstar

3:53 am on May 25, 2006 (gmt 0)

10+ Year Member



Ok thanks for your reply, I tried googling those two and didn't find much help in how to use 'em..so how would I setup a header/footer when they are:

header: /usr/local/apache/iads/header.html
footer: /usr/local/apache/iads/footer.html

the header is html and contains just the google javascript ad code, the footer is an empty html file for now

I want those to be put on all sites in /data1 and none of the sites in /home ...what would be the config I'd use for this? Also where would I put this in my php.ini file, is just anywhere OK? Thanks alot! :-)

coopster

5:31 pm on May 25, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You should be able to search your
php.ini
file and find the directives. They are likely blank or possibly commented out. You set them just as you would any other PHP configuration directive and they can appear anywhere in the file. To set them in
php.ini
:
auto_prepend_file "/usr/local/apache/iads/header.html" 
auto_append_file "/usr/local/apache/iads/footer.html"

And if you choose to do so in your Apache configuration instead you can enter the following in either the
httpd.conf
or per-directory override (
.htaccess
) file:
php_value auto_prepend_file "/usr/local/apache/iads/header.html" 
php_value auto_append_file "/usr/local/apache/iads/footer.html"

hexstar

8:12 pm on May 25, 2006 (gmt 0)

10+ Year Member



Thanks, but how do I make it so that those are only put on sites in /data1 and not those in /home?

hexstar

8:15 pm on May 25, 2006 (gmt 0)

10+ Year Member



What I mean is that you said I could drop this from certain directories and such if I wanted to and I'd like to do so, how do I go about doing this? Thanks!

jdMorgan

9:17 pm on May 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The <directory> [httpd.apache.org] and <Location> [httpd.apache.org] containers documented in Apache core may prove useful.

Jim

coopster

9:18 pm on May 25, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



By either specifying the directives in a <Directory> [httpd.apache.org] container in your Apache configuration (
httpd.conf
) or in a per-directory [httpd.apache.org] override (
.htaccess
) file.