Install WSL - Updated Infosys
Install WSL - Updated Infosys
Install WSL - Updated Infosys
Install WSL:
Please install the wsl.exe file at your window system.
Path: wsl_update_x64(1).msi
Open the powershell with administrator mode
Run wsl –install
Run: wsl --install -d Ubuntu-22.04
This command install the ubuntu 22.04
Check the wsl status and version: wsl -l -v
Others command for WSL:
wsl –list
wsl –status
wsl –update
wsl –version
wsl --list –online
wsl --setdefault Ubuntu-22.04
wsl --set-default-version 2
wsl --install -d Ubuntu-22.04 2
wsl --list –verbose
wsl --set-version Ubuntu-22.04 2
wsl --shutdown
Run the wsl: type “wsl” at the powershell to enable the wsl (enter the linux system)
2. Install Apache:
sudo apt update
if above command didn’t work use =-> echo "nameserver 8.8.8.8" | sudo tee
/etc/resolv.conf > /dev/null
sudo apt install apache2
Once installed, you can check the installed Apache version with the following
command:
sudo apache2ctl -v
To enable auto startup for apache, use this command: systemctl is-enabled
apache2
Update default port 80 to any other:
sudo cp /etc/apache2/ports.conf /etc/apache2/ports.conf.bak
sudo nano /etc/apache2/ports.conf
change the port 80 to 8081
Apatche conf accept filter changes:
sudo nano /etc/apache2/apache2.conf
Add below lines at end of the file.
AcceptFilter http none
AcceptFilter https none
Be sure apache is running :
sudo service apache2 restart
3. Check if you are able to open localhost on browser: http://127.0.0.1/ then follow 5th step.
4. In command line: ifconfig & copy the underline IP & hit it with port you mentioned above.
Check now If now server is working. If yes just replace this IP 127.0.0.1 with copied one in all below
steps
5. Install Mysql:
sudo apt install mysql-server
After installation you can check the mysql version using below command:
mysql -V
Login with root user :
sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;
Note: Replace ‘your_secure_password‘ with your password:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY
'your_secure_password';
exit
Create new MySQL user for Magento 2:
mysql -u root -p
SELECT user,authentication_string,plugin,host FROM mysql.user;
Note: Replace ‘your_secure_password‘ with your password.
CREATE USER 'magento2'@'localhost' IDENTIFIED BY 'your_secure_password';
ALTER USER 'magento2'@'localhost' IDENTIFIED WITH mysql_native_password BY
'your_secure_password';
GRANT ALL PRIVILEGES ON *.* TO 'magento2'@'localhost' WITH GRANT OPTION;
exit
Create Database :
mysql -u magento2 -p
CREATE DATABASE magento2;
Exit
Mysql Commands:
sudo service mysql start
sudo service mysql stop
sudo service mysql status
sudo service mysql restart
8. Install Composer:
cd ~
Downloading and installing composer.:
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/bin --filename=composer
Let’s check the composer version:
composer
9. Install Magento:
Add your ssh key to the git repo:
ssh-keygen
Copy the public key and follow the below steps:
Go to the ado git repository => user settings => SSH public key
Add your public key here
After Adding the key. Take the git clone:
cd /var/www/
sudo chmod -R 777 html/
cd /var/www/html/
git clone [email protected]:v3/tfs-glo-lexisadvance/BPS/
3094-global-ecommerce
CD 3094-global-ecommerce
COMPOSER_PROCESS_TIMEOUT=-1 composer install
if your project root directory is not pub : Add index.php at root of the project
Import DB:
DB file path: integration.sql (for infosys only)
mysql -u user_name -p dbname < dbpath.sql
Change the base url , static url , media path as well as elastic search host with the
core_config_data table.
Add the config.php and env.php file under the app/etc directory of the magento.
File path: App
Change the DB settings with the App/etc/env.php
Run the below Magento commands:
php bin/magento s:up && php bin/magento se:di:co && php bin/magento se:s:d -f --
theme Magento/spectrum --theme Smartwave/porto_child_hk --theme
Smartwave/porto_child_sg --theme Smalllaw/theme en_US && php bin/magento
cache:clean && php bin/magento cache:flush
Run indexing:
php bin/magento indexer:reset && php bin/magento indexer:reindex
sudo chmod -R 777 var/ generated/ pub/ app/etc/
upload the en-hk ,en-hk, buyonline direct at the root of your project. Change the
htaccess url
upload the media and porto file pub/media direcotry
Media file path: pub
YT1EkSXyWhzxWLnV
10. Now hit the project url at browser.
EX: http://127.0.0.1:8081/3094-global-ecommerce
update your port here as well as the project directory name.