Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th March 2008, 02:50
grandpagenocide grandpagenocide is offline
Senior Member
 
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
Send a message via AIM to grandpagenocide Send a message via MSN to grandpagenocide
Default .htaccess include footer

I am not sure if this is the right forum to put this in, but I am trying to use htaccess to put a footer on all sites created on one of my ispconfig servers, howerver, each way I write the htaccess file gives me a 500 error, an error refering to pear, or has no effect on the index.html or index.php Any ideas on that that may work without any major changes to the server?
Quote:
php_value output_buffering 4098

AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file footerad.txt
Quote:
powered by ISPConfig

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'footerad.txt' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

Last edited by grandpagenocide; 9th March 2008 at 03:00.
Reply With Quote
Sponsored Links
  #2  
Old 9th March 2008, 03:03
grandpagenocide grandpagenocide is offline
Senior Member
 
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
Send a message via AIM to grandpagenocide Send a message via MSN to grandpagenocide
Default

i also tried in my htaccess
Quote:
php_value output_buffering 4098
php_value auto_prepend_file 'http://yourlinkhere.com/headerad.php'
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file 'http://yourlinkhere.com/footerad.php'
Quote:
Warning: Unknown: URL file-access is disabled in the server configuration in Unknown on line 0

Warning: Unknown: failed to open stream: no suitable wrapper could be found in Unknown on line 0

Fatal error: Unknown: Failed opening required 'http://test.andpower.info/headerad.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
Reply With Quote
  #3  
Old 9th March 2008, 11:37
Leszek Leszek is offline
Senior Member
 
Join Date: Nov 2006
Location: Poland,Włocławek
Posts: 369
Thanks: 22
Thanked 42 Times in 35 Posts
Send a message via Skype™ to Leszek
Default

It's a shame that
php_value auto_prepend_file
and
php_value auto_append_file
work only with php scripts (You can append text files to).
Reply With Quote
  #4  
Old 9th March 2008, 15:32
grandpagenocide grandpagenocide is offline
Senior Member
 
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
Send a message via AIM to grandpagenocide Send a message via MSN to grandpagenocide
Default

lesxek, as you see in the second example I used a php header and footer as well. (they need a smiley with a gun to its head for frustration). Is there a way to include a footer in all formats, php, html. htm, etc. If I get this working, I want to set up a module, that turns on and off forced ads for clients.

Last edited by grandpagenocide; 9th March 2008 at 15:46.
Reply With Quote
  #5  
Old 9th March 2008, 17:26
Leszek Leszek is offline
Senior Member
 
Join Date: Nov 2006
Location: Poland,Włocławek
Posts: 369
Thanks: 22
Thanked 42 Times in 35 Posts
Send a message via Skype™ to Leszek
Default

I'm looking for the same thing.
Reply With Quote
  #6  
Old 9th March 2008, 17:41
grandpagenocide grandpagenocide is offline
Senior Member
 
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
Send a message via AIM to grandpagenocide Send a message via MSN to grandpagenocide
Default

If i can figure out how to do this with htaccess I can write the module without a problem. Its just frustrating the hell out of me trying to get htaccess working.
Reply With Quote
  #7  
Old 9th March 2008, 20:32
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,033
Thanks: 261
Thanked 147 Times in 128 Posts
Default

Anything of value about this error in your Apache error log file?
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote
  #8  
Old 9th March 2008, 20:37
grandpagenocide grandpagenocide is offline
Senior Member
 
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
Send a message via AIM to grandpagenocide Send a message via MSN to grandpagenocide
Default

nope nothing that matters, I am assuming its with the AllowOverride directive, but i added allowoverride all to the apache directives
Quote:
[Sun Mar 09 15:35:42 2008] [alert] [client 24.190.176.116] /var/www/web43/web/.htaccess: php_value not allowed here
Reply With Quote
  #9  
Old 9th March 2008, 21:53
grandpagenocide grandpagenocide is offline
Senior Member
 
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
Send a message via AIM to grandpagenocide Send a message via MSN to grandpagenocide
Default

Ok, I have the htaccess working in the /*/web folders by adding the AllowOverride Options tag, but now I need either to enable htaccess in the /var/www folder or to find a way for it to create an htaccess file with each new web. Any ideas?
Figured it out:

I created a folder called ads in var/www/ads

placed my footer.php there
and placed a blank.php there

created an htaccess file in /var/www containing

php_value output_buffering 4098
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file '/var/www/ads/footer.php'

I enabled php server wide, as I give all my clients php anyway,

in apache2.conf under the <Directory /var/www/sharedip>...</Directory>

<Directory /var/www>
Options +Includes -Indexes
AllowOverride None
AllowOverride Indexes AuthConfig Limit FileInfo Options
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>

Also add options in the allowoverride in /var/www/*/web and Allow from root in
<Files ~ "^\.ht">
Allow from root
Deny from all
</Files>

to disable the ads on a particular site

create an htaccess file and place it in the web folder of the client
php_value output_buffering 4098
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file '/var/www/ads/blank.php'

Last edited by grandpagenocide; 9th March 2008 at 22:31.
Reply With Quote
The Following User Says Thank You to grandpagenocide For This Useful Post:
mspIggy (9th July 2008)
  #10  
Old 9th March 2008, 22:32
grandpagenocide grandpagenocide is offline
Senior Member
 
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
Send a message via AIM to grandpagenocide Send a message via MSN to grandpagenocide
 
Default

ill ask a mod to move this to tips and tricks
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Virtual Hosts - I have never gotten this right. DazzyB Server Operation 2 24th December 2007 13:37
New Web Pages Forbidden crn_admin Installation/Configuration 15 26th September 2006 18:12
No access to public_html in user directories... sthompson Installation/Configuration 23 19th August 2006 16:53
sargeDebian GNU/Linux, kernel 2.6.8-3-686 and Debian kernel 2.6.8 386- qiu Kernel Questions 23 25th April 2006 15:53
No .htaccess in automatic backup? tron Installation/Configuration 3 22nd March 2006 18:03


All times are GMT +2. The time now is 15:14.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.