Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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...)
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...
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...
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:
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...
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...
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...
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.