Евгений

HTTP/2 без nginx

Я хочу настроить режим HTTP/2, однако я не могу включить PHP-FPM, т.к. он требует подключения nginx, а apache работает только в режиме префорк. Я не хочу использовать nginx. И я точно знаю, что работа apache+php-fpm возможна, т.к. такая конфигурация доступна, например, в cPanel. Хотелось бы, чтобы панель в будущем была доработана и позволяла включить режим HTTP/2 без nginx, только на apache.

21.08.2025 14:59

1
ПользовательДжое

This will (note the FUTURE tense - as of October 2018) be possible with Apache 2.5, using the PolicyVersion directive in mod_policy. The PolicyVersion directive sets the lowest level of the HTTP protocol that is accepted by the server, virtual host, or directory structure - depending on where the directive is placed.

First enable the policy module:

a2enmod mod_policy

14.09.2025 22:28

ПользовательДжое

Наш конфиг такой

Программное обеспечение сервера

Apache

2.4.58-1ubuntu8.8

MySQL

8.0.43-0ubuntu0.24.04.1

Kernel

6.8.0-79-generic

Apache MPM-ITK (без NGINX)

Loaded Modules:                                                                                                                                                               
core_module (static)                                                                                                                                                         
so_module (static)                                                                                                                                                           
watchdog_module (static)                                                                                                                                                     
http_module (static)                                                                                                                                                         
log_config_module (static)                                                                                                                                                   
logio_module (static)                                                                                                                                                        
version_module (static)                                                                                                                                                      
unixd_module (static)                                                                                                                                                        
access_compat_module (shared)                                                                                                                                                
actions_module (shared)                                                                                                                                                      
alias_module (shared)                                                                                                                                                        
auth_basic_module (shared)                                                                                                                                                   
auth_digest_module (shared)                                                                                                                                                  
authn_core_module (shared)                                                                                                                                                   
authn_file_module (shared)                                                                                                                                                   
authnz_external_module (shared)                                                                                                                                              
authz_core_module (shared)                                                                                                                                                   
authz_host_module (shared)                                                                                                                                                   
authz_user_module (shared)                                                                                                                                                   
autoindex_module (shared)                                                                                                                                                    
cgi_module (shared)                                                                                                                                                          
dav_module (shared)                                                                                                                                                          
dav_fs_module (shared)                                                                                                                                                       
deflate_module (shared)                                                                                                                                                      
dir_module (shared)                                                                                                                                                          
env_module (shared)                                                                                                                                                          
filter_module (shared)                                                                                                                                                       
headers_module (shared)                                                                                                                                                      
http2_module (shared)                                                                                                                                                        
include_module (shared)                                                                                                                                                      
mime_module (shared)                                                                                                                                                         
mpm_itk_module (shared)                                                                                                                                                      
mpm_prefork_module (shared)                                                                                                                                                  
negotiation_module (shared)                                                                                                                                                  
php_module (shared)                                                                                                                                                          
proxy_module (shared)                                                                                                                                                        
proxy_fcgi_module (shared)                                                                                                                                                   
remoteip_module (shared)                                                                                                                                                     
reqtimeout_module (shared)                                                                                                                                                   
rewrite_module (shared)                                                                                                                                                      
setenvif_module (shared)                                                                                                                                                     
socache_shmcb_module (shared)                                                                                                                                                
ssl_module (shared)                                                                                                                                                          
status_module (shared)                                                                                                                                                       
suexec_module (shared)                                                                                                                                                       
vhost_alias_module (shared) 

Конфиг изменяем через шаблоны, чтобы после обновления или перезапуска сохранились изменения

<VirtualHost 192.168.0.55:443>
    ServerName *********
    Protocols h2 http/1.1

HTTP2  работает только на статическом контенте (изображения, стили, скрипты)

15.09.2025 09:03

1 2