libera/#maemo/ Monday, 2018-08-13

pirlaHello there. Any EasyDeb user here?17:42
brolin_empeyI have to make the same changes to every apache2 virtual host on many servers.  The change is pretty simple, could be scripted but I fear that scripting it will take longer than doing it all manually.  Anyone want to try to help me script it?20:45
KotCzarnyare you asking to do your job for you?20:46
brolin_empeyNo, I could do it myself but it may be faster if someone with recent experience with the stuff involved can help me.20:48
brolin_empeyPart of it can be scripted with sed but I usually use sed only for the s(ubstitute) command so I do not know off hand how to do this job with sed.20:49
KotCzarnyjust use php/perl/python20:50
KotCzarnyor whichever lang you are best with20:50
brolin_empeyI think the whole job can be done with bash, sed, and some basic commands such as mv, rmdir.20:51
brolin_empeyActually, if I know how to interactively edit the vhost configuration file in vim, I guess I can simply put the ex commands I use in a script to be run by ex?20:53
sixwheeledbeastThe question is, will you need to do something similar in the future. If so it is worth the effort to script it.21:07
sixwheeledbeastUse the best tool for the job.21:07
brolin_empeysixwheeledbeast: Basically the change is to fix my mistake from years ago that prevents the vhost log files from being automatically rotated with the default OS configuration.  For every vhost on every server, I need to move the log files from /var/log/apache2/${vhost_name}/{access,error}.log to /var/log/apache2/${vhost_name}_{access,error}.log , edit the log lines of the vhost configuration file, remove the empty /var/log/apache2/${vhost_name}/ directory,21:22
brolin_empeyand reload the apache2 configuration.21:22
brolin_empeyEr, actually currently the vhost log files are in /var/log/apache2/vhosts/${vhost_name}/ but they should be in /var/log/apache2/ .21:25
brolin_empeyIt is tedious but if I do only one or a few servers per day then the tedium will be less.21:26
sixwheeledbeastI would start with one site, manually do the fix making notes/writing a bash script of your actions, then run it on another site.21:28

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!