Setting up VLSM on a Windows Machine
0. Download
- Notepad++ or MicroSoft VS Code
- WampServer from https://www.wampserver.com/en/. Check if Windows is 32 bit or 64 bit. Download WampServer 32 or 64 bit version based on the windows machine
- VC Packages
1. Installing WAMP Server
- Ensure Windows system is updated. This is important to ensure there is no issue on WampServer later on.
- Install VC Packages that we downloaded already - for 64 bit you need to install all, for 32 bit only install 32 bit ones
- Reboot machine after installing
- Now run WampServer and ensure it is showing green icon
2. Configuring PHP and MySQL
2.1 PHP Setup
-
Download cacert.pem from https://curl.se/docs/caextract.html. Place it in
C:\wamp\orC:\wamp64\path. This is needed to allow the application to communicate with VLSTS -
Change PHP version to 8.2.13. To do this, click on WampServer -> PHP -> version -> 8.2.13
-
Next we will change PHP settings to make them more optimum for VLSM. To do this, click on WampServer -> PHP -> php.ini
- When the file opens search for
memory_limit. Change 128mb to 2G (or more if there is more RAM available on the computer) - Now search for
post_max_size. Change 8M to 500M - Now search for
upload_max_filesize. Change 2M to 500M - Find
;openssl.cafile=and change it toopenssl.cafile='C:\wamp\cacert.pem'oropenssl.cafile='C:\wamp64\cacert.pem' - Find
;curl.cainfo =and change it tocurl.cainfo ='C:\wamp\cacert.pem'orcurl.cainfo ='C:\wamp64\cacert.pem' - Now search for
error_reporting. Change it toerror_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING - Now search for
max_execution_time. Change it tomax_execution_time = 1200
- When the file opens search for
- Open the php.ini file inside the C:\wamp64\bin\php\php8.2.13\php.ini and do these same edits there as well
2.2 MYSQL Setup
-
Fixing the MySQL mode
-
Click on WampServer icon -> MySQL -> my.ini
-
When the file opens, search for
sql_modeif it is already set comment out that line by adding a semi-colon;in the beginning of the line and add the following lines after that:sql_mode = innodb_strict_mode = 0 -
Search for
innodb_default_row_format=compactand change it toinnodb_default_row_format=dynamic -
If it is not there then just add
innodb_default_row_format=dynamic -
Close the text file
-
-
Next we will change MySQL password.
-
WampServer icon -> MySQL -> MySQL Console
-
Username is
root -
Password is blank (just press enter when it asks for password)
-
Now type this:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PASSWORD'; FLUSH PRIVILEGES; exit; -
Press enter after pasting these lines in the terminal
-
-
Click on Wampserver icon and Restart all services
-
Download latest version of composer from https://getcomposer.org/download/
3. Setting up VLSM
3.1 VLSM Application Setup
- Download VLSM from https://github.com/deforay/vlsm
- Unzip and put it in
C:\wamp\www\vlsmorC:\wamp64\www\vlsmpath - Put the composer.phar also inside the vlsm folder
- To complete VLSM installation, open the terminal and run the composer
cd C:\wamp64\www\vlsm
C:\wamp64\bin\php\php8.2.13\php.exe composer.phar updateinstall --no-dev
C:\wamp64\bin\php\php8.2.13\php.exe composer.phar dump-autoload -o
- The latest VLSM database is inside the vlsm/sql/init.sql file.
- Start phpmyadmin by typing http://localhost/phpmyadmin in browser (login id is
rootand password ismko)(*&^) - Click on
SQLmenu on top and type the following lineCREATE DATABASE `vlsm` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; - This will create a blank vlsm database. Now click on vlsm on left and import the sql file downloaded earlier
- Rename the file configs/config.production.dist.php to configs/config.production.php
- Enter Database User, Password, DB Name etc.
// VLSTS URL
$systemConfig['remoteURL'] = 'https://STSURL';
// Enable/Disable Modules
// true => Enabled
// false => Disabled
$systemConfig['modules']['vl'] = false;
$systemConfig['modules']['eid'] = true;
$systemConfig['modules']['covid19'] = false;
$systemConfig['modules']['hepatitis'] = false;
$systemConfig['modules']['tb'] = false;
// Database Settings
$systemConfig['database']['host'] = 'localhost';
$systemConfig['database']['username'] = 'root';
$systemConfig['database']['password'] = 'PASSWORD';
$systemConfig['database']['db'] = 'vlsm';
$systemConfig['database']['port'] = 3306;
$systemConfig['database']['charset'] = 'utf8mb4';
.
.
.
.
.
// Enable/Disable Interfacing
// true => Enabled
// false => Disabled
$systemConfig['interfacing']['enabled'] = true;
// Interfacing Database Details (not needed if above feature set to false)
$systemConfig['interfacing']['database']['host'] = 'localhost';
$systemConfig['interfacing']['database']['username'] = 'root';
$systemConfig['interfacing']['database']['password'] = 'PASSWORD';
$systemConfig['interfacing']['database']['db'] = 'interfacing';
$systemConfig['interfacing']['database']['port'] = 3306;
$systemConfig['interfacing']['database']['charset'] = 'utf8mb4';
-
Next step is creating a virtual host pointing to the vlsm application
-
Start notepad or notepad++ as admin user (go to start menu, search for notepad and right click and click on Run as administrator)
-
open this file
C:\windows\system32\drivers\etc\hosts -
Add this line at the bottom
127.0.0.1 vlsmand save & close the file -
Next open
C:\wamp\bin\apache\apache2.4.54.2\conf\extra\httpd-vhosts.conf -
change the existing vhost to the following:
<VirtualHost *:80> ServerName localhost ServerAlias vlsm DocumentRoot "${INSTALL_DIR}/www/vlsm/public" <Directory "${INSTALL_DIR}/www/vlsm/public/"> AddDefaultCharset UTF-8 Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost> -
Save & Close this file
-
Click on WampServer icon and Restart all services
-
-
Now go the command prompt and type these commands:
C:\wamp64\bin\php\php8.2.13\php.execd C:\wamp64\www\vlsm\app\system\migrate.php -yqvlsm C:\wamp64\bin\php\php8.2.13\php.exeC:\wamp64\www\vlsm\app\scheduled-jobs\remote\commonDataSync.phpcomposer.pharC:\wamp64\bin\php\php8.2.13\php.exe C:\wamp64\www\vlsm\app\run-once\update-privileges.phppost-install -
Now open http://vlsm
- Register a new Admin user and Login
- Fill the instance details in the popup. Select BOTH for type of Instance
- Now scroll to the bottom and click on
Force Remote Sync. Please wait for the sync to finish.
-
Once sync is finished go to http://vlsm/system-admin
- Secret Key can be found in
C:\wamp64\www\vlsm\app\system-admin\secretKey.txt - Register new System Admin and Login
- Select Instance Type as 'Lab Instance' and then select the Lab name from dropdown and click on Submit. (Ignore SMTP settings)
- You can sign out
- Secret Key can be found in
-
Users can now start using vlsm from http://vlsm URL
3.2 Task Scheduler
- Run Task Scheduler. Click on "Create Task"
- Name : VLSM TASK
- Select "Run whether user is logged on or not"
- Now Go to the ‘Triggers’ tab which is next to the ‘General’ tab. And Click on the ‘New’ button.
- Select 'Daily'
- Check "Repeat Task Every" and make it as "1 minutes" and choose for a duration of "Indefnitely"
- Check the checkbox ‘Stop the task if it runs longer than’. It is optional. If the script goes in an indefinite loop or a similar situation due to any reason, the task will be terminated automatically after the day/time defined in this option. By default the value is ‘3 days’. Leave the default value.
- Click OK
- Click on the ‘Actions’ tab and click on the ‘New’ button inside it.
- in the Program/Script find the php exe file for eg.
C:\wamp\bin\php\php8.2.13\php.exeorC:\wamp64\bin\php\php8.2.13\php.exe - in Add Arguments type
C:\wamp\www\vlsm\vendor\bin\crunz schedule:runorC:\wamp64\www\vlsm\vendor\bin\crunz schedule:run - Click on OK
- When prompted for password, please enter the Windows user password (might be cphd123, but check with lab first)
4. Setting up Interfacing
- Start phpmyadmin by typing http://localhost/phpmyadmin in browser (login id is
rootand password ismko)(*&^)