- Instructions for installing locally the Smart Boarding app
- Update DB
- Export WSL install under Windows 10
- Import WSL install under Windows 10
-
clone phs and onboarding into <your-local-path>
git clone https://github.com/tipul07/phs ./phs
git clone https://[git token]@github.com/Smart2Pay/Onboarding ./onboarding
- install Ubuntu from Microsoft Store
-
create your user + switch to sudo mode
sudo su
-
install php 7.4 and addons
apt-get install -y php7.4 php7.4-fpm php7.4-cli php7.4-json php7.4-soap php7.4-xml php7.4-bcmath php7.4-xmlrpc php7.4-bz2 php7.4-curl php7.4-mbstring php7.4-xsl php7.4-gd php7.4-intl php7.4-mysql php7.4-zip php7.4-ssh2
-
update the default limits inside '/etc/php/7.4/apache2/php.ini'
upload_max_filesize=64M
post_max_size=64M
-
update all, install some utils (if needed) and apache
apt update
apt-get update && apt-get install -y curl imagemagick apt-utils software-properties-common openssl cron mc git zip telnet
apt install apache2
check if http://localhost/ is accessible and apache installed correctly -
navigate to '/var' and remove 'www' folder
cd /var/
rm -rf www
-
create the symlink for your local project to 'www' folder
ln -sfn /mnt/<your-local-path> /var/www
-
disable the default site
a2dissite 000-default
-
create
www.conf
file inside <your-local-path> with this content and copy it to apache's sites folder from Ubuntu's console
cp -i /mnt/<your-local-path>/www.conf /etc/apache2/sites-available/
-
enable the added site
a2ensite www
-
install and start mysql
apt-get install mysql-server mysql-client libmysqlclient-dev
service mysql start
-
open mysql's console and create the DB
mysql
create database <your-DB-name>;
* exit mysql console withCTRL
+D
-
obtain a SmartBoarding DB sql file, rename it to
<your-DB-name>.sql
and copy it to <your-local-path>
then, from Ubuntu's console, copy the DB to mysql install folder
cp -i /mnt/<your-local-path>/<your-DB-name>.sql /var/lib/mysql/<your-DB-name>/
-
open mysql's console and import the DB
mysql
USE <your-DB-name>;
SOURCE <your-DB-name>.sql;
-
still inside mysql console, create your DB user
CREATE USER '<your-username>' @'%' IDENTIFIED BY '<your-password>';
GRANT ALL PRIVILEGES ON * . * TO '<your-username>'@'%';
-
copy this script to <your-local-path> and run it inside Ubuntu
./create_symlinks
-
create the
htaccess
file inside '<your-local-path>/phs' with this content -
update the following variables inside
'<your-local-path>/phs/main.php'
:
PHS_DB_USERNAME
,PHS_DB_PASSWORD
,
PHS_DEFAULT_CRYPT_KEY
(according to DB env),
PHS_DEFAULT_CRYPT_INTERNAL_KEYS_ARR
(according to DB env) -
retart both apache and mysql from Ubuntu's console
service apache2 restart
service mysql restart
- access http://localhost/phs
from Ubuntu console run
php /var/www/phs/bin/phs update
-
Get a full list of the distribution names
wsl -l -v
-
Use the cd command to navigate into the directory you want to save your export to
wsl --export <distribution-name> <filename>.tar
e.g.: wsl --export Ubuntu-20.04 ubuntubackup.tar
-
wsl --import <distribution-name> <install-location> <backup-location>\<backup-filename>.tar
e.g.: wsl --import Ubuntu-20.04 C:\Users\MyPC\AppData\Local\Packages\Ubuntu C:\Users\MyPC\Documents\ubuntubackup.tar -
To check it was imported correctly, run the
wsl --list
and you should see your newly imported distribution