nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Getting Squid 3.0 up and running

This is a discussion on Getting Squid 3.0 up and running within the Linux software forums, part of the Linux Getting Started category; Hi' there I have been trying to install Squid 3.0 today on my server and I am having a few ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 04-30-2008, 03:40 AM
Mic Mic is offline
Junior Member
User
 
Join Date: Apr 2008
My distro: Centos
Posts: 3
Rep Power: 0
Mic is on a distinguished road
Default Getting Squid 3.0 up and running

Hi' there

I have been trying to install Squid 3.0 today on my server and I am having a few problems getting it up and running as it should.Been reading most I could find about it, but its a bit confusing as I pretty new to this.

The software seems to be installed as it should but its the config file that is bugging me.
What I want is to set it up to cache my websites to prevent them loading from the harddrive every time someone visits the site. I got 6 websites running on the server with a diffrent IP for each, I will only need it to work on port 80 for this purpose and nothing else. Right now I got no clue how to make it work for all the domains at once so If someone could post a simple squid.conf that would do the trick, it would make me a happy man.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-02-2008, 02:29 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 576
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

You need to configure squid and apache - it is called reverse proxy - Squid Reverse Proxy
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #3 (permalink)  
Old 05-03-2008, 05:31 PM
Mic Mic is offline
Junior Member
User
 
Join Date: Apr 2008
My distro: Centos
Posts: 3
Rep Power: 0
Mic is on a distinguished road
Default

Thanks for the reply, already seen that page though. It is all the acls settings that got me all confused.
First of all I don't seem to be using any internal IPs, and some of the settings doesnt seem to be needed if you only use it for a reverse proxy.
Reply With Quote
  #4 (permalink)  
Old 05-03-2008, 07:55 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 966
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Assuming that proxy and apache is on same server.

Open httpd.conf and make sure you have something as follows:
Code:
Listen 127.0.0.1:80
NameVirtualHost 127.0.0.1:80
Now open squid conf and setup as follows:
Code:
http_port 80 # Port of Squid proxy
httpd_accel_host public.IP.address.server # IP address of web server
httpd_accel_port 80 # Port of web server
httpd_accel_single_host on # Forward uncached requests to single host
httpd_accel_with_proxy on #
httpd_accel_uses_host_header off
Add acl as follows:
Code:
acl mydomain dstdomain .yourdomain.com
http_access allow mydomain
Restart both squid and proxy:
Code:
service httpd restart
service squid restart
Test it!
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #5 (permalink)  
Old 05-18-2008, 03:56 PM
Mic Mic is offline
Junior Member
User
 
Join Date: Apr 2008
My distro: Centos
Posts: 3
Rep Power: 0
Mic is on a distinguished road
Default

thanks, but a few of these features seems to have been removed in 3.0.

efter giving up I gave it another try today and actually got it partly working with this config:

http_port 3128 defaultsite=www.mysite.com vhost
forwarded_for on
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
cache_peer MYSITEIP parent 80 0 no-query originserver name=apache
acl sites_apache dstdomain Website Hosting - Mysite.com mysite.com
acl our_sites dstdomain Website Hosting - Mysite.com mysite.com
cache_peer_access apache allow sites_apache
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/24
acl to_localhost dst MYSITEIP/24
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
http_access allow our_sites2
http_access allow our_sites
http_access allow manager all
http_access allow manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
access_log /var/log/squid/access.log
cache_mgr someone@somewhere.com

1) Question, does it still work as a webcache/accelerator without the accel in http_port 3128 accel defaultsite=www.mysite.com vhost, as I couldn't get it running with that switch?

2) How to make it work for more domains than mysite.com? I got 4 domains on that server each with a diffrent IP, and I don't seem to be able to use more than 1 line of http_port 3128 defaultsite=www.mysite.com vhost or cache_peer MYSITEIP parent 80 0 no-query originserver name=apache lines.

Last edited by Mic; 05-18-2008 at 04:10 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Monitor Running Services barrett.wendt@aquila.com Shell scripting 2 06-25-2007 09:24 PM
how to enumerate currently running process hiimsa Coding in General 2 11-11-2006 03:02 PM
How long the sys was running? jithendra Linux software 2 10-16-2006 05:31 PM
running .sh script linux jerry Shell scripting 1 06-17-2006 01:45 PM
remotely running X from other system ricc Linux software 4 09-15-2005 11:19 AM


All times are GMT +5.5. The time now is 06:16 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36