Linux Server Squid configuration

I have a Windows Server 2003 and from here i install Redhat Linux on VmWare.
On the Linux server I configured Samba Server as a File Server. Here i want to configure Squid as Proxy Server.

But the issue when i want to start the service of Squid i gen an error: FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'is

 Here i want to set the host name on squid.conf file but the file is not editable. i can not edit this file nor copy or paste the file.

Please help.

Who is Participating?
technicalsysConnect With a Mentor Author Commented:
Hi upanwar,

When i run the command service squid status it is showing service is running.

You will need to be root to edit the squid.conf file.  There is no other reason I can think of as to why you wouldn't be able to edit the file.

Hostname which you have set for your squid proxy server is not resolvable so either change your squid server hostname to locaalhost.localdomain or make a DNS entry in your local dns server for the hostname and add DNS server IP in resolve.conf

It will work. :)

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Fadi SODAH (aka madunix)Chief Information Security Officer, CISA, CISSP, CFR, ICATE, MCSE, CCNA, CCNP and CCIPCommented:
Edit squid.conf, search visible_hostname in squid.conf and mention a hostname , the hostname should be your server name as well  in /etc/hosts file.
Open a command window
type su
enter your password
type vi /etc/squid/squid.conf
type i
type visible_hostname host.domainname
press Esc key
type :wq
type service squid start

thats it
technicalsysAuthor Commented:

I define the host name at etc/squid/squid.conf below the tag visible_hostname as 'Linux" which is my hostname.

But still i got the error when i want to start the service  " squid failed. The errror was: init_cache_dir /var/spool/squid.../
etc/init.d : line 162: 2017 Aborted
$SQUID -2-
F 2> /de/null

Starting squid: /etc/init.d/squid: line 162. 2018

Aborted $SQUID $ SQUID_OPTS 2> /dev/null


Please suggest.

Once try my above given suggestion as well.. it should work...
Run the following command

squid -z

and then

service squid start

or post your /var/log/squid/cache.log files
technicalsysAuthor Commented:

Thanks for your help. I have added the hostname to squid.conf file and started the service.

But how can i test Squid is running or not. Basically this i testing from Linux 9.0 installed on Vmware. I have configured the Ip:192.1681.73 and SM and no gateway. Primary DNS Server i have given as I have configured the Proxy Settings on Mozia as Localhost and port 3128. but when i try to visit http://localhost:3128 it is giving error as "the requested URL  could not be retrived".

Please suggest, do i have to change any thing on the squid.conf file like IP address, or Network details or anything else. Attach my squid.conf file. How can i access this proxy server from the Network.

Thanks in advance.

You can test via command.

service squid status (it will tell you the status of the service whether it is running or not)

or with Netstat command

netstat -natp | grep 3128

from client machine to check the connectivity, just open the command prompt and then type.

telnet <ip address> 3128

if you get escape charector in means you are able to access proxy box from client and squid is runing.

and to access the proxy server you need to configure the proxy setting on clients browser and then client would be able to access the sites via this proxy.
Have you tried the other steps as well to check connectivity from other hosts as well.
technicalsysAuthor Commented:
Will check the with issue.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.