Installing Redis on Windows Server

Windows

Windows

Install Redis & Configure it with NSSM

1. Install PHP 7.3

Click here to download PHP 7.3 NTS x64 zip file.

  • Unzip the php-redis zip file, a folder will be created, go inside the folder, copy the php_redis.dll file and paste it in C:\Program Files\php7.3\ext. (C:\php\ext incase of Apache WebServer).
  • Now enable php redis extension in php.ini configuration located in C:\Program Files\php7.3. (C:\php incase of Apache WebServer).
extension=php_redis.dll
  • Now go to Server Manager, open IIS Server and restart it. (or restart Apache incase of Apache WebServer)

2. Install Redis

Click here to download last recent release of Redis.

Execute the installer to perform the required installation steps

  • Accept the terms in the License agreement.
  • Add the Redis installation folder to the PATH environment variable.

  • Set the Max Memory Limit from 300-500 MB.

The Redis installation is finished.

  • Now go to windows menu > Run > Services, This can be done by following shortcut win+R, type services.msc & click OK, it will open a new Services tab.
  • Find Redis right click on it & go to Properties > Recovery a new tab will open.

  • Change first failure, second failure & subsequent failure from Take No Action to Restart the Service & click OK.

Redis has been successfully installed, this can be confirmed in Command Prompt by typing redis-cli, a loopback address will be shown in the Command Prompt.

3. Install NSSM

Click here to download NSSM.

Unzip the nssm-2.24 zip file, a folder nssm-2.24 with nssm files will be created.

Go inside the folder & copy the nssm-2.24 folder & paste it in C:\Program Files.

Go inside the pasted nssm-2.24 folder, go to win64, nssm will be present there, copy the nssm path i.e, C:\Program Files\nssm-2.24\win64.

Paste this path in System Environmental Variables by following the below steps:

  • Right click on This PC, go to *Properties > Advanced System Settings > Environment Variables.

  • Now click on Path > Edit > New & add copied path C:\Program Files\nssm-2.24\win64 \ here and click OK in all 3 tabs.

NSSM has been installed now, it can be confirmed in Command Prompt by typing nssm

4. Configure NSSM

Go to Command Prompt and configure Faveo-Mail-Worker, Faveo-Recurring & Faveo-Reports by typing the following commands:

a. Faveo-Mail-Worker

Type the below command in Command Prompt, this will open a new window.

nssm install faveo-mail-worker
  • In Application section click on three dots and navigate to C > Windows > System32 and search for cmd, click on the cmd as shown in the figure below, then click on open, a path will be added.

  • Add the below content as Arguments:
/c php "c:\inetpub\wwwroot\artisan" queue:work redis --sleep=3 --tries=3
  • Go to Details and give Display Name as faveo-mail-worker. (faveo-recurring & faveo-reports for the remaing two.)

  • Now click on the right arrow and go to I/O and set Output (stdout) by clicking on three dots.

  • Navigate to C:\inetpub\wwwroot\storage\logs, provide a file name as worker.log (recurring.log & reports.log for the remaing two) and click open as shown in figure below, Output (stdout) will be added.

  • Now click on Install Service .

  • (Do the Same for remaing two as well):

  • Now go to windows menu > Run > Services, This can be done by following shortcut win+R, type services.msc & click OK, it will open a new Services tab.
  • Find Faveo-mail-worker right click on it & go to Properties > Recovery a new tab will open.

  • Change first failure, second failure & subsequent failure from Take No Action to Restart the Service & click OK.

  • Now click faveo-mail-worker and start the service as shown below:

Repeat the above steps for FAVEO RECURRING & FAVEO REPORTS

The details to be filled for Faveo Mail Worker, Faveo Recurring & Faveo Reports are summarised below:

  • FAVEO MAIL WORKER

Command

nssm install faveo-mail-worker

Path

C:\Windows\System32\cmd.exe

Startup Directory

C:\Windows\System32

Arguments

/c php "c:\inetpub\wwwroot\artisan" queue:work redis --sleep=3 --tries=3

Output(Stdout)

C:\inetpub\wwwroot\storage\logs\worker.log
  • FAVEO RECURRING

Command

nssm install faveo-recurring

Path

C:\Windows\System32\cmd.exe

Startup Directory

C:\Windows\System32

Arguments

/c php "c:\inetpub\wwwroot\artisan" queue:work redis --queue=recurring --sleep=3 --tries=3

Output(Stdout)

C:\inetpub\wwwroot\storage\logs\recurring.log
  • FAVEO REPORTS

Command

nssm install faveo-reports

Path

C:\Windows\System32\cmd.exe

Startup Directory

C:\Windows\System32

Arguments

/c php "c:\inetpub\wwwroot\artisan" queue:work redis --queue=reports --sleep=3 --tries=3

Output(Stdout)

C:\inetpub\wwwroot\storage\logs\reports.log

Now NSSM has been successfully configured.

Updated: