1. Initialize the cache directory you configured in squid.conf
#squid/sbin/squid -z //Start the squid service for the first time This command must be entered
If there is an error message, please check the permissions of your cache directory.
2. Troubleshoot your squid.conf, that is, verify the syntax and configuration of squid.conf.
#squid/sbin/squid -k parse
If there is a syntax or configuration error in squid.conf, you will be prompted here. If not, congratulations, you can try to start Squid.
3. Start Squid in the foreground and output the startup process.
#squid/sbin/squid -N -d1
If there are ready to server reques, congratulations, the startup is successful.
Then ctrl c to stop Squid and start it running in the background.
4. Start Squid to run in the background.
#squid/sbin/squid -s
At this time, you can use ps -A to view the system processes, and you can see two squid processes.
5. Stop squid
#squid/sbin/squid -k shutdown
No need to explain this.
6. Reboot the modified squid.conf
#squid/sbin/squid -k reconfigure
This is probably used more often. When you find that your When the configuration is not what you want, you can modify squid.conf at any time, and don't forget to troubleshoot your squid.conf, and then execute this command to make running Squid run according to your squid.conf again.
7. Add squid to the system startup items
Edit /etc/rc.d/rc.local
Add the following line: /usr/local/squid/sbin/squid -s
Of course, not everyone likes this startup method. You can use the method you are most comfortable with; or install it as a service.
Others
1. Modify the permissions of the cache directory.
#chown -R squid:squid /home/cache
My cache directory is /home/cache, and the squid execution user and user group are squid, squid.
2. Modify the permissions of the squid log directory
#chown -R squid:squid /usr/local/squid/var/logs
This step is not suitable for every user who uses squid. It means to let squid Have permission to write in this directory.
For example, generate access.log cache.log store.log
3. Check your log document.
#more /usr/local/squid/var/logs/access.log | grep TCP_MEM_HIT
This command can see which files are cached by Squid in the memory during the running of Squid and returned to access. user.
#more /usr/local/squid/var/logs/access.log | grep TCP_HIT
This command can see which files are cached by Squid into the cache directory during the running of Squid and returned to Access user.
#more /usr/local/squid/var/logs/access.log | grep TCP_MISS
This command can see which files are not cached by Squid during the running of Squid, but are now copied to the original server. Get and return to the accessing user.
For information about parameters and representatives such as TCP_XXXX, please refer to Chapter 13.2.1 of "Squid Chinese Authoritative Guide" by Peng Yonghua.
Of course, the blue text in this example can be modified to other parameters, such as your domain name. You can also see the line about the domain name in access.log.
4. squid -k rotate rotates the Squid log file /var/log/squid. The growth rate of the Squid proxy server log file
is amazing and easy. Penalty balls fill up the disk space, causing the system to not work properly or even crash. In order to solve the problem of log files growing too fast, Squid adopts the "rotation" method. In squid.conf, you can set the number of file rotations through logfile_rotate. For example:
logfile_rotate 10. The rotation work is generally done by crontab timer in periodic log rotation. For example, if log rotation is performed at 2:00 am every Saturday, execute the following command: crontab -e
0 2 * * 6 squid -k rotate
Tips: Squid’s default error message is in English, which is really inconvenient for users who are not good at English. Add the following to /etc/squid/squid.conf:
error_directory /usr/share/squid/errors/Simplify_Chinese will display Chinese error prompts.
http://www.bkjia.com/PHPjc/1127279.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1127279.htmlTechArticleUsing squid to build a proxy server on windows. In this article, the SQUID is placed on the machine 172.20.65.201, and the application WEB SERVER IP is 172.20.65.203, where SQUID is listening on port 80 on 201, test client...