# Squid



## orcun (Nov 28, 2008)

can i use squid with apache on a same server for a better performance for my web page(php+mysql)??


----------



## danger@ (Nov 28, 2008)

if you are looking for reverse-proxy, check out varnish.

I have no experiences with squid, but speaking of varnish, yes you can run it on the same server even IP as web server. You just have to configure your web server to listen on different port.


----------



## EliasMandouvalos (Nov 29, 2008)

Of course you can. You can ckeck out the fine howto on the following link:

http://www.visolve.com/squid/whitepapers/reverseproxy.php

But it will make little sense to use such a configuration with squid and apache running on the same machine. It makes great sense if you have a cluster of webservers (two or more) behind the proxy server, in which case, squid will load balance the incoming requests...


----------



## paulfrottawa (Feb 18, 2009)

orcun said:
			
		

> can i use squid with apache on a same server for a better performance for my web page(php+mysql)??




I'm just starting into squid now after reconfiguring my network for it. If the directions in squid said that's how to use it I'd be there.


----------



## Mel_Flynn (Feb 18, 2009)

orcun said:
			
		

> can i use squid with apache on a same server for a better performance for my web page(php+mysql)??



Generally, no. You can use squid and apache on the same machine as a reverse proxy. The better performance part generally doesn't work:

Both squid and apache fight for network, cpu and memory resources on the machine, most notably the IO cache.
The bottleneck in serving dynamic requests with php/mysql is never the webserver
Webserver delivers static content faster then a (reverse) proxy

You would do better to analyze your queries.


----------



## paulfrottawa (Mar 1, 2009)

OK 
I have a machine called proxy running three jails. ns, mail , www (squid) using the jail applications example.  Everything is working and I'm using the proxy for my network browsers. 

My setup is cable modem >> proxy ip=192.168.0.1, plus jails ip=192.168.0.3-5 Then out to 192.168.0.2 "IN" >> dlink router out >> My network where ip=192.168.2.136 sits and has three alaises 192.168.2.3-5. 5 being my   test web server. 

How would I connect the world through my proxy for the test web content?

Thanks in advance.


----------

