allow access to a website in squid?

General discussion about PLUC and Linux in Pakistan.
arahman_80
Cadet
Posts: 7
Joined: Fri May 18, 2007 4:37 pm

allow access to a website in squid?

Postby arahman_80 » Fri May 18, 2007 9:52 pm

Hi there,
How can I configure the squid config file to allow access to a specific website say for example www.hotmail.com or wat I am trying is
msc83denmark.dk. I am using Redhat linux 9 and squid 2.5 is installed on it.


Can anyone please help me with this?
Would be of great help if anyone can reply to this as soon as possible as it is very urgent.

Many thanks in advance.
cheers

LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Postby LinuxFreaK » Sat May 19, 2007 10:21 am

Dear arahman_80,
Salam,

Below configuration in your squid configuration file will help you out.

Code: Select all

acl hotmail dstdomain .hotmail.com
acl hotmail dstdomain www.hotmail.com
http_access allow hotmail
httP_access deny all


What this configuration will do. It will allow *.hotmail.com and deny all other traffic.

Best Regards.
Farrukh Ahmed

arahman_80
Cadet
Posts: 7
Joined: Fri May 18, 2007 4:37 pm

Postby arahman_80 » Mon May 21, 2007 5:56 pm

Hi
Thanks for you help.
I created this for www.msc83denmark.dk

acl msc83denmark dstdomain .msc83denmark.dk
acl msc83denmark dstdomain www.msc83denmark.dk
http_access allow msc83denmark
http_access deny all

but it gave me an error when i ran the squid again that www.msc83denmark.dk is already part of .msc83denmark.dk and you should probable remove www.msc83denmark.dk from the acl msc83denmark.

And I removed it and there were no errors.

Now I tried to access the website from the client PC but when I open the website www.msc83denmark.dk then it opens and if I click the link accomodation it works fine and then if I try to book a hotel in copenhagen called copenhagen Island then the website is redirected to a website called
http://www.bdp.dk/msc.htm and then if i click the link to book a hotel in copenhagen it is redirected on to this address
http://213.173.246.77/bdp/msc/

if you access the website you will know what i mean and here it does not open any page and it gives me this error

ERROR
The requested URL could not be retrieved

--------------------------------------------------------------------------------

While trying to retrieve the URL: http://213.173.246.77:8080/bdp/index.php?

The following error was encountered:

Connection Failed
The system returned:

(110) Connection timed outThe remote host or network may be down. Please try the request again.

Your cache administrator is abrahman@imo.org.



--------------------------------------------------------------------------------

Generated Mon, 21 May 2007 14:15:55 GMT by imo26.imo.org (squid/2.5.STABLE1)



Can you please help me with this?
thankyou very much for all the help.
thanks

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Mon May 21, 2007 7:51 pm

which means it's working as expected. you configured it to allow access to msc83denmark.dk and to deny all others, you went to www.msc83denmark.dk and it worked, you went to some other site and it didn't work.

what's the problem?

arahman_80
Cadet
Posts: 7
Joined: Fri May 18, 2007 4:37 pm

Postby arahman_80 » Mon May 21, 2007 7:58 pm

when I open www.msc83denmark.dk it opens a webpage
then i click accomodation link on it
then there is this link
"Please use this link to make hotel reservations with BDP Conference Service"
And I click this link then it opens a new webpage with this address
http://www.bdp.dk/msc.htm

Then I need to register a hotel booking

"Hotel Copenhagen Island - Not classified/design hotel


Please click here to register"

And when I click the above link it opens up another webpage with this address

http://213.173.246.77/bdp/msc/

but this page wont open. It gives the error which I pasted in my previous reply.

Do you know what could be the issue?

thanks

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Mon May 21, 2007 11:09 pm

let me try another way to explain the obvious to you.

arahman_80: i want to configure squid to allow access to msc83denmark.dk.
linuxfreak: here's an example of the configuration you want. it allows access to .hotmail.com and denies access to other sites. you can adapt it for your requirements:

Code: Select all

acl hotmail dstdomain .hotmail.com
acl hotmail dstdomain www.hotmail.com
http_access allow hotmail
httP_access deny all

arahman_80: thanks for your help. i had to modify it a bit, but i can now access msc83denmark.dk. however, when i click on a link and go to http://213.173.246.77/bdp/msc/ i get an error.
lambda: it's working as designed. what's the problem?
arahman_80: i can access msc83denmark.dk, but when i click on a link and go to http://213.173.246.77/bdp/msc/ i get an error.

LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Postby LinuxFreaK » Tue May 22, 2007 8:05 am

Dear arahman_80,
Salam,

You need to allow access to that IP Address.

Best Regards.
Farrukh Ahmed

arahman_80
Cadet
Posts: 7
Joined: Fri May 18, 2007 4:37 pm

Postby arahman_80 » Tue May 22, 2007 1:12 pm

Allowing access to that IP address did not work,
thanks for all the help guyz
but I still need the solution.
thanks

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Tue May 22, 2007 2:48 pm

let your normal policy be to allow access to all websites
deny access to sites you want to block.

arahman_80
Cadet
Posts: 7
Joined: Fri May 18, 2007 4:37 pm

Postby arahman_80 » Tue May 22, 2007 2:50 pm

Can you please tell me how do we do that?
thanks

arahman_80
Cadet
Posts: 7
Joined: Fri May 18, 2007 4:37 pm

Postby arahman_80 » Tue May 22, 2007 2:51 pm

Hi this is my MSN id
arahman_80@hotmail.com
So if you have msn please add me into ur list and we can talk abt this online if you dont mind.
thanks

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Tue May 22, 2007 3:18 pm

sorry, i have a rule against helping redhat 9 users.

arahman_80
Cadet
Posts: 7
Joined: Fri May 18, 2007 4:37 pm

Postby arahman_80 » Tue May 22, 2007 3:19 pm

No problem.
But thanks for all the help.
thanks

LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Postby LinuxFreaK » Wed May 23, 2007 7:18 am

lambda wrote:sorry, i have a rule against helping redhat 9 users.


:roll:
Farrukh Ahmed


Return to “General”

Who is online

Users browsing this forum: No registered users and 0 guests