Skip to content

Instantly share code, notes, and snippets.

@igoralves1
Last active July 9, 2018 14:42
Show Gist options
  • Save igoralves1/c3f6a1cb533d9ba30ffe83de48a0c78b to your computer and use it in GitHub Desktop.
Save igoralves1/c3f6a1cb533d9ba30ffe83de48a0c78b to your computer and use it in GitHub Desktop.
Magento 2 + NGINX + MariaDB + PHP7
https://www.howtoforge.com/tutorial/how-to-install-magento-with-nginx-on-ubuntu/
http://devdocs.magento.com/guides/v2.1/install-gde/install/sample-data-before-composer.html
http://askubuntu.com/questions/762855/how-to-install-brackets-io-from-the-command-line
http://devdocs.magento.com/guides/v2.1/install-gde/install/sample-data-before-composer.html
http://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-mode.html
https://github.com/magento/magento2/issues/2561
http://devdocs.magento.com/guides/v2.0/install-gde/install-flow-diagram.html
http://askubuntu.com/questions/762855/how-to-install-brackets-io-from-the-command-line
http://inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2/
http://www.divisionlab.com/solvingmagento/magento-bundle-product-type-part-1/
sudo apt-get update
sudo apt-get install -y figlet
sleep 5s
clear
figlet Only_64bits
figlet GOOGLE_CHROME
sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install -y google-chrome-stable
sleep 5s
clear
2-Install NGINX
apt-get install nginx -y
3-Install PHP7
apt-get install php7.0-fpm php7.0-mcrypt php7.0-curl php7.0-cli php7.0-mysql php7.0-gd php7.0-xsl php7.0-json php7.0-intl php-pear php7.0-dev php7.0-common php7.0-mbstring php7.0-zip php-soap libcurl3 curl -y
Note:
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.
//https://php-fpm.org/
4-Edit the php.ini files for fpm and cli.
/etc/php/7.0/fpm/php.ini
/etc/php/7.0/cli/php.ini
Increase the memory limit and php execution time and turn on zlib compression by adding the
following lines at the end of the files:
memory_limit = 512M
max_execution_time = 1800
zlib.output_compression = On
5-Restart the PHP-FPM
service php7.0-fpm restart
6-Install and Configure MariaDB
apt-get install mariadb-server mariadb-client -y
7-Set the MariaDB root user password
mysqladmin -u root password mypassword
mysql_secure_installation
Set root password? [Y/n] Y
New password:
Re-enter new password: <-- Enter the new password
Remove anonymous users? [Y/n] Y
... Success!
Disallow root login remotely? [Y/n] Y
... Success!
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
... Success!
Then connect to the MySQL shell (the MariaDB shell gets started with the
command mysql) with your root password, create a database with the name
'magentodb' and a user 'magentouser' with the password 'magentouser@'.
Please choose a secure password for the 'magentouser' on your server and
not the one 'magentouser@' that I used in this example!
Login to the MySQL shell:
mysql -u root -p
create database magentodb;
create user magentouser@localhost identified by 'magentouser@';
grant all privileges on magentodb.* to magentouser@localhost identified by 'magentouser@';
flush privileges;
\q
================== Database created and configured.=====================
8 - Install and Configure Magento 2
#Magento will be installed in the directory '/var/www/magento2'.
#In order to install Magento we will use PHP composer.
#Note, to avoid error, the key must be constantly updated from the oficial web site https://getcomposer.org/download/
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
composer -v
sleep 5s
clear
#Go to the web directory '/var/www/' and download Magento from it's Github repository, then unpack the downloaded tar.gz file:
cd /var/www/
wget https://github.com/magento/magento2/archive/2.0.7.tar.gz
tar -xzvf 2.0.7.tar.gz
mv magento2-2.0.7/ magento2/
sleep 5s
clear
Configure the Magento Key
Register an account on the Magento website repo.magento.com.
This account is required to use Magento and the Magento composer store.
When you have registered, go to the Tab 'My Account > Developer > Secure Keys', next generate your keys.
Go to the Magento 2 installation directory '/var/www/magento2' and run the composer command:
cd /var/www/magento2/
composer install -v
Configure the Nginx Virtualhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment