Error when trying to access $ squidclient -p3128 -h 192.168.1.5 -u proxy

709 views
Skip to first unread message

sajuptpm

unread,
Jan 16, 2013, 8:40:47 AM1/16/13
to iit...@googlegroups.com
Hi,


1)

* I have a proxy setup with following entries in quid.conf
* I followed http://dabase.com/blog/Minimal_squid3_proxy_configuration/ 
* How can i test my proxy setup with user:proxy and password ????

$ sudo vim /etc/squid3/squid.conf =================================== http_access allow localhost acl localhost src 192.168.1.0/255.255.255.0 auth_param digest program /usr/lib/squid3/digest_pw_auth -c /etc/squid3/passwords auth_param digest realm proxy acl authenticated proxy_auth REQUIRED http_access allow authenticated








2)
saju@saju-desktop:~/cvt/trunk$ squidclient -p3128 -h 192.168.1.5 -u proxy
Proxy password: 
HTTP/1.0 400 Bad Request
Server: squid/3.1.19
Mime-Version: 1.0
Date: Wed, 16 Jan 2013 13:31:03 GMT
Content-Type: text/html
Content-Length: 3156
X-Squid-Error: ERR_INVALID_URL 0
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from localhost
X-Cache-Lookup: NONE from localhost:3128
Via: 1.0 localhost (squid/3.1.19)
Connection: close

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!-- 
 /*
 Stylesheet for Squid Error pages
 Adapted from design by Free CSS Templates
 http://www.freecsstemplates.org
 Released for free under a Creative Commons Attribution 2.5 License
*/

/* Page basics */
* {
	font-family: verdana, sans-serif;
}

html body {
	margin: 0;
	padding: 0;
	background: #efefef;
	font-size: 12px;
	color: #1e1e1e;
}

/* Page displayed title area */
#titles {
	margin-left: 15px;
	padding: 10px;
	padding-left: 100px;
	background: url('http://www.squid-cache.org/Artwork/SN.png') no-repeat left;
}

/* initial title */
#titles h1 {
	color: #000000;
}
#titles h2 {
	color: #000000;
}

/* special event: FTP success page titles */
#titles ftpsuccess {
	background-color:#00ff00;
	width:100%;
}

/* Page displayed body content area */
#content {
	padding: 10px;
	background: #ffffff;
}

/* General text */
p {
}

/* error brief description */
#error p {
}

/* some data which may have caused the problem */
#data {
}

/* the error message received from the system or other software */
#sysmsg {
}

pre {
    font-family:sans-serif;
}

/* special event: FTP / Gopher directory listing */
#dirmsg {
    font-family: courier;
    color: black;
    font-size: 10pt;
}
#dirlisting {
    margin-left: 2%;
    margin-right: 2%;
}
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {
    border-bottom: groove;
}
#dirlisting td.size {
    width: 50px;
    text-align: right;
    padding-right: 5px;
}

/* horizontal lines */
hr {
	margin: 0;
}

/* page displayed footer area */
#footer {
	font-size: 9px;
	padding-left: 10px;
}


body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
 --></style>
</head><body id=ERR_INVALID_URL>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>

<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="proxy">proxy</a></p>

<blockquote id="error">
<p><b>Invalid URL</b></p>
</blockquote>

<p>Some aspect of the requested URL is incorrect.</p>

<p>Some possible problems are:</p>
<ul>
<li><p>Missing or incorrect access protocol (should be <q>http://</q> or similar)</p></li>
<li><p>Missing hostname</p></li>
<li><p>Illegal double-escape in the URL-Path</p></li>
<li><p>Illegal character in hostname; underscores are not allowed.</p></li>
</ul>

<p>Your cache administrator is <a href="mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_INVALID_URL&amp;body=CacheHost%3A%20localhost%0D%0AErrPage%3A%20ERR_INVALID_URL%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Wed,%2016%20Jan%202013%2013%3A31%3A03%20GMT%0D%0A%0D%0AClientIP%3A%20192.168.1.5%0D%0A%0D%0AHTTP%20Request%3A%0D%0A%0D%0A%0D%0A">webmaster</a>.</p>
<br>
</div>

<hr>
<div id="footer">
<p>Generated Wed, 16 Jan 2013 13:31:03 GMT by localhost (squid/3.1.19)</p>
<!-- ERR_INVALID_URL -->
</div>
</body></html>
saju@saju-desktop:~/cvt/trunk$ 

satyaakam goswami

unread,
Jan 16, 2013, 8:48:41 AM1/16/13
to IITDLUG
<hr>
<div id="footer"> <p>Generated Wed, 16 Jan 2013 13:31:03 GMT by localhost (squid/3.1.19)</p> <!-- ERR_INVALID_URL --> </div> </body></html> saju@saju-desktop:~/cvt/trunk$
What is the distribution ? what are the the log eateries saying do you have any kind of firewall on the system ?

-Satya

satyaakam goswami

unread,
Jan 16, 2013, 8:50:16 AM1/16/13
to IITDLUG
 /s/eataries/entries

sajuptpm

unread,
Jan 25, 2013, 7:04:53 AM1/25/13
to iit...@googlegroups.com
Hi,

I an using Ubuntu 12.04 LTS and squid 3.

Following are the steps I followed and logs

===============================

saju@saju-desktop:~$ sudo vim /etc/squid3/squid.conf

#http_access allow localnet

http_access allow localhost
acl localhost src 192.168.1.0/255.255.255.0


auth_param digest program /usr/lib/squid3/digest_pw_auth -c /etc/squid3/passwords
auth_param digest realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated

# And finally deny all other access to this proxy
http_access deny all

===============================

saju@saju-desktop:~$ sudo htdigest -c /etc/squid3/passwords proxy saju
Adding password for saju in realm proxy.
New password:
Re-type new password:
saju@saju-desktop:~$

===============================

saju@saju-desktop:~$ sudo cat /etc/squid3/passwords
saju:proxy:996433679dbeb9e1d972457249f9a9b1

===============================

saju@saju-desktop:~$ sudo tail -f /var/log/squid3/access.log
1359115078.818      0 192.168.1.6 NONE/400 3512 GET saju - NONE/- text/html


===============================


saju@saju-desktop:~$ squidclient -h 192.168.1.6 -u saju

Proxy password:
HTTP/1.0 400 Bad Request
Server: squid/3.1.19
Mime-Version: 1.0
Date: Fri, 25 Jan 2013 11:57:58 GMT
Content-Type: text/html
Content-Length: 3154
<p>The following error was encountered while trying to retrieve the URL: <a href="saju">saju</a></p>


<blockquote id="error">
<p><b>Invalid URL</b></p>
</blockquote>

<p>Some aspect of the requested URL is incorrect.</p>

<p>Some possible problems are:</p>
<ul>
<li><p>Missing or incorrect access protocol (should be <q>http://</q> or similar)</p></li>
<li><p>Missing hostname</p></li>
<li><p>Illegal double-escape in the URL-Path</p></li>
<li><p>Illegal character in hostname; underscores are not allowed.</p></li>
</ul>

<p>Your cache administrator is <a href="mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_INVALID_URL&amp;body=CacheHost%3A%20localhost%0D%0AErrPage%3A%20ERR_INVALID_URL%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2025%20Jan%202013%2011%3A57%3A58%20GMT%0D%0A%0D%0AClientIP%3A%20192.168.1.6%0D%0A%0D%0AHTTP%20Request%3A%0D%0A%0D%0A%0D%0A">webmaster</a>.</p>
<br>
</div>

<hr>
<div id="footer">
<p>Generated Fri, 25 Jan 2013 11:57:58 GMT by localhost (squid/3.1.19)</p>

<!-- ERR_INVALID_URL -->
</div>
</body></html>
saju@saju-desktop:~$

===============================

Reply all
Reply to author
Forward
0 new messages