Installing REDCap On A Windows Server2012R2
Installing REDCap On A Windows Server2012R2
Installing REDCap On A Windows Server2012R2
In most cases, REDCap is fully installed by the IT department. In other cases, a clinical research department is the one
initializing/starting the REDCap installation process. In the first case, all the resources needed are available within IT and
installing REDCap becomes a problem of scheduling. In the second case, not all aspects of REDCap’s installation must be
completed by IT personnel, which means that the approach can be divided into IT and non-IT responsibilities. In this
document, the latter approach was used. However, the document can prove to be enough for IT personnel to
understand all the aspects of a REDCap installation. The document doesn’t have highly technical details and information.
It contains sequential steps of how to install REDCap from scratch along with tips and tricks, and references that can
help any IT professional or REDCap aficionado understand what is the next installation step. The goal of the document is
to arrive to a stable REDCap Production server with all its features installed. The document was created for New England
Baptist Hospital, but it is voluntarily being shared with the REDCap Consortium.
Database Server:
o 8GB RAM
o 4 Cores of CPU
o 100GB Hard Disk
Web Server:
o 4GB RAM
o 2 Cores of CPU
o 100GB Hard Disk
Keep the document alive - there is no good or bad modification done to this document
o Any and all modifications are welcome and I encourage you to be supportive of promoting its change
and improvement in the most professional manner
When adding new information
o Update the document’s table of contents to make it easy for the reader to find your contribution,
o Leave a comment of your work in the Version log section
o Update the Table of Contents by clicking on its title and clicking “Update Entire Table”
When fixing an error
o Fix the error you found the best way you can,
o Use the Version Log section to leave a comment of what was changed
o Update the Table of Contents by clicking by on its title and clicking “Update Entire Table”
Version Log section
o Use today’s date ([YYYYMMDD]) in between brackets for determining the version number
o Leave a comment of your work and use your name to sign it
o I suggest you use a hyperlink to your LinkedIn Profile on your name so that you can be found for further
questions
Update the document’s footer with you name and document version number on the “Lasted Edited by” section
Re-upload the updated document to REDCap’s Consortium page, using this link, with the version number in the
file name, i.e. [20180412]REDCapInstallation.docx
While there are several databases that could be used for installing REDCap, we used a MySQL Server to create the
database required by REDCap. The installations steps for MySQL Server are described online, but here’s a brief outline
(found online) of how it can be installed.
Install the MySQL database server on your PC. We will do this using the 'MSI' one-click installer for Windows.
Go to http://dev.mysql.com/downloads/ and download the 'MySQL Installer for Windows'. At the time of writing
this was from a very obvious graphic at the top of the screen (which I missed the first time).
Run the installation. Click...
o Install MySQL products
o Accept the license
o Allow the version check (optional)
o At 'Choose a Setup Type' accept the "Developer Default" and click Next
o A number of downloads of required software may be identified. Click Execute and follow onscreen
instructions to install them.
o At 'Installation progress' screen, hit Execute - the MySQL software will be installed
o At 'Configuration overview' hit Next to go to the basic configuration screen.
o Accept all the defaults on the 'MySQL Server Configuration' and hit Next.
o On the password screen, supply a password for the 'root' (main administrator) user. Make sure it's one you
won't forget. You can also create a 'User' account just for Moodle with more restricted access if you like.
This would be good practice on a public server but just using the 'root' user will suffice for testing.
o On the Service details page, accept the defaults and hit Next and then Next a couple more times for the
configuration progress.
o Click Finish. Job done.
MySQL Workbench will open. Under Server Administration (right hand column, double click 'Local MySQL56' (or
whatever you called it). A box should pop up asking for the root password. Enter the password you supplied
The server management screen should appear. You don't have to worry too much about this. It just shows the
install is working.
The installation process requires you to manually run the install command from C:\Apache24\bin folder. Using a
Command Prompt as an Administrator (right click and select Run as Administrator) do the following:
C: cd Apache\bin
httpd –k install
httpd –k start
Set Apache to work on the right port so it can connect on http://localhost and test it.
https://httpd.apache.org/docs/2.4/platform/windows.html
Finally, in the PHP folder, copy the file php.ini-development and name it php.ini. In this file change the values of
the following parameters:
Now restart services through Service Control, and check if http://localhost works.
https://docs.moodle.org/34/en/Manual_install_on_Windows_7_with_Apache_and_MySQL#Step_2:_Ins
tall_Apache
;extension=mysqli
Uncommenting this row will not fix the issue, because the php_mysqli.dll file is found under the c:\PHP\ext\
folder. Add the following lines to the file (or replace the one above):
Now restart Apache by using the Apache Monitor, and check if http://localhost works.
In the database server, open the MySQL Command Line Client and run the following SQL-statements to create
the REDCap Schema:
Please notice that the “redcap_user” and “password_for_redcap_user” must be replaced with the actual user
name and password for this root redcap account. These SQL-statements run without a problem. You can verify
that the REDCap schema has been created by using:
Note: You can exit the MySQL Command Line by typing EXIT.
Now, you can go back to http://localhost/redcap/install.php and it’s going to complain that the database
connection has not been setup:
$hostname, $db, $username, and $password – these are the ones you created in MySQL Command Line.
However, the database.php file also states how to set-up increased security. It is in this file where you specify
the certificate to be used as well as the method for security. I’ll leave this for later. Go back and reload
http://localhost/redcap/install.php. If successful you will see the next message:
Which means that the connection settings work, but a $Salt value needs to be specified. Go back to the
database.php file and add a random alphanumeric string with at least 8 characters:
Save the file and reload http://localhost/redcap/install.php. If successful, the redcap installation shows you Step
3. In it, you can customize the values for the server (webserver) and institution. Here’s how it looks:
Specify all parameters and saves changes. The webpage will reload and it will show Step 4. (If for some reason
you navigate away from this screen you will have to repeat Step 3, but not Step 4.) In this step the REDCap
tables are created by running the SQL-Statement given in the webpage. Here’s how it looks:
Copy the entire statement (using CRTL+A) and paste it in wordpad for now. Go to the db-server, and paste the
SQL-Statement in MySQL client. The statement is very lengthy and it will execute each statement as you paste it.
It will take about a minute or two for the entire command line to stop showing its work. Now, exit MySQL
Command Line and go back to the webserver and click the link under Step 5 called “REDCap Configuration
Check” which looks like this:
The configuration Check shows what is and is not working in the current REDCap Installation. Here’s how it
looked for this case:
Save your changes and go the Control Center’s Configuration Check. If successful, the error message would have
disappeared.
Once you’ve modified the value, restart MySQL with the restartmysql57 application and follow the prompts. The
application needs to be run as an administrator (right-click and select “Run as Administrator.)
Now access REDCap from the web-server and check its Configuration Check. Notice that the error message is no
longer listed and there’s no feedback that the error has been fixed – it’s just not listed anymore. If the error
comes back, it’s because you haven’t set it to the right amount.
Your web server does NOT have the PHP Fileinfo extension installed
The PHP Fileinfo extension has to be enabled in the php.ini file. Before it is enabled, make sure it was installed in
PHP. Search for it and if you find it in your machine, then update php.ini extension (in the same section where
you enabled php_mysqli.dll). Search the php.ini file for fileinfo and update that row by, either uncommenting
the row or updating it with the file’s actual location.
Then restart PHP services by using the Apache Monitor to stop and start services. Again, go back to REDCap’s
Configuration Check module and you’ll notice the error message is no longer present. It now shows as
“installed.”
Then restart PHP services by using the Apache Monitor to stop and start services. Again, go back to REDCap’s
Configuration Check module and you’ll notice the error message is no longer present.
The issue can be fixed permanently from the command line. The steps are outlined by this application.
Nevertheless, here’s what you need to do. You need to schedule a task in Windows. Here’s how to do it:
Now, go back to the Configuration Check and you will see the Cron issue resolved:
The file was extracted, and its main folder was placed on C:/ as shown in the following figure:
The next step is to enable the curl extension in PHP’s php.ini file. As before, the extension needs to be
uncommented for it to be enabled:
Note: Notice that the extension directory can be set as a constant and that avoids the need to
set the extension’s file location for every extension that is to be included.
The next step is to add the PHP’s libssh library to Apache’s configuration file. In Apache’s configuration file
(httpd.conf) add the following lines (LoadFile "C:/PHP/libssh2.dll") to the place in the file were modules are
being loaded.
The communication error is depended on the cURL library. Once all the software requirements for cURL were
installed and the appropriate modules and extension had been enabled in php.ini and Apache’s httpd.conf file
and Apache’s services are restarted, TEST 5 error message should be fixed and displayed as follows:
In short, here are the steps needed for addressing the SSL error. Using the following webpage as reference, we
did:
1. http://www.entrust.net/knowledge-base/technote.cfm?tn=6555I
2. Move the certificate files (cert, CAroot, and key) over to the server.
3. remove encryption from cert file
4. Copy these three files in the C:\Apache24\conf folder.
5. I then edited the httpd.conf file and turned on the SSL option per the link I on step 1.
6. Restart Apache server
NOTE #1: this error message needs to be completed after all configuration (critical) issues
have been resolved.
Note# 2: The configuration steps described in the consortium for Authentication did not work
for me – this might not make sense now, but keep reading and it will: in order to avoid getting
locked-out from the Control Center give administrator rights to the user you create before you
try to set its password and maybe that will work.
The instructions in the consortium didn’t work and I got locked out of Redcap’s Control Center. The steps I followed
were the following:
I added a user,
I tried to set its password but wouldn’t let me because the Authentication Method was set to Public (None).
In Security & Authentication Configuration, I set it to LDAP & Table-based and saved it. I had to logout so I
could set my password.
After setting my password, I logged into REDCap, but it wouldn’t let me into the Control Center, because my
user was not set as an Administrator.
I enabled my user as a super user (Administrator) through MySQL database following the steps in this post found
in REDCap’s consortium:
o https://community.projectredcap.org/questions/26465/cannot-access-controlcenter-after-enabling-
authent.html
Then, you go back to Notification & Reporting and you will see that the notification error is no longer there:
After installing the SSL certificate REDCap will display new configuration error messages. One of these errors is
that REDCap was set-up as http and not https, but since at this point the https has been installed, by installing
the SSL certificate, then REDCap picks up the change and asks you to update the configuration. The error
message can be found in the Control Center’s Notification & Reporting app. Here’s what the error message looks
like:
In this case, the base URL was changed to https://redcap.vanderbilt.org/redcap as established by the SSL
connection. Save the changes and you’ll see, in Notification & Reporting, that the error message is no longer
present.
The first step is to set the STMP value. It expects the value of the SMTP server which in general looks like
server4343.phpmail.com. Here’s a screenshot of the php.ini section for configuring REDCap emailing services. In
this figure, localhost would be replaced by the SMTP value of server4343.phpmail.com.
1. https://community.projectredcap.org/questions/34315/email-setup-on-windows-server.html
2. https://support.office.com/en-us/article/how-to-configure-iis-for-relay-with-office-365-eb57abd2-3859-
4e79-b721-2ed1f0f579c9
Additionally, please refer to the following link for further details about how to configure the php.ini file for
enabling the email service.
http://php.net/manual/en/function.mail.php
REDCap’s mailing feature can be tested by emailing existing users from the Control Panel or by adding a new
user to which REDCap will email a link for setting up his/her password.
These settings cannot be configured from within REDCap. They are lingering issues within the configuration of
MySQL, PHP, or Apache.
It seems that the Institution’s firewall is disabling the current configuration for both of these features. These items were
addressed by IT.
These projects are removed from this list under the Control Center “Home Page Settings” app. In the section of
“Display ‘public’ projects on Home Page”, select “No, do not display public projects” and save changes.
The easiest way to figure out if LDAP has been configured in REDCap is to try to login into REDCap using credentials that
are expected to work under LDAP authentication. That is, use an existing REDCap user login name and LDAP password. If
LDAP is working as expected, the user should be able to login into REDCap. If not, after trying to login, REDCap will
reload and state that LDAP has not been configured. Here how it looks:
REDCap provides an application that tells you the current status of the exiting LDAP configuration. It is located in the
Control Center, under the Security & Authentication Configuration, in the Authentication Method when LDAP & Table-
On a fresh REDCap installation, or when LDAP has not been configured, REDCap displays the following message on the
LDAP troubleshooting link:
The previous message means that PHP’s LDAP extension has not been enabled. There are several steps needed to
enable LDAP in a Windows Server. In a nutshell, PHP for Windows does not include a set of files needed for LDAP to run.
These files exist within the Windows system, but need to be referenced to PHP. The files needed are the following:
libeay32.dll and ssleay32.dll. Once PHP has access to these files, the rest of the steps require enabling an extension in
PHP and a module in Apache. Then, Apache needs to be restarted for the changes to take place. Enabling LDAP in PHP
must begin by referencing the system files to PHP. Here are the steps:
At this point, the libeay32.dll and ssleay32.dll files have been referenced to PHP. In contrast with other systems, On
Windows Server2012 the machine doesn’t need to be restarted for these changes to take place. The next step is to
enable the LDAP extension in PHP. As before, in the php.ini file, enable the LDAP extension as shown by the following
figure:
Once these changes have been made, Apache needs to be restarted using its Apache Monitor. The best way to check
whether the configuration changes were successful is to go back to REDCap’s LDAP troubleshooter-link, as shown above,
and see if the initial error message has been resolved. If successful, here’s how it looks after the PHP and Apache
configurations for LDAP have been completed.
The next step is to set the LDAP credentials within REDCap. These credentials are specified by the LDAP manager at the
host institution. Once these credentials have been obtained, they need to be configured in REDCap’s ldap_config.php
file found under REDCap’s webtools2 folder. Configuring this file is a similar process to setting the database connection
to MySQL. Here’s a screenshot of the file location:
Once the appropriate credentials have been configured, REDCap’s LDAP installation can be tested by login into REDCap
using LDAP credentials. If successful, the user will be able to enter REDCap, and see the corresponding REDCap projects,
using their institutional password. It can also be tested by going to REDCap’s LDAP troubleshooting link and enter a
user’s LDAP credentials. If successful, REDCap will display the following message:
[20180306] Installation steps outlined by Eduardo Morales; professional IT support by Tom Kerrigan.