LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 10-08-2005, 03:25 PM   #1
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 408

Rep: Reputation: 30
Ads for users public_html on Apache 2


Hi,
I'm hosting people on my server (Slackware 9 with Apache 2), and they use the public_html dirrecotry to host their websites. I would like to be able to use advertisements of each user's page that is in a certain group (the non-paying group). I would like to have them be able to use their public_html like normal, and have a normal index.html file (eg, without them having to have the ad's code IN the files, with the only difference being that of each of their pages would spawn advertisements, or possibly on the pages themselves such as with google ads, that would help fund their account. I would also like to be able to turn these advertisements off for the users that make a donation, and apache's root, etc. It should also be relativly secure so they are unable to tamper with their account in some way to remove the ads. Does anybody know how I could go about doing this?

Thanks,
Marshall
 
Old 10-09-2005, 07:55 AM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 56
mod_injection will do that for you. It doesn't seem to be maintained anymore but it works on current Apache releases so it'll get you out of trouble
 
Old 10-09-2005, 04:22 PM   #3
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 408

Original Poster
Rep: Reputation: 30
I can't get this to work with neither the root of the site or the public htmls. Apache doesn't seem to spit out any errors when it starts up, but maybe I'm installing/configuring it incorrectly, the documentation on how to configure it is a little splotchy. Could you explain what exactly I have to put in httpd.conf or any other files to get this working? My module installed into the modules dirrectory with Apache, and I tried adding different combinations of:

--code--

LoadModule injection_module modules/mod_injection.so
AddOutputFilter INJECTION .html
<Directory />
SetOutputFilter INJECTION
InjectString "wakljsdaflkjsdglkjgswhatever"
</Directory>

--code--
In my httpd.conf file, but I still cant seem to make any of the injected text show up anywhere in the pages.

I am running Apache 2.0.54 built from source on a Slackware 9.0 system.

Thanks,
Marshall
 
Old 10-09-2005, 04:42 PM   #4
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,183

Rep: Reputation: 98
From the docs
Code:
 SetOutputFilter INJECTION InjectString "wakljsdaflkjsdglkjgswhatever"
looks like it should be all on one line
 
Old 10-09-2005, 04:53 PM   #5
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 408

Original Poster
Rep: Reputation: 30
It looks like it is on two different lines in the docs to me. When I try to put it on one line apache complains about it on startup saying that SetOutputFilter only takes one argument, filter.
 
Old 10-09-2005, 06:27 PM   #6
Oxagast
Member
 
Registered: Aug 2003
Location: Mocksville, NC, USA
Distribution: Gentoo, Slackware.
Posts: 408

Original Poster
Rep: Reputation: 30
I think I finally got this to work... sort of... it seems to want to put everything twice. Why would it do that? It will inject the code that I tell it so, but it'll double up on it, so say if I tell it to inject "linux", the words "linuxlinux" will appear on the pages. Is there any way to fix this? It's prolly some stupid misconfiguration error on my part.

-- edit --
Nevermind, I got it working, thanks for the help

Last edited by Oxagast; 10-11-2005 at 12:17 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache UserDir public_html problem aeshley Linux - Newbie 4 11-29-2004 01:58 AM
Making it so users can ftp into there Public_html folder embalmedlenin Linux - General 4 12-13-2003 06:05 PM
poblem with apache and private public_html keevitaja Linux - Newbie 0 08-16-2002 11:57 AM
Problem with Apache and public_html MiB_24 Linux - General 3 07-28-2002 12:33 AM
apache UserDir public_html problem aeshley Linux - Networking 4 01-17-2002 03:43 PM


All times are GMT -5. The time now is 10:07 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration