How to build a proxy server with squid in linux _ detailed enough

Source: Internet
Author: User
How to use squid to set up a proxy server in linux _ enough details on how to use squid to set up a proxy server in linux, which is around the world, but some details are unclear on the Internet, it has been a good job for a long time. In a computer linux system, how can we build a proxy server with squid in linux? _ enough detail to build a proxy server with squid in linux, however, some details are unclear on the internet. after a long time, they have done a good job. A computer linux system, on the network, so in another linux can access the Internet to build a proxy server, the steps are as follows: Download: squid-3.2.9.tar.bz2 uploaded to the server after decompression: Unzip: tar-vxjf squid-3.2.9.tar.bz2 decompress the package To generate the directory: squid-3.2.9 go To the directory To read the documentation INSTALL: xxxx> more INSTALL To build and install the Squid Cache, type: %. /configure -- prefix =/usr/local/squid % make all % make install To run a Cache, you will need to: 1. customize the squid. conf configuration file: % vi/usr/local/squid/etc/squid. con F 2. initalise the cache: %/usr/local/squid/sbin/squid-z 3. start the cache: %/usr/local/squid/sbin/squid If you want to use the WWW interface to the Cache Manager, copythe cachemgr. cgi program into your httpd server's cgi-bindirectory. installation steps :. /configure -- prefix =/usr/local/squidmake allsudo make install, I am a ubuntu system, so with sudo, you can check the configuration file: sudo vi/usr/ Local/squid/etc/squid. conf configuration item 1: # Squid normally listens to port 3128http_port 3128 Configuration Item 2: acl localnet src 192.168.0.0/16http_access allow localnet configuration item 3: # Uncomment and adjust the following to add a disk cache directory. cache_dir ufs/usr/local/squid/var/cache/squid 100 16 128cache_mem 32 MB (this item must be configured) or you will encounter an error: 16:16:55 kid1 | WARNING cache_mem is larger than total disk cache space! After the installation is complete, a user squid is created in the system. check the user squid in the group and find the user in the nobody Group: cat/etc/passwd | grep squidcat/etc/group | the directory where grep 65534 installs squid is/usr/local/squid, directly changed the user to squid: nobodysudo chown-Rf squid: nobody/usr/local/squid when creating a cache, the following Directory requires the nobody user permission, this is something I did not say clearly on the internet. I 've been tossing around for a long time: sudo chown-Rf nobody/usr/local/squid/var/cache/sudo chown-Rf nobody/usr/local/squid/var/logs/otherwise you will encounter: WARNING: cannot write log file:/usr/local/squ Id/var/logs/cache. logFATAL: Failed to make swap directory/usr/local/squid/var/cache/squid/00: (13) Permission denied initialize squid. the cache directory configured in conf is a bunch of directories: sudo/usr/local/squid/sbin/squid-z, and output the startup process sudo/usr/local/squid/sbin/squid-N-d1 to show ready to server reques, then the startup is successful. You can press ctrl + c to stop squid and start it later. I didn't configure DNS in the configuration file, but in/etc/resolv. configuration in conf: domain sitenameserver x. x. x. so the printed log is like this: 16:42:13 | Adding nameserver x. x. x. x from/etc/resolv. conf squid reads the dns configuration from this configuration file. Start the squid background and run sudo/usr/local/squid/sbin/squid-s to check whether the process exists: ps-ef | grep squid view squid running status/usr/local/squid/bin/squidclient-h 127.0.0.1-p 3128 mgr: the machine that cannot access the Internet in info is configured as follows: export http_proxy = http://192.168.199.235:3128/ You can write this sentence to your startup file, such as. profile or. bashrc, or/etc/profile. Cancel: unset http_proxy to test whether the Internet can be accessed: wget www.163.com can be down and the file will be down!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.