LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-03-2010, 09:45 AM   #1
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Rep: Reputation: 0
Squid forcing a webpage to users


Hello,

I have set up a linux box running slackware 12.0, along with Apache 2.2.4, on my LAN I have a couple of computers. I want to force them to a webpage under document root, the webpage will be a agreement webpage. Is this possible to do with Apache? This will not be real domain, so my guess it that I would have to tell my DNS server to resolve the ip address to the hostname of my slackware box. I have googled around with trying to figure how to go about this.

Thanks

Last edited by slomok; 11-17-2010 at 10:50 AM. Reason: Tiltle wasn't correct.
 
Old 11-03-2010, 09:59 AM   #2
jwl17330536
Member
 
Registered: Feb 2010
Location: Raleigh, NC
Posts: 83

Rep: Reputation: 22
I'm not sure that I completely follow what you are trying to accomplish. When do you want the user to reach this agreement page? When they get connected to the LAN or when they access the predetermined website name?
 
Old 11-03-2010, 10:10 AM   #3
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi,

After the user is plugged into the LAN and opens there web browser. I wanted an agreement webpage to open up and thought maybe could write a script, so if they didn't click the agreement button it would just reload the webpage. This sounds like setting up a captive portal, but I don't want that. I just want to know if Apache can force the user to a webpage?
 
Old 11-03-2010, 12:10 PM   #4
jwl17330536
Member
 
Registered: Feb 2010
Location: Raleigh, NC
Posts: 83

Rep: Reputation: 22
Sounds to me like you have more configuration needed than just Apache to do what you are wanting. I don't think I am going to be of much assistance on this one!
 
Old 11-03-2010, 01:05 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Apache can force a client to a specific webpage, using mod_rewrite.
But I really cannot understand what you're trying to do? Looks like you want to use your apache server as a proxy server for your users and want them to be presented with an "agreement" page the first time they're trying to visit a website from their browser.
If that's the case, I don't think apache can do it.
AFAIK the squid proxy server can show a predefined page the first time a user uses it.

Regards
 
Old 11-03-2010, 01:11 PM   #6
fbt
Member
 
Registered: May 2010
Distribution: Chakra
Posts: 89

Rep: Reputation: 26
How about sending the agreement to your users, "read this" and I will send you the url/password to access the server.
 
Old 11-03-2010, 01:45 PM   #7
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi,

Apache can force a client to a specific webpage, using mod_rewrite.
But I really cannot understand what you're trying to do? Looks like you want to use your apache server as a proxy server for your users and want them to be presented with an "agreement" page the first time they're trying to visit a website from their browser.
If that's the case, I don't think apache can do it.
AFAIK the squid proxy server can show a predefined page the first time a user uses it.

Regards
Hi bathory,

That is what I am looking to accomplish, have the users be presented with an "agreement" page the first time they're trying to visit a website from their browser. I am using the server as a squid proxy server. Did I forget to mention that? Apache is also installed on this server, I just figured that Apache would be what I used to do this. I though Apache config. file had a lot of reading, Squid's config. file is long. Any way to point me?

Thanks very much for the response
 
Old 11-03-2010, 02:04 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Stop using apache as a proxy server and use squid instead. What you need is to configure squid as a transparent proxy and use squid_session.
Take a look at this thread here at LQ to see how you can use squid_session.

Regards
 
Old 11-03-2010, 02:29 PM   #9
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi,

Stop using apache as a proxy server and use squid instead. What you need is to configure squid as a transparent proxy and use squid_session.
Take a look at this thread here at LQ to see how you can use squid_session.

Regards

Hey bathory,

Thanks I am not using Apache as a proxy server, it is on there for other purposes. I just didn't realize that I could use Squid to show a certain webpage to users. I will post back after looking at the other thread.

Thanks again
 
Old 11-08-2010, 11:43 AM   #10
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi bathory,

I read the link you suggested, I recompiled squid using this command: ./configure --enable-external-acl-helpers=session
When I do a locate squid_session, I am shown the directory that contains squid session man pages. Do I need to put a script somewhere for squid session to run? Or did
I not get this installed correctly.

thanks,
noob
 
Old 11-08-2010, 12:43 PM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Using that ./configure script everything is installed in /usr/local/squid. You can find squid_session, running:
Code:
find /usr/local/squid -name squid_session
If that still doesn't work, run a "make distclean" before running the ./configure script again.

Re: the configuration, in squid.conf, use:
Code:
external_acl_type session ttl=300 negative_ttl=0 children=1 concurrency=200 %SRC /usr/local/squid/libexec/squid_session -t 600
acl session external session
http_access deny !session
deny_info banner session
To create the banner to the end user, I've used the ERR_ACCESS_DENIED template:
Code:
cp /usr/local/squid/share/errors/templates/ERR_ACCESS_DENIED /usr/local/squid/share/errors/templates/banner
and modified it to my needs. After the agreement text I've just added:
Code:
<p>Click <a href="%U">here</a> to continue</p>
so the user can click on this link and continue to the requested page.

Regards
 
Old 11-09-2010, 11:01 AM   #12
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi bathory,

Followed the steps to reconfigure squid, after I do a make I get errors for squid helpers. squid_session.c:39:20: error: db_185.h: No such file or directory - this is the line among many
that I see. I know in another post, I seen someone have the same problem. I am assuming that I need to install Berkeley db, I downloaded db-4.5.20 installed that, tried reconfiguring Squid, did a make distclean before I did it. Still getting that error.

Thanks
 
Old 11-09-2010, 03:10 PM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

If you used your distro's db-4.5.20 package, you need to install also the development package (something like db-4.5.20-devel), to get the missing header files.

Regards
 
Old 11-10-2010, 08:42 AM   #14
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi,

If you used your distro's db-4.5.20 package, you need to install also the development package (something like db-4.5.20-devel), to get the missing header files.

Regards
Hi bathory,

Don't quite understand where I should get db-4.5.20-devel, from. I downloaded Berkeley db-4.5.20, from the internet, from Oracle. I didn't use my distro's package. Is this where my problem lies? The package seemed to install fine. Guess I will keep looking though for that development package.

Thanks
 
Old 11-10-2010, 09:07 AM   #15
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Oups, you didn't say how you installed db-4.5, so I thought you've used your distro's package manager, in which case you need to install also the development package

Anyway, if you compiled db-4.5.20 from source, then I guess it's installed in /usr/local/BerkeleyDB.4.5, in which case you need to use the following to configure squid:
Code:
LDFLAGS=-L/usr/local/BerkeleyDB.4.5/lib CPPFLAGS=-I/usr/local/BerkeleyDB.4.5/include ./configure --enable-external-acl-helpers=session
Don't forget to run "make distclean" before running ./configure

Regards
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing Users for strong passwords sushantchawla2005 Linux - Server 5 08-21-2009 09:12 AM
forcing the users to use policy server mallikk_in Linux - Networking 1 08-29-2007 07:23 AM
forcing the users to use policy server mallikk_in Linux - Networking 0 08-29-2007 07:00 AM
Forcing users to use proxy avallach Linux - Networking 2 01-14-2007 05:10 AM
Forcing users to use DG on server. Steve2001 Linux - Networking 1 08-27-2005 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration