How to enable squid service ?

Taking care of your Linux box.
Post Reply
gardenair
Havaldaar
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm

How to enable squid service ?

Post by gardenair »

Assalm o-Alikum,

I have installed squid 2.6 in my cent os 5 machine. The installation location was

# ./configure@--prefix=/usr/local/squid

Normally with RPM base squid,to start and stop squid we use

# service squid start

# service squid stop

Now with source code based installation the start and stop services are not working. Kindly guide me that how can i do it?
thanks
garden
Kamran.Ahmed
Lance Naik
Posts: 45
Joined: Wed Dec 16, 2009 5:57 pm
Location: Karachi

Post by Kamran.Ahmed »

the start and stop script should be in /etc/init.d/ or if you install from source then they must be in installation source location
Kamran Ahmed Khan
kamran.cisco@gmail.com
Registered Linux User # 526139
www.allaboutlinux.org
gardenair
Havaldaar
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm

Post by gardenair »

Well kindly guide me about the script. or if there is already made script then let me know the link. I am too much worry how to fix the issue :( of squid start and stop .
nomankhn
Colonel
Posts: 714
Joined: Wed Aug 07, 2002 8:00 pm

Post by nomankhn »

gardenair wrote:Well kindly guide me about the script. or if there is already made script then let me know the link. I am too much worry how to fix the issue :( of squid start and stop .
Running Squid

Squid should now be configured, and the directories should have the correct permissions. We should now be able to start Squid, and you can try and access the cache with a web browser. Squid is normally run by starting the RunCache script. RunCache (as mentioned ealier) restarts Squid if it dies for some reason, but at this stage we are merely testing that it will run properly: we can add it to startup scripts at a later stage.

Programs which handle network requests (such as inetd and sendmail) normally run in the background. They are run at startup, and log any messages to a file (instead of printing it to a screen or terminal, as most user-level programs do.) These programs are often referred to as daemon programs. Squid is such a program: when you run the squid binary, you should be immediately returned to the command line. While it looks as if the program ran and did nothing, it's actually sitting in the background waiting for incoming requests. We want to be able to see that Squid's actually doing something useful, so we increase the debug level (using -d 1) and tell it not to dissapear into the background (using -N.) If your machine is not connected to the Internet (you are doing a trial squid-install on your home machine, for example) you should use the -D flag too, since Squid tries to do DNS lookups for a few common domains, and dies with an error if it is not able to resolve them.

The following output is that printed by a default install of Squid:

dxb-proxy:~ # /usr/local/squid/bin/squid -N -d 1 -D
Post Reply