Skip to content

Magento

Create a new GCP instance. Normally open HTTPS and give it a static internal and external IP.

Terminal window
sudo apt update
sudo apt upgrade
sudo apt -y install nginx wget
Terminal window
sudo apt -y install lsb-release apt-transport-https ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
sudo apt -y install php7.4-fpm php7.4-cli
sudo apt -y install php7.4-{bcmath,ctype,bz2,curl,dom,fileinfo,intl,gd,iconv,json,mbstring,mysql,simplexml,soap,sockets,tokenizer,xmlwriter,xsl,zip}
Terminal window
sudo nano /etc/php/7.4/fpm/php.ini
sudo nano /etc/php/7.4/cli/php.ini
date.timezone = Europe/London
realpath_cache_size = 10M
realpath_cache_ttl = 7200
opcache.enable = 1
opcache.save_comments = 1
memory_limit = 2G
max_execution_time = 1800
zlib.output_compression = On
Terminal window
sudo systemctl restart php7.4-fpm
Terminal window
sudo apt install mariadb-server
sudo mysql_secure_installation

Log into mariadb and create the magento database and user

Section titled “Log into mariadb and create the magento database and user”
Terminal window
sudo mysql -u root -p
create database magento;
create user 'magento'@'localhost' IDENTIFIED BY 'magento';
GRANT ALL ON magento.* TO 'magento'@'localhost';
flush privileges;

Find the file location

Terminal window
mysql --help | grep /my.cnf | xargs ls

https://docs.day.marketing/books/webservers/page/mariadb-mycnf