Difference between revisions of "Enable HTTP2 Support in Apache"

From Sympl Wiki
Jump to navigation Jump to search
(added the steps, still needs padding)
(Tag: 2017 source edit)
(Tag: 2017 source edit)
Line 6: Line 6:
  
 
== notes only, needs editing ==
 
== notes only, needs editing ==
apt-get install -y php7.3-fpm  
+
  apt-get install -y php7.3-fpm  
  
a2dismod php7.3 mpm_prefork
+
  a2dismod php7.3 mpm_prefork
a2enmod alias mpm_event proxy proxy_fcgi setenvif http2
+
  a2enmod alias mpm_event proxy proxy_fcgi setenvif http2
2enconf php7.3-fpm
+
  2enconf php7.3-fpm
  
 
to edit the sympl template files
 
to edit the sympl template files
sed -E -i 's/php_admin_value (.*)/SetEnv php_admin_value \"\1\"/' /etc/sympl/apache.d/*.erb
+
  sed -E -i 's/php_admin_value (.*)/SetEnv php_admin_value \"\1\"/' /etc/sympl/apache.d/*.erb
  
sed -E -i 's/php_admin_flag (.*)/SetEnv php_admin_flag \"\1\"/' /etc/sympl/apache.d/*.erb
+
  sed -E -i 's/php_admin_flag (.*)/SetEnv php_admin_flag \"\1\"/' /etc/sympl/apache.d/*.erb
  
  if you have hand edited the configuration files and dont want to run sympl-web-configure --force
+
if you have hand edited the configuration files and dont want to run sympl-web-configure --force
sed -E -i 's/php_admin_value (.*)/SetEnv php_admin_value \"\1\"/' /etc/apache2/*-available/*.conf
 
  
sed -E -i 's/php_admin_flag (.*)/SetEnv php_admin_flag \"\1\"/' /etc/apache2/*-available/*.conf
+
  sed -E -i 's/php_admin_value (.*)/SetEnv php_admin_value \"\1\"/' /etc/apache2/*-available/*.conf
  
apachectl -t
+
  sed -E -i 's/php_admin_flag (.*)/SetEnv php_admin_flag \"\1\"/' /etc/apache2/*-available/*.conf
  
sympl-web-configure --verbose
+
  apachectl -t
 +
 
 +
  sympl-web-configure --verbose
  
 
[[Category:How To]]
 
[[Category:How To]]

Revision as of 21:50, 10 April 2020

We managed to get http2 running one time for some developers who were working on PUSH in the Apache Web Server. I didn't document what we did at the time but have rerun the process since on a fresh Sympl server to test for this documentation. There are a few things that need to be mentioned before we start as there are some substantial changes to the system that need to be made for this to work.

MPM_event to replace MPM_prefork

The prefork MPM has substantial limitations when working with http2 namely in that each connection can only handle one request at a time. More details can be found [1]. Because of this we are going to switch the apache server to using the event MPM. The event MPM is not able to preload the PHP module so we will also need to install php-fpm to parse php on the server.

notes only, needs editing

 apt-get install -y php7.3-fpm 
 a2dismod php7.3 mpm_prefork
 a2enmod alias mpm_event proxy proxy_fcgi setenvif http2
 2enconf php7.3-fpm

to edit the sympl template files

 sed -E -i 's/php_admin_value (.*)/SetEnv php_admin_value \"\1\"/' /etc/sympl/apache.d/*.erb
 sed -E -i 's/php_admin_flag (.*)/SetEnv php_admin_flag \"\1\"/' /etc/sympl/apache.d/*.erb

if you have hand edited the configuration files and dont want to run sympl-web-configure --force

 sed -E -i 's/php_admin_value (.*)/SetEnv php_admin_value \"\1\"/' /etc/apache2/*-available/*.conf
 sed -E -i 's/php_admin_flag (.*)/SetEnv php_admin_flag \"\1\"/' /etc/apache2/*-available/*.conf
 apachectl -t
 sympl-web-configure --verbose