Created
September 20, 2021 11:24
-
-
Save sudarshann/4d150b2bbc3d2a3adfcf53ee0f56a3af to your computer and use it in GitHub Desktop.
Prepare Ubuntu 20.04 for Apache and PHP 7.4 FPM for magento 2.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update && sudo apt upgrade | |
sudo apt install software-properties-common && sudo add-apt-repository ppa:ondrej/php && sudo apt update | |
# https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html | |
sudo apt install php7.4-fpm php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-soap php7.4-zip php7.4-bcmath php7.4-xsl php7.4-mysql php7.4-mbstring php7.4-intl -y | |
sudo apt install libsodium-dev | |
sudo pecl install -f libsodium | |
sudo apt install apache2 | |
sudo a2dissite 000-default | |
sudo a2enmod proxy_fcgi | |
sudo nano /etc/apache2/sites-available/<domain name>.conf | |
<VirtualHost *:80> | |
ServerName !!! Domain name !!! | |
DocumentRoot /var/www/!!!site name !!! | |
<Directory /var/www/!!!site name !!!> | |
Options FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
<FilesMatch ".php$"> | |
SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost/" | |
</FilesMatch> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
# Hit CTRL + X followed by Y and Enter to save and exit the file. | |
sudo a2ensite <domain name>.conf | |
systemctl reload apache2 | |
# PHP INI: /etc/php/7.4/fpm/php.ini | |
# Pool config: /etc/php/7.4/fpm/pool.d/www.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment