LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-28-2005, 09:20 PM   #1
linus johann
Member
 
Registered: Jan 2005
Location: philippines
Distribution: rh 9
Posts: 71

Rep: Reputation: 15
squid problem in rh9


hello all... i have just installed rh 9 on my machine.. my problem is everytime i try to run squid, it displays a message saying there is a problem with a visible hostname... now i know i have to edit the squid.conf.default file... but i dont know how to use the text editor to edit the file.. how can i replace the texts in the file and then save it so that it will replace the original file... i hope u guys can help me...

i have tried using squid on a widows machine before (edited the config file using notepad) and it worked fine... what i dont know in linux is how to use the text editor (vi, gedit, etc...)
 
Old 01-28-2005, 11:12 PM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
hi there

use the simple vi editor
maybe u should look for a manual on vi editor

also if u are using some type of desktop, why don't u just open that file in sme editor like kate etc

also in squid.conf set the
visible_hostname tag to the hostname of ur machine

u can look the hostnmae of ur machine by the command

hostname

regards
 
Old 01-29-2005, 09:40 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
also remember that visible_hostname doesn't have to be the actual name of your machine... it's just whatever name you want to be made visible to the clients using squid, like, for example, in the error messages and stuff...

so just add a line like this to your squid.conf:

visible_hostname whatever
 
Old 01-29-2005, 08:16 PM   #4
linus johann
Member
 
Registered: Jan 2005
Location: philippines
Distribution: rh 9
Posts: 71

Original Poster
Rep: Reputation: 15
tnx for the replies... now, forgive me for being hard-headed, but is there any other text editors out there that works a lot like windows notepad??? i find it hard to use vi (dont know how to save the file that i edit)... it's really frustrating for a linux newbie like me.. hope u have the patience to indulge my queries...
 
Old 01-29-2005, 10:36 PM   #5
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
use Kate, kwrite etc

for vi
after u have made ur changes

press ESC
then
:
then
wq

and u will exit out of the vi shell saving ur file

regards
 
Old 01-30-2005, 06:01 AM   #6
linus johann
Member
 
Registered: Jan 2005
Location: philippines
Distribution: rh 9
Posts: 71

Original Poster
Rep: Reputation: 15
hello again guys!! i finally learnt to edit the squid.conf file (BIG TNX to masand!!!) using vi...

now, i got another problem.. when i try to start squid, it displays the following:

squid failed. The error was: init_cache_dir /var/spool/squid... /etc/init.d/squid: line 162: 3989 Aborted $SQUID -z -F -D 2>/dev/null
Starting squid: /etc/init.d/squid: line 162: 3990 Aborted $SQUID $SQUID_OPTS 2>/dev/null
[FAILED]


hope u can help again... i really appreciate it!
 
Old 01-30-2005, 06:03 AM   #7
linus johann
Member
 
Registered: Jan 2005
Location: philippines
Distribution: rh 9
Posts: 71

Original Poster
Rep: Reputation: 15
also this error message:


squid is stopped
FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'

Squid Cache (Version 2.5.STABLE1): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 386
/etc/init.d/squid: line 162: 4065 Aborted $SQUID -k check

tnx again in advance!!
 
Old 01-30-2005, 06:33 AM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
please post your squid.conf so we can take a look at it and suggest changes...

you don't need to post the comments... just do something like this:

Code:
cat /etc/squid/squid.conf | grep -v ^#
i'll explain what the command does in case you are curious:
Quote:
the "cat" outputs the contents of squid.conf... if you only did the "cat" part, then you'd get the entire contents of the file, and the squid conf file is HUGE cuz it's filled with all kinds of comments...

the "|" (called a "pipe") redirects that output to the next command's input (grep)...

the "grep" will display only the pattern we ask for in the input it has been given...

the "-v" inverts the above, making grep display anything BUT the pattern we ask of it...

the "^#" tells grep the pattern is "any line that begins with "#", the "^" (called a carot) is what means "beginning with"...

so the command reads: "show me all the contents of squid.conf except the lines that begin with a "#"...

also, you have created user "squid" (without shell) and group "squid" for the cache, right?? the cache directory needs to have ownership set to those...

it's good that you are getting the feel of vi... it can be much easier and windows-like to use a graphical text editor, but learning to use vi is vital for any linux/unix admin... it would be great if you'd read a couple intros to vi when you have time, here's some:

http://www.google.com/linux?hl=en&lr...=Google+Search

Last edited by win32sux; 01-30-2005 at 06:48 AM.
 
Old 01-30-2005, 07:26 AM   #9
linus johann
Member
 
Registered: Jan 2005
Location: philippines
Distribution: rh 9
Posts: 71

Original Poster
Rep: Reputation: 15
ok, here it is:


hierarchy_stoplist cgi-bin ?

acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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 manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

http_access allow localhost
http_access deny all

http_reply_access allow all

icp_access allow all
coredump_dir /var/spool/squid
 
Old 01-30-2005, 07:42 AM   #10
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
i believe u haven't uncommented the visible hostname tag!

remove the

'#" before it

regards
 
Old 01-30-2005, 07:46 AM   #11
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
i forgot to put the command for "don't show me the blank lines"...

here it is:

Code:
cat /etc/squid/squid.conf | grep -v ^# | grep -v ^$
this way you don't need to manually remove the huge chunks of space that you would get when removing the comments in the first grep...

i'll be taking a look at your file in a little bit...

please re-post the contents of your squid.conf using the additional grep if you feel it's possible that you might have unintentionally deleted something when clearing the blank lines manually...

also, please answer the question about the squid user/group and the cache directory in my previous post...
 
Old 01-30-2005, 08:49 AM   #12
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
okay, try with this file, i've tweaked it for you... the stuff in bold should be edited by you... once you have everything working you can go and customize the rest of the stuff... i set it to proxy just HTTP and FTP in this example, as the other stuff is fine if you just NAT it with your firewall/router (they don't really need the acceleration provided by the cache)... but just add the ports if you want to proxy them too...

Code:
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl Safe_ports port 80
acl Safe_ports port 21
acl my_network src 192.168.0.2-192.168.0.254
http_access allow localhost
http_access deny !Safe_ports
http_access allow my_network
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow localhost
coredump_dir /var/spool/squid
cache_effective_user squid
cache_effective_group squid
cache_dir ufs /somewhere 512 32 256
cache_mem 32 MB
maximum_object_size 8192 KB
maximum_object_size_in_memory 32 KB
cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA
cache_mgr you@youremail.com
cache_store_log none
cache_access_log /dev/null
visible_hostname whatever
pid_filename /var/run/squid.pid
you'll need to make a directory for the cache somewhere... the directory will need to be owned by user squid, which in turn belongs to group squid... once you have your squid.conf in order and the cache directory created, and BEFORE you run squid, you'll need to create the structure with:

Code:
squid -z
once it's done creating the cache structure, start squid with:

Code:
squid -DF
the conf file i made might have mistakes in it or it might be missing something, as i haven't been able to test it and i've done it in a hurry, but it should be okay generally speaking...

you should also specify the IP address of the interface you want squid to listen on, so that you don't have it listening everywhere.. just put a line like this in the conf file (in this example your internal nic has the ip of 192.168.0.1):

Code:
http_port 192.168.0.1:3128
it's also very important that you have your firewall properly configured, allowing only packets to port 3128 on the internal nic, for example...

Last edited by win32sux; 01-30-2005 at 09:01 AM.
 
Old 01-30-2005, 08:31 PM   #13
linus johann
Member
 
Registered: Jan 2005
Location: philippines
Distribution: rh 9
Posts: 71

Original Poster
Rep: Reputation: 15
i did paste the config that u posted here, but i couldnīt create the structure... it says terminated abnormally, couldnīt determine fully qualified hostname.... itś giving me a headache... i didnīt realize that learning to run applications in linux can be a pain.... ahhh!! is it way too deep for my inferior intellect?????

anyways, hereś what i did with the config u gave me:

acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl Safe_ports port 80
acl Safe_ports port 21

acl my_network src 192.168.0.1-192.168.0.222

http_access allow localhost
http_access deny !Safe_ports
http_access allow my_network
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow localhost
coredump_dir /var/spool/squid
cache_effective_user squid
cache_effective_group squid

cache_dir ufs /etc/squid/cache 512 32 256

cache_mem 32 MB
maximum_object_size 8192 KB
maximum_object_size_in_memory 32 KB
cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA

cache_mgr onehotdudeman@hotmail.com

cache_store_log none
cache_access_log /dev/null

visible_hostname Squid

pid_filename /var/run/squid.pid


did i do it right? or am i missing something here???
wanna thank all of u guys for your patience with me..
 
Old 01-30-2005, 08:45 PM   #14
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
are you still getting the "visible hostname" message along with that "fully qualified hostname" error??

try setting the visible hostname to whatever the output of the "hostname" command gives you, as suggested by masand...

also, you have created user and group squid, right??

and the ownership of your cache folder is set to those??
 
Old 01-30-2005, 09:19 PM   #15
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
u need to set ur visible hostname correct

this is the only problem i think!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RH9 Squid Problem? Arenba Linux - Newbie 11 03-15-2006 09:15 AM
Squid Problem vivekthemind Linux - Security 16 10-04-2005 12:24 PM
squid problem hariiyer Linux - Networking 7 01-31-2005 11:20 AM
how can i upgrade my squid 2.5 stable 1 to stable 3 in RH9? debloxie Linux - Networking 0 05-12-2004 08:49 PM
how can i upgrade my squid 2.5 stable 1 to stable 3 in RH9? debloxie Linux - Networking 0 05-12-2004 11:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration