Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Magento Assignment 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

MAGENTO TRAINING

ASSIGNMENT (SESSION:01)

Name: Salman Khatri


Academy#: Academy 4
Group: TG
Email Address: salmanrahim@digitalocean.com

Site URL:
https://phpstack-745742-4409331.cloudwaysapps.com

Setup a Magento 2.4.x on a PHP Stack application and perform following tasks:

Steps for setting up Magento 2.4.6:

• Create a custom PHP app on the server via this guide.

• SSH into the server via this guide.

• Go to the webroot of the newly created Custom PHP app. Install composer via this guide.

• Fetch the Magento 2.4.6 files in the webroot via this command:

wget https://github.com/magento/magento2/archive/2.4.6-p4.zip

• Unzip the file, copy the files and directories inside the magento2.4.6 folder:

unzip 2.4.6-p4.zip

cd magento2-2.4.6-p4/

cp -r * ../

• Set up the Magento site via this setup:install command:

php bin/magento setup:install --base-url=https://phpstack-745742-


4409331.cloudwaysapps.com --db-host=127.0.0.1 --db-name=usvhfpzjys --db-user=usvhfpzjys
--db-password=mmH58MbnN2 --admin-firstname=Salman --admin-lastname=Khatri --
admin-email=student@classroom.com --admin-user=magentoclassroom --admin-
password=Password123 --language=en_US --currency=USD --timezone=America/Chicago --
use-rewrites=1 –backend-frontname="SalmanKh3"

For the explanation of this command, refer to this link.

• Reset file/folder permissions to the app user using this guide.


1- Make sure the webroot is served via /pub.

The webroot has been changed to /pub via following this guide.

Screenshot for reference: https://i.imgur.com/5pTYnSA.png

2- Create new user with user 'magentoclassroom', email 'student@classroom.com' and


password 'Password123'.

The user was already created as required in the setup:install command above in the Magento
installation process.

3- Disable cache type 'Full_page' and enable the rest of cache types.

Disabled full page cache via the command:

php bin/magento cache:disable full_page

Screenshot for reference: https://i.imgur.com/8H4dQgb.png

4- Put the store in production mode.

Enabled the production mode via the command:

php bin/magento deploy:mode:set production

Screenshot for reference: https://i.imgur.com/CHKvwgA.png

Write following Magento commands:

1) Exclude themes on static content deploy and does not minify HTML files using the CLI

$ php bin/magento setup:static-content:deploy --exclude-theme=Vendor/theme --no-html-minify

By using this command, we can deploy static content excluding specific themes and prevent the
minification of HTML files.
2) Change the indexer mode to run in realtime for catalog_category_product. using the CLI

$ php bin/magento indexer:set-mode realtime catalog_category_product

With this command, we can enable real-time mode for the catalog_category_product indexer,
ensuring that it updates instantly whenever there are changes to category-product associations

3) Allowing specific IP to view the store during maintenance mode using the CLI

$ php bin/magento maintenance:allow-ips <IP_Address_1> <IP_Address_2> …

Using this command, we can configure Magento to allow access to the store for specific IP
addresses even when maintenance mode is enabled.

You might also like