LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
  Search this Thread
Old 12-06-2013, 09:36 AM   #1
stamour547
LQ Newbie
 
Registered: Apr 2003
Location: NY, USA
Posts: 16

Rep: Reputation: 0
Squid problem


Hi guys, I have a little problem here. I have been tasked with building out a squid proxy with the purpose of a web request coming in from the internet, hitting squid, and if the request is for a certain set of urls (we'll use example.com for example) gets translated. For example, if the request is for example.com, qquid would translate it to dev.example.com. Squid by itself works find but when I try to get a url_rewrite perl script to work I get the error message of squid[3286]: The store_rewriter helpers are crashing too rapidly, need help!

Here is the code from the perl script I am using (I don't know perl, I found this online and was changing the domain info myself).

#!/usr/bin/perl
use strict;

# Turn off buffering to STDOUT
$| = 1;

# Read from STDIN
while (<>) {

my @elems = split; # splits $_ on whitespace by default

# The URL is the first whitespace-separated element.
my $url = $elems[0];

# Handle foo.example.com links and translate them to bar.example.com
# with the rest of the URL intact (if present). Ignore warnings...
if ($url =~ m#^http://\.dev\.sendwordnow\.com(/.*)?#i) {

$url = "http://.dev.sendwordnow.local${1}";

print "$url\n";

}

# The last part, "(/.*)?", is redundant, but I added it because it might
# be useful to some. That part would be in $1 in this example.
elsif ($url =~ m#^http://\.sendwordnow\.com(/.*)?#i) {

# Redirect them to some intranet site...
$url = "http://\.dev.sendwordnow.local${1}";

print "$url\n";

}


}


else {

# Unmodified URL
print "$url\n";
}
}

Thank you in advanced.

Justin
 
Old 12-10-2013, 08:05 AM   #2
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
I do not know if this is your issue but you are escaping the first period in the URL below.
Code:
$url = "http://\.dev.sendwordnow.local${1}";
Translation would be
Code:
http://.dev.sendwordnow.local$
 
  


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
[SOLVED] Is it possible to use squid in same ip subnet with WAN IP? Iptables Squid port problem. neopandid Linux - Server 2 03-18-2013 02:14 AM
Problem with configuration of Squid server behind a squid ajitup Linux - Server 13 08-12-2009 10:55 PM
Squid Problem (squid restrict some trusted sites.). jpmaxyusuf Linux - Networking 3 01-01-2009 11:33 AM
squid problem hariiyer Linux - Networking 6 02-14-2005 06:27 AM
Squid Problem MgF Linux - Software 2 08-26-2003 06:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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