Search:  
Gentoo Wiki

Squid_httpd_accelerator

Squid is a full featured http-proxy, however we just focus on its reverse-proxy abilities here; for the purpose of accelerating an httpd running on the same host.

visit squid-cache.org


Install

to install a squid proxy first you need to emerge squid.

emerge -v net-proxy/squid

Setup

Simple HTTPD Accelerator

setup your /etc/squid/squid.conf to match this if your using <net-proxy/squid-2.6:

####### Main Settings
http_port 10.10.10.10:80

acl all src 0.0.0.0/0.0.0.0
http_access allow all

## warning: for the line below to work be sure your httpd is able to listen on the 
## loopback (127.0.0.1), BindAddress directive in your httpd.conf

httpd_accel_host 127.0.0.1
httpd_accel_port 8080
httpd_accel_single_host on
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
redirect_rewrites_host_header off

cache_mem 128 MB
cache_dir ufs /var/cache/squid 512 16 256
maximum_object_size_in_memory 128 KB

coredump_dir /var/cache/squid

#cache_access_log none
cache_log none
cache_store_log none

visible_hostname none

setup your /etc/squid/squid.conf to match this if your using >=net-proxy/squid-2.6:

####### Main Settings
http_port 10.10.10.10:80 defaultsite=your.main.website

acl all src 0.0.0.0/0.0.0.0
http_access allow all

### cache_peer replace the former httpd_accel_* directives
## login=PASS is optional and useful in the case password protected
## pages' accesses fail endlessly

## warning: for the line below to work be sure your httpd is able to listen on the 
## loopback (127.0.0.1), BindAddress directive in your httpd.conf 

cache_peer 127.0.0.1 parent 8080 0 no-query originserver login=PASS
redirect_rewrites_host_header off

cache_mem 128 MB
cache_dir ufs /var/cache/squid 512 16 256
maximum_object_size_in_memory 128 KB

coredump_dir /var/cache/squid

#cache_access_log none
cache_log none
cache_store_log none

visible_hostname none

These settings should cause squid to listen to incoming http requests on #80 and serve up all the content from your local httpd server which is listening on port 8080.

Retrieved from "http://www.gentoo-wiki.info/Squid_httpd_accelerator"

Last modified: Sat, 06 Sep 2008 03:39:00 +0000 Hits: 4,869