LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-03-2009, 10:32 AM   #1
ngiamol
Member
 
Registered: Apr 2009
Location: Athens - Hellas (greece)
Distribution: Centos
Posts: 36

Rep: Reputation: 16
SquidGuand and redirection


Good evening all,

I have complete the setup of a proxy sever (squid) and also the squidguard.

At the end of the .cfg file of squidguard is the redirect oprion
redirect http://www.foo.bar/defaultblocked.html (thats the default one).

Is it possible to use another page in my squid (lets say in http://localhost/etc/squid/index.html) without having to launch an apache?

Thanks in advance.
 
Old 10-04-2009, 04:29 AM   #2
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Quote:
Originally Posted by ngiamol View Post
Is it possible to use another page in my squid (lets say in http://localhost/etc/squid/index.html) without having to launch an apache?
Yes you can redirect to any address you like, it can be a legitament address, or a non-existent one also know as a blackhole. But definitely do not provide access to the filesystem by using etc/squid/index.html

What do you mean by launch apache, you mean need to run an apache server? if so, then no you don't have to run a web server to be able to redirect pages.

Last edited by fotoguy; 10-04-2009 at 04:31 AM.
 
Old 10-05-2009, 07:58 PM   #3
ngiamol
Member
 
Registered: Apr 2009
Location: Athens - Hellas (greece)
Distribution: Centos
Posts: 36

Original Poster
Rep: Reputation: 16
Yea, my point was that. I dont want to run a web server. The strange thing is that the .html page is in squid dir, but no matter what i did, cannot be displayed.
 
Old 10-11-2009, 11:32 AM   #4
ngiamol
Member
 
Registered: Apr 2009
Location: Athens - Hellas (greece)
Distribution: Centos
Posts: 36

Original Poster
Rep: Reputation: 16
No matter what i did, the redirection on squid is not working. If i remove the redirect link from squidguard, the blobk is not working. (thats on the manual of guard.)
ill post below the conf of squidguard in case that someone can see whats wrong with it.


# CONFIG FILE FOR SQUIDGUARD
dbhome /usr/share/squidGuard-1.3/db
logdir /var/log/squidGuard
# TIME RULES:
# abbrev for weekdays:
# s = sun, m = mon, t =tue, w = wed, h = thu, f = fri, a = sat
time workhours {
weekly mtwhfas 08:00 - 23:59
date *-*-01 08:00 - 23:59
}
# Allow The Permited Sites

# dest white {
# domainlist white/domains
# urllist white/urls

# BLOCKING PORN SITES

dest porn {
domainlist porn/domains
urllist porn/urls
}

# And redirect to the DEFAULT WARNING PAGE

acl {
default {
pass !porn all
redirect http://localhost/etc/squid/index.html
}
}


The problem seems to be the "http://localhost" because im not running any other service except squid and squidguard.
Is there any other way to display the "index.html" ?
Just for the info, the index.html just informs the user that the porn content is blocked.


Thanks in Advance
 
Old 10-12-2009, 03:57 AM   #5
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Sorry I haven't been able to reply to you previous post, I'll post my squid.conf, I know this works and it points to squidguard. You can use this one then adjust to suit your own needs.

Quote:

#squid.conf
http_port 3128
visible_hostname proxy.myhost.com

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8

# xomment out the netowrks that don't apply to you
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl manager proto cache_object

http_access allow localhost
http_access allow localnet
http_access deny to_localhost
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all

htcp_access allow localnet
htcp_access deny all

icp_port 0
icp_access allow localnet
icp_access deny all

#cache_peer proxy.myisp.com parent 8080 8080
#cache_peer proxy.anotherproxy.com parent 8080 8080 no-query default

cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
cache_mgr squid-admin@mydomain.com
cache_effective_user squid
cache_effective_group squid

pid_filename /var/run/squid.pid

hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

forwarded_for off

#redirect_program /usr/local/squidGuard/bin/squidGuard -c /usr/local/squidGuard/squidGuard.conf

Squid.conf needs to have things in the right order otherwise you can run into all sorts of connections issues, the log file and cache locations are set to the default locations, you may need to adjust to what you distro uses.

Last edited by fotoguy; 10-12-2009 at 04:02 AM.
 
Old 10-12-2009, 11:18 AM   #6
ngiamol
Member
 
Registered: Apr 2009
Location: Athens - Hellas (greece)
Distribution: Centos
Posts: 36

Original Poster
Rep: Reputation: 16
I didnt post my squid.conf because contains all the coments from the original conf and is quite bug.

My knowledhe is not that big in this part, but as far as i understand the problem seems to be in http://localhost/etc/squid/index.html
which is in squidguard.conf.
When trying to reach the a blocked porn site, i cant see the web page (so far so good), but i cant see either the web page that informs the users about the blocked content (thats the index.html).

The error i got on browser is the following.
========
While trying to retrieve the URL: http://localhost/etc/squid/index.html

The following error was encountered:

* Connection to 127.0.0.1 Failed

The system returned:

(111) Connection refused

The remote host or network may be down. Please try the request again.
=========

It seems that the access to this page cannot be done.
Any ideas?

Thanks in Advance
 
Old 11-04-2009, 05:31 AM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by ngiamol View Post
Is it possible to use another page in my squid (lets say in http://localhost/etc/squid/index.html) without having to launch an apache?
Quote:
Originally Posted by ngiamol View Post
The problem seems to be the "http://localhost" because im not running any other service except squid and squidguard.
Is there any other way to display the "index.html" ?
Just for the info, the index.html just informs the user that the porn content is blocked.
Are you saying that you want to display "index.html", a web page; which lives somewhere on "http://localhost", your firewall; to a protected host; w/o running Apache, a webserver? I don't think so, not unless you run a different webserver.
 
  


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
Redirection gdsoccer Programming 3 05-15-2008 12:13 PM
redirection rblampain Linux - Server 0 09-29-2007 12:39 AM
I/O redirection jittinan2 Linux - Newbie 7 08-21-2007 08:01 PM
redirection bhuvana Linux - General 2 07-03-2006 02:36 AM
redirection in C pantera Programming 2 08-11-2004 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:58 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