[thechat] Test replacement

Hassan Schroeder hassan at webtuitive.com
Thu May 7 08:53:12 CDT 2009


Chrome wrote:

>> In the course of writing a script that installs a subdomain I've found
>> the
>> need to be able to uninstall... Basically the script needs to be able
>> to
>> remove a standard httpd directive from the conf file... 

> Anyway, I fixed this by putting the routine into a PHP script and piping a
> `cat` of the file to it... The PHP script reads STDIN then echos the result
> which can then be redirected back to the original file
> 
> If there is a way to do it with sed I'd love to know it just as a matter of
> interest

It would be a lot easier and cleaner all the way around if you put
your subdomain info in a separate file and use `Include ` in your
main file.

If it were me, and I were going to have to add/delete subdomains in
any quantity, I'd probably save the basic httpd.conf and subdomain
fragments in a build directory and use make* to assemble them.

* or rake or ant, depending :-)

FWIW,
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
webtuitive design ===  (+1) 408-621-3445   === http://webtuitive.com
twitter: @hassan
                           dream.  code.



More information about the thechat mailing list