Results 1 to 3 of 3
Hello all,
I'm busy with Squid and it works great
But what I wanna do is to change the Squid http_access through a php form
This form will be accessed ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-11-2008 #1
How to edit squid.conf with a script?
Hello all,
I'm busy with Squid and it works great
But what I wanna do is to change the Squid http_access through a php form
This form will be accessed through a webbrowser.
With other words: how can I write some information in the middle of a file.
I prefer perl, C and php to write the script with.
Thanks in advanced.
- 03-02-2009 #2
This is not hard at all.
There are numerous ways to do it.
I think that the easiest is.
Read the file to the memory.
Split the file in two segments.
Segment_One -> Everything before what you want to edit.
Segment_Two -> Everything after what you want to edit.
Rewrite the file:
Write -> Segment_One
Write -> New_Text
Write -> Segment_Two
Hope that helps.
ps. if it doesn't, I can supply code snippers.
- 03-02-2009 #3
Thanks for the reply.
What I did was making two files (a top and a bottom).
With php I'm creating the rules I want and write it to the squid.conf
Code snipper sounds interesting.
Don't know how you want to send it to me?


Reply With Quote
