skeep Posted March 2, 2010 Posted March 2, 2010 Hi All, I have squid setup up running and I want to add IP addresses to a text file and load that into the squid config. Then I can just add a new IP address to the file and it will work without restarting the service. I have tried this in the config but it is not working: acl localnet src "path/to/file/trusted_ip.txt" obviously I changed the path to the correct one! Am I missing something? The txt file has only one ip address init that I am using to test with: 10.143.20.96/255.255.255.255 If i add this line: acl localnet src 10.143.20.96/255.255.255.255 It works perfectly however, the ip address will be random and i do not want to have to restart the squid service. Is this possible?
keithu Posted March 2, 2010 Posted March 2, 2010 Yes, it's possible but you still have to tell squid to re-read its config file. Either run 'squid -k reconfigure' or send a HUP signal to the running process. What I do is have a background process running which watches the text file and sends squid a HUP (that's the Unix 'Hang Up' signal) whenever the file's timestamp changes.
skeep Posted March 3, 2010 Author Posted March 3, 2010 Thanks for the reply, When I point the conf at the txt file it does not work. If I enter the IP into the conf file directly it works. Is there anything special I need to do to get IP addresses working from an external file?
powdarrmonkey Posted March 3, 2010 Posted March 3, 2010 slash notation should just be /255 no? whut? No. 255.255.255.255 = /32. Classless Inter-Domain Routing - Wikipedia, the free encyclopedia
nicklec Posted March 3, 2010 Posted March 3, 2010 whut? No. 255.255.255.255 = /32. Classless Inter-Domain Routing - Wikipedia, the free encyclopedia Yeah sorry confused myself, have you added the line below the acl, "http_access allow aclname"?
keithu Posted March 3, 2010 Posted March 3, 2010 Have you made sure that the running squid process has permission to read the trusted_ip.txt file?
skeep Posted March 3, 2010 Author Posted March 3, 2010 It defiantly has permissions to view it. it is very strange that putting it directly in the config works but the txt doesn't! Not sure what to try next!
skeep Posted March 3, 2010 Author Posted March 3, 2010 all working now i started again from scratch and its fine! Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now