pirla | Hello there. Any EasyDeb user here? | 17:42 |
---|---|---|
brolin_empey | I 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 |
KotCzarny | are you asking to do your job for you? | 20:46 |
brolin_empey | No, 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_empey | Part 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 |
KotCzarny | just use php/perl/python | 20:50 |
KotCzarny | or whichever lang you are best with | 20:50 |
brolin_empey | I think the whole job can be done with bash, sed, and some basic commands such as mv, rmdir. | 20:51 |
brolin_empey | Actually, 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 |
sixwheeledbeast | The question is, will you need to do something similar in the future. If so it is worth the effort to script it. | 21:07 |
sixwheeledbeast | Use the best tool for the job. | 21:07 |
brolin_empey | sixwheeledbeast: 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_empey | and reload the apache2 configuration. | 21:22 |
brolin_empey | Er, 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_empey | It is tedious but if I do only one or a few servers per day then the tedium will be less. | 21:26 |
sixwheeledbeast | I 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/!