fastest way to update /etc/apache2/sites-enabled/(virtual server).conf for all websites when changing to mpm-event

3 posts / 0 new
Last post
#1 Thu, 06/13/2019 - 16:41
adamjedgar

fastest way to update /etc/apache2/sites-enabled/(virtual server).conf for all websites when changing to mpm-event

hi guys, i have just completed the change from mpm-prefork to mpm-event in debian.

After making the changes and enabling mpm-event, of course apache would not restart, due to the sites-enabled conf file for each virtual server containing the following entry... "php_admin_value engine off"

say for example the following sites existed

  • /etc/apache2/sites-enabled/site1.conf
  • /etc/apache2/sites-enabled/site2.conf
  • /etc/apache2/sites-enabled/site3.conf

I went in and manually edited each file, however, what is a faster way?

What if one had hundreds of websites on a server?

Does this happen because i disabled rather than removed/uninstalled the old configuration used by the default apache installation?

Thu, 06/13/2019 - 17:15
andreychek

Howdy,

You can mass change config files using tools like Perl or sed.

One example of how to do that would be a command like this:

perl -pi -e 's/php_admin_value/#php_admin_value/g' /path/to/files/*.conf

That will look for all instances of "php_admin_value" in those .conf files, and place a "#" mark in front of them.

Of course, before making any changes like that, be sure to back up all those config files!

-Eric

Fri, 06/14/2019 - 16:31
adamjedgar

Awesome, thanks Eric.

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Topic locked