Skip to content

mamei-tech/kuberaxpress_magento

kuberaxpress_magento

Magento code setup

manual setup

Create your project directory then go into it:

mkdir -p ~/Sites
cd $_

Download the Docker Compose configs:

git clone https://github.com/mamei-tech/kuberaxpress_config.git kuberaxpress-prod

Note: if dev environment run: git clone --branch dev https://github.com/mamei-tech/kuberaxpress_dockerconfigs.git kuberaxpress-dev

cd $_
docker compose -f compose.yaml up phpfpm -d

Note: if dev environment run: docker compose -f compose.dev.yaml -f compose.yaml up phpfpm -d

git clone https://github.com/mamei-tech/kuberaxpress_magento.git src

Note: if dev environment run: git clone --branch dev https://github.com/mamei-tech/kuberaxpress_magento.git src

Magento core development:

Start some containers, copy files to them and then restart the containers:

bin/start --no-dev

Note: if dev environment run: bin/start

Initial copy will take a few minutes...

bin/copytocontainer --all

If your vendor directory was empty, populate it with:

bin/composer install
bin/setup-composer-auth

restore database

unzip ./backup/kubera.main.sql.zip

You can use the bin/mysql script to import a database:

bin/mysql < ./backup/kubera.main.sql

Note: Update database connection details to use the above Docker MySQL credentials: Also note: creds for the MySQL server are defined at startup from env/db.env vi src/app/etc/env.php

Import app-specific environment settings:

bin/magento app:config:import

Note: if you want to use a custom branch, run the following command:

bin/cli git checkout 2.4-develop

Run the setup installer for Magento:

Note: If you do not have at least 6GB RAM configured for docker, you must manually run the bin/setup script steps.

If you have at least 6 GB of RAM configured for Docker, run:

bin/setup kuberaxpress.com

Note: if dev environment run: bin/setup dev.kuberaxpress.com

open https://you_domain_name

To set up multiple websites with Nginx

uncomment line three in ./images/Dockerfile

If modify images/nginx/conf/default.conf

git pull
docker-compose build
bin/restart

Other commands

Generate a new certificate valid for the following names (ex: kuberaxpress.com dev.kuberaxpress.com)

bin/setup-ssl kuberaxpress.com dev.kuberaxpress.com

Disable the Cache

bin/magento cache:disable

Flush the Cache

bin/magento cache:flush

Clean the Cache

Run the following command to clean the config and full_page caches:

bin/magento cache:clean config full_page

Re-index, Clean, Flush

bin/magento indexer:reindex && bin/magento cache:clean && bin/magento cache:flush

Take a backup of your existing database:

bin/mysqldump > ./backup/backup_filename.sql

Zip backup

zip -9 -r -q ./backup/backup_filename.sql.zip ./backup/backup_filename.sql

Unzip backup

unzip ./backup/backup_filename.sql.zip

Generate static assets for the Spanish locale (es_ES)

bin/magento setup:static-content:deploy --theme Magento/backend es_ES

Note: if dev environment run: bin/magento setup:static-content:deploy -f --theme Magento/backend es_ES

Docs

Magento 2 Modes --- Default, Developer, and Production ---

To learn more you can visit the following link: Magento 2 Modes.

How to Check which Magento 2 Mode is Used

You need to run the following command:

bin/magento deploy:mode:show

Setting Magento 2 Production Mode

You can enable production mode by running the below command:

bin/magento deploy:mode:set production

Setting Magento 2 Developer Mode

You need to run the command below:

bin/magento deploy:mode:set developer

Steps to access the admin for the first time without having email - 2fa

Install the Magento2-Module-DisableTwofactorah module:

bin/composer require markshust/magento2-module-disabletwofactorauth
bin/magento module:enable MarkShust_DisableTwoFactorAuth
bin/magento setup:upgrade

Disable 2FA in production mode:

bin/magento config:set twofactorauth/general/enable 0

Note: desactivar el de production solo hasta configurar el email sender smtp, luego volver a activar. En developer mode si puedes dejarlo desactivado.

To disable 2FA in developer mode run:

bin/magento config:set twofactorauth/general/disable_in_developer_mode 0

Another via to access the admin for the first time without having email - 2fa

In case anyone needs a temporary workaround to get this working without having SMTP set up:

  1. navigate to /admin and log in
  2. you should see the 2FA screen now
  3. add var_dump($url);die; on line 86 in vendor/magento/module-two-factor-auth/Model/EmailUserNotifier.php
  4. refresh /admin
  5. copy the URL that is displayed
  6. remove the var_dump
  7. use the URL copied earlier to navigate to the 2FA setup

Install and configure Mail module (https://github.com/mageplaza/magento-2-smtp)

bin/composer require mageplaza/module-smtp
bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f

To activate module

Activate the module once within the administration with the following data:

register_name: kubera
register_email: [email protected]

Activate SMTP Auth Office 386

  1. Disable smtp auth in your organization in the EAC

  2. In Magento admin

    • Go to the menu "Stores> Settings - Configuration > General - Store Email Adressess" and modify all sender email by [email protected] and then Save Config

    • Go to the menu "Stores> Settings - Configuration" in the left lateral menu Go to the "Advanced > System" section and configure the "Mail Sending Settings" section similar to the steps above.

    • Go to the menu "Stores> SMTP - Configuration > SMTP Configuration Options" and load the Office386 default configuration in Load Settings button, then changes protocol to TLS and select LOGIN Authentication and add User and password from Email Office386. Then Send test email.

Then you can activate the 2FA for the Developer Mode and try it to see if you get the configuration mail.

Set up multiple websites with Nginx

Get and install your certificates with Certbot

Running the container

To run the Certbot container, execute the below script in your host machine:

script/setup-ssl-certbot

Automate Certificate Renewal

Certificates will only be valid for 90 days so we need to automate the renewal. We setup our Cron job with:

crontab -e

We add the following line:

0 3 * * mon /home/express/Sites/kuberaexpress/script/renew-ssl-certbot

This will execute the renew-ssl-certbot script every Monday at 3am.

Disable a module

bin/magento module:disable a_module_name

List of enabled modules

bin/magento module:status

Remove a module

(Simple removal):

bin/composer remove module_name

Removing with Composer (complex):

bin/magento module:uninstall module_name

Manual static content deployment

bin/magento setup:static-content:deploy -f

To generate classes

bin/magento setup:di:compile

Errors

If you use version 2.4.6-p3 or Magento higher you must install this module to be able to send SMTP emails:

bin/composer require laminas/laminas-zendframework-bridge:1.8.0

more

About

No description, website, or topics provided.

Resources

License

OSL-3.0 and 2 other licenses found

Licenses found

OSL-3.0
LICENSE.txt
Unknown
COPYING.txt
AFL-3.0
LICENSE_AFL.txt

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published