Magento code setup
mkdir -p ~/Sites
cd $_
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
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
bin/composer install
bin/setup-composer-auth
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
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
uncomment line three in ./images/Dockerfile
git pull
docker-compose build
bin/restart
To learn more you can visit the following link: Magento 2 Modes.
You need to run the following command:
bin/magento deploy:mode:show
You can enable production mode by running the below command:
bin/magento deploy:mode:set production
You need to run the command below:
bin/magento deploy:mode:set developer
bin/magento module:status
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
In case anyone needs a temporary workaround to get this working without having SMTP set up:
- navigate to /admin and log in
- you should see the 2FA screen now
- add
var_dump($url);die;
on line 86 invendor/magento/module-two-factor-auth/Model/EmailUserNotifier.php
- refresh /admin
- copy the URL that is displayed
- remove the var_dump
- use the URL copied earlier to navigate to the 2FA setup
bin/composer require mageplaza/module-smtp
bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f
Activate the module once within the administration with the following data:
register_name: kubera
register_email: admin@kuberaxpress.com
-
Disable smtp auth in your organization in the EAC
- To disable SMTP AUTH globally in your organization in the EAC, go to the
Settings > Mail Flow
settings page and toggle the setting labeled Turn off SMTP AUTH protocol for your organization. - Follow the steps of this doc: https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission#disable-smtp-auth-in-your-organization
- To disable SMTP AUTH globally in your organization in the EAC, go to the
-
In Magento admin
-
Go to the menu "Stores> Settings - Configuration > General - Store Email Adressess" and modify all sender email by
admin@kuberaxpress.com
and thenSave 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.
- https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/multi-sites/ms-admin.html?lang=en
- https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/multi-sites/ms-nginx.html?lang=en
To run the Certbot container, execute the below script in your host machine:
./scripts/setup-ssl-certbot kuberaxpress.com
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/scripts/renew-ssl-certbot
This will execute the renew-ssl-certbot script every Monday at 3am.
Generate a new certificate valid for the following names (ex: kuberaxpress.com dev.kuberaxpress.com
)
bin/setup-ssl kuberaxpress.com dev.kuberaxpress.com
bin/magento cache:disable
bin/magento cache:flush
Run the following command to clean the config and full_page caches:
bin/magento cache:clean config full_page
bin/magento indexer:reindex && bin/magento cache:clean && bin/magento cache:flush
bin/mysqldump > ./backup/backup_filename.sql
Use the bin/mysql script to import a database:
bin/mysql < ./backup/kubera.main.sql
zip -9 -r -q ./backup/backup_filename.sql.zip ./backup/backup_filename.sql
unzip ./backup/backup_filename.sql.zip
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
bin/magento module:disable a_module_name
bin/magento module:status
bin/composer remove module_name
bin/magento module:uninstall module_name
bin/magento setup:static-content:deploy -f
bin/magento setup:di:compile
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