sudo systemctl stop apache2
먼저 실행중인 apache2를 정지시킨다.
//php 비활성화
sudo a2dismod php8.2
//mpm_prefork 비활성화 및 mpm_event 활성화
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
php를 비활성화하고, mpm_prefork를 끄고 mpm_event를 활성화시킨다.
sudo apt install php-fpm
sudo apt install libapache2-mod-fcgid
# php 버전 변경
sudo a2enconf php8.2-fpm
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
php-fpm은 php를 FastCGI방식으로 동작하게 해 주며, 이것이 apache와 통신하기 위해 libapache2-mod-fcgid 를 사용한다. sudo apachectl configtest sudo systemctl restart apache2
pi@pi5:~ $ sudo systemctl stop apache2
pi@pi5:~ $ sudo a2dismod php8.2
Module php8.2 disabled.
To activate the new configuration, you need to run:
systemctl restart apache2
pi@pi5:~ $ sudo a2dismod mpm_prefork
Module mpm_prefork disabled.
To activate the new configuration, you need to run:
systemctl restart apache2
pi@pi5:~ $ sudo a2enmod mpm_event
Considering conflict mpm_worker for mpm_event:
Considering conflict mpm_prefork for mpm_event:
Enabling module mpm_event.
To activate the new configuration, you need to run:
systemctl restart apache2
sudo apt install php-fpm
sudo apt install libapache2-mod-fcgid
# php 버전 변경
sudo a2enconf php8.2-fpm
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
pi@pi5:~ $ sudo a2enconf php8.2-fpm
Enabling conf php8.2-fpm.
To activate the new configuration, you need to run:
systemctl reload apache2
pi@pi5:~ $ sudo a2enmod proxy
Module proxy already enabled
pi@pi5:~ $ sudo a2enmod proxy_fcgi
Considering dependency proxy for proxy_fcgi:
Module proxy already enabled
Module proxy_fcgi already enabled
pi@pi5:~ $ sudo apachectl configtest
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message
Syntax OK
pi@pi5:~ $ sudo systemctl restart apache2
pi@pi5:~ $ curl -I –http2 https://domain
HTTP/2 200
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
x-ua-compatible: IE=edge
link: ; rel=”https://api.w.org/”
set-cookie: PHPSESSID=gdmup8i25hhe3gp8u0mb55thrt; path=/
referrer-policy: no-referrer-when-downgrade
content-type: text/html; charset=UTF-8
date: Thu, 27 Feb 2025 23:50:21 GMT
server: Apache/2.4.62 (Debian)
https://satisfactoryplace.tistory.com/375