LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-10-2010, 09:45 AM   #16
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0

Hi bathory,

I am running Slackware 12.2, what package manager? My mistake, on how I did this, I have to give more details on what I did. I will try what you posted to do and post back the results.

thanks
 
Old 11-10-2010, 12:10 PM   #17
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
Didn't notice that you're running Slackware, sorry.
Anyway also Slackware has package managers, like pkgtool, slackpkg, slapt-get etc.

Cheers
 
Old 11-10-2010, 03:21 PM   #18
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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
Hi bathory,

I tried the above command you suggested, it came back with errors and didn't install correctly. This is a older machine that wasn't installed with all the packages from the slackware installation disk. So I decided to download Slackware 13.1 and install on a new machine, and installed every package, I installed Squid. Configured it with the --enable-external-acl-helpers=session, and it installed fine. I see squid_session in the /usr/local/squid/libexec/ directory. I see how it installs correctly now, I would to get this to work on the original machine, (installing squid_session) After using pkgtool, I see that I can reinstall a package from the slackware disc. Which package would I need to install from my Slackware disc, so that my Berkeley DB error will go away when I reconfigure Squid?

thanks
 
Old 11-10-2010, 04:27 PM   #19
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,

Looks like Slackware 12.2 comes with both libdb-4.2 and libdb-4.4 libraries.
You can install any of them, as they both provide the missing header file. IMHO better install the newer one (libdb-4.4.20-i486-2.tgz)
 
Old 11-10-2010, 04:42 PM   #20
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
not sure if its possible with apache per-se but i would imagine some sort of authentication type server like a radius server could do this, that sort of thing is done in hotels and airport internet kiosks quite often where until a mac address is authenticated it redirects all traffic from that machine to a site for them to enter payment information and then expires the authentication once they amount of time paid for is up,
 
Old 11-12-2010, 09:41 AM   #21
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

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

Looks like Slackware 12.2 comes with both libdb-4.2 and libdb-4.4 libraries.
You can install any of them, as they both provide the missing header file. IMHO better install the newer one (libdb-4.4.20-i486-2.tgz)
Hi bathory,

I followed your link you provided, looking through packages, I don't see (libdb-4.4.20-i486-2.tgz). Is the package I need, named something else or am I blind?

Thanks
 
Old 11-12-2010, 03:17 PM   #22
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,

You're not blind
The package name is actually db44-4.4.20-i486-2.tgz. Get it
here
 
1 members found this post helpful.
Old 11-12-2010, 03:32 PM   #23
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi bathory,

I am running Slackware 12.0, I downloaded (db44-4.4.20-i486-2.tgz) using wget. I tried to untar it, to install it, but it didn't work. Then I tried to use pkgtool to install it, the package shows up and click yes to install it. Waits for 20 sec., seems like it is installing it. But when I go to reconfigure Squid, it error missing header files. Am I missing on how to install this?

Thanks

Last edited by slomok; 11-15-2010 at 08:50 AM.
 
Old 11-15-2010, 01:01 PM   #24
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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
Hi bathory,

I successfully installed Berkeley db package using installpkg. I reconfigured Squid with squid_session, after looking through the directories I don't have /usr/local/squid/share/errors/templates/banner. Did you create the directories /templates/banner.

I have /usr/local/squid/share/errors/English/ERR_ACCESS_DENIED that is where I found the templates. Do I need to create those directories?

Thanks

Last edited by slomok; 11-16-2010 at 09:29 AM.
 
Old 11-15-2010, 01:30 PM   #25
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,

banner is the file with the agreement you want to use for your users.

Quote from my post #11:
Quote:
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.
Using %U, allows squid to redirect the user in his destination page after reading the banner page.
 
Old 11-15-2010, 02:54 PM   #26
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi bathory,

I see what you did with this command: cp /usr/local/squid/share/errors/templates/ERR_ACCESS_DENIED /usr/local/squid/share/errors/templates/banner, you copied the ERR_ACCESS_DENIED template and renamed banner, right? My directory location is located in /usr/local/squid/share/errors/English. I copied that Error template and renamed to banner in that directory. I rebooted the my server, opened a webpage on a client machine and seen that the squid error template was displayed. However when I did a reload of the webpage it went to google, and when I closed the browser and reopened it, I was never given that squid error webpage again. I thought the webpage was suppose to come up everytime the browser was reopened.

Thanks
 
Old 11-15-2010, 03:46 PM   #27
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi bathory,

I got it to work, I see now how it is working. I want the agreement page to come up everytime the browser is opened though.

Thanks
 
Old 11-15-2010, 05:22 PM   #28
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
Quote:
I want the agreement page to come up everytime the browser is opened though.
This is how squid_session works if I can understand well the manpage.

Looking at squid.conf, I think you can try %SRCPORT instead of %SRC to see if it does what you're trying to do. Because everytime you close and reopen your browser, it uses a different source port to connect to squid.

Other things to try if the above does not work:
You can use a smaller timeout (e.g. -t 60), so the session timeouts sooner (every minute). But in this case if the user stays idle for a min. it will be presented with the agreement page, when he tries to use the browser again.
Or you can change %SRC, with %LOGIN, so the session lasts as long as the user stays logged in. Of course you need to authenticate users in squid in this case. Note also that if the user closes its browser without logging out first and then re-opens it, he won't see the agreement page if the session hasn't timeout.
 
1 members found this post helpful.
Old 11-16-2010, 09:27 AM   #29
slomok
LQ Newbie
 
Registered: Nov 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
This is how squid_session works if I can understand well the manpage.

Looking at squid.conf, I think you can try %SRCPORT instead of %SRC to see if it does what you're trying to do. Because everytime you close and reopen your browser, it uses a different source port to connect to squid.

Other things to try if the above does not work:
You can use a smaller timeout (e.g. -t 60), so the session timeouts sooner (every minute). But in this case if the user stays idle for a min. it will be presented with the agreement page, when he tries to use the browser again.

Hi,

I tried using %SRCPORT instead of %SRC, when I open a browser the webpage comes up, but I cannot navigate away from it. I don't want to authenticate users to login. I just want the webpage to come up every 30 minutes, I tried changing the -t 60, but when I was surfing, it seemed to never go back to agreement page. After a certain amount of just leaving the computer, I get the agreement page. Does this mean the computer needs to be idle for 1 minute before squid will show the webpage? I keep looking at the manpage, but just not getting it.

Thanks

Last edited by slomok; 11-16-2010 at 09:29 AM.
 
Old 11-16-2010, 03:25 PM   #30
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
Quote:
Does this mean the computer needs to be idle for 1 minute before squid will show the webpage?
From what I can understand from the squid_session manpage, this is what the timeout is. If the user stays idle for the timeout period the session expires and he will be presented with the agreement page. Else if he uses his browser continuously, he won't see the agreement page again, because the session is not expiring.

If you want the page to come up every 30min, I guess you have to reload squid through a cronjob every 30min. Nasty solution but I cannot see another alternative.

Regards
 
1 members found this post helpful.
  


Reply



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 04:27 AM.

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