Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudarshann/4d150b2bbc3d2a3adfcf53ee0f56a3af to your computer and use it in GitHub Desktop.
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
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