Working Squid config file for 3.13

October 6, 2010 at 21:30:46
Specs: Macintosh
I am new to squid. I have been trying to run squid on UNIX . I have apache installed on the same server.

Can anyone provide me with the working squid config file for 3.13 or any sample config file.

Appreciate a quick response.

Thanks
VJ


See More: Working Squid config file for 3.13

Report •

#1
October 7, 2010 at 13:52:24
There is a file named "squid.conf.documented", where all the settings are well described.
This makes it easy for you, to configure your squid correctly.
Copy that file to squid.conf and edit the configuration for your needs.

The original poster should always write the last response !!!
Let us know, if the problem is solved !!!


Report •

#2
October 8, 2010 at 00:37:40
Thanks for the response Paul,

Here , As suggested , i have used the squid.conf.documented file to create a squid.conf file for my requirement, currently squid is starting up. But when I posting the request from web to squid e.g example:3128\example\home. The request is timing out and it is not updating the access.log . Below is the current configuration:

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl localhost src ::1/128
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl to_localhost dst ::1/128

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
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 localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

http_port 10.94.2.121:3128 vhost vport=80 defaultsite=http:\\example


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

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost

http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
#http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
#http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed

http_access allow localnet
http_access allow localhost

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

# Squid normally listens to port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /app01/squid313/var/cache 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /app01/squid313/var/cache

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

# Logging definitions
cache_access_log /app01/squid313/var/logs/access.log
cache_log /app01/squid313/var/logs/cache.log
cache_store_log /app01/squid313/var/logs/store.log


Anticipating a reply.


Report •

#3
October 8, 2010 at 08:01:57
http_port 10.94.2.121:3128 vhost vport=80 defaultsite=http:\\example

Isn't the server, you're running squid, the same as 10.94.2.121 ?

I would suggest, that you first get squid to run and then play arround with accelleration.

Exchange the line above to simply:
http_port 3128

Store the file and restart squid.

See what happens.

The original poster should always write the last response !!!
Let us know, if the problem is solved !!!


Report •

Related Solutions

#4
October 11, 2010 at 00:48:30
Yes Paul both Apache and squid are installed on 10.94.2.121 server.

Apache on Port 80 and squid on port 3128.

I have replaced the line as suggested by you to 3128 and restarted the squid.

After that , I have hit the URL http:\\example:3128:\home, expecting the squid access.log to be updated.

http:\\example:3128:\home page crashed(Page not found error)

Neither it has updated the access.log nor it has cached any content

Can you suggest any other steps


Report •

#5
October 11, 2010 at 03:20:24
This problem is on the dev server (Not the public site). Keeping the same configuration with http port 3128. And changing the browser settings to remove the option of bypassing proxy servers for local requests, the access.log has started getting updated.

But the page is crashing with "ERROR:The requested URL could not be retrieved"

and in access.log i can found below entries

123819332.453 1 10.100.6.70 NONE/400 3388 GET /example/news-events - NONE/- text/html
123268198.015 1 10.100.6.70 NONE/400 3384 GET /example/en/index.htm - NONE/- text/html
122323819.247 0 10.100.6.70 NONE/400 3344 GET /favicon.ico - NONE/- text/html
128682234.678 1 10.100.6.70 NONE/400 3382 GET /example/about-us - NONE/- text/html


Here it is giving NONE/400 error , look like the request is coming to squid but it is not getting redirected to apache. I have apache running on port 80.

Do i need to mention any specific settings in the squid.conf

Below is the squid.conf

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl localhost src ::1/128
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl to_localhost dst ::1/128

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
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 localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

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

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
#http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
#http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

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

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /app01/squid313/var/cache 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /app01/squid313/var/cache

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

# Logging definitions
cache_access_log /app01/squid313/var/logs/access.log
cache_log /app01/squid313/var/logs/cache.log
cache_store_log /app01/squid313/var/logs/store.log


Report •

#6
October 11, 2010 at 03:24:08
In the browser, you have to configure the use of the squid proxy.
E.g.:
Internet Explorer
1. click Tools / Internet options / Connection / LAN settings
2. activate the checkbox Proxy server
3. click Advanced
4. configure HTTP, Secure and FTP with the ip address of your proxy server and the port, your proxy server is listening to.
5. click OK until all configuration windows are closed
6. in the address line type http://www.google.com and press enter.

The same configuration must be done, if you're using firefox browser.
1. start Firefox
2. click Tools / Options / Advanced / Network / Settings
3. Click Manual Proxy configuration and configure HTTP, SSL and FTP to use your squid servers ip address and the port 3128.
4. click OK til all windows are closed and try http://www.google.com

The original poster should always write the last response !!!
Let us know, if the problem is solved !!!


Report •

Ask Question