Como instalar o magento2

 

Get the metapackage

To get the Adobe Commerce or Magento Open Source metapackage:

  1. Log in to your application server as, or switch to, the file system owner.

  2. Change to the web server docroot directory or a directory that you have configured as a virtual host docroot.

  3. Create a Composer project using the Adobe Commerce or Magento Open Source metapackage.

    Magento Open Source


    composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <install-directory-name>

    Adobe Commerce

    composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition <install-directory-name>

  4.  

    rompted, enter your authentication keys. Public and private keys are created and configured in your Commerce Marketplace.

https://commercemarketplace.adobe.com/customer/account/

Step 4: Set Permission to Install Magento 2.4

To install Magento 2, you now need to set proper permissions for your Magento 2 Store. Magento has a set of recommended permissions that we have to apply.

a ) The owner must have full access to files.

b ) Web Server must have write permission on var, app/etc and pub directory.

c ) Execute permission of bin/magento.

Certain commands for permissions are required to be executed at this stage:

Command:

  1. find . -type f -exec chmod 644 {} \;
  2. find . -type d -exec chmod 755 {} \;
  3. chmod -Rf 777 var
  4. chmod -Rf 777 pub/static
  5. chmod -Rf 777 pub/media
  6. chmod 777 ./app/etc
  7. chmod 644 ./app/etc/*.xml
  8. chmod -Rf 775 bin

Step 5: Create a Database for Magento installation

Create an empty database with MySQL/MariaDB

Command:

  1. echo "CREATE DATABASE magento2" | mysql -u[mysqluser] -p

 

Step 6: Install Magento 2.4

Now, the install Magento command needs to be executed

Command:

  1. php bin/magento setup:install --base-url="http://phpstack-739336-2511019.cloudwaysapps.com/"
  2. --db-host="167.99.205.158"
  3. --db-name="magento2"
  4. --db-user="yrzhqayjyq"
  5. --db-password="VA2r8RdxAe"
  6. --admin-firstname="Admin"
  7. --admin-lastname="Admin"
  8. --admin-email="abdul.rehman@cloudways.com"
  9. --admin-user="admin"
  10. --admin-password="Testing123%567"
  11. --use-rewrites="1"
  12. --backend-frontname="admin"
  13. --db-prefix=mage_

 

 

 

Configuração do apache

<VirtualHost *:443>
Define VAR_SSLCertificateFile /etc/letsencrypt/archive/diogogl.com/fullchain.pem
Define VAR_SSLCertificateKeyFile /etc/letsencrypt/archive/diogogl.com/privkey.pem

ServerName xsign.diogogl.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/xsign.diogogl.com

<Directory /var/www/xsign.diogogl.com>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

 

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.

# RewriteCond %{SERVER_NAME} =gilbertomag.diogogl.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

SSLCertificateFile ${VAR_SSLCertificateFile}
SSLCertificateKeyFile ${VAR_SSLCertificateKeyFile}
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Back to top