Collect! Credit and Collection Software™

  Page Table of Contents Related 'How To' Tutorials

How To Setup Web Host With Apache

Preparation

This document assumes that you have already setup web host as per the help document How to Setup Web Host.

Setup desktop shortcuts or configure tasks in the Windows Task Scheduler to open multiple instances of Collect on the various port numbers. In the startup options, /S80 would be replaced with the ports that you want to use (one for each shortcut or scheduled task). For our example below, we have 4 instances running, and they each use /S8091, /S8092, /S8093, /S8094 respectively. Make note of the actual port numbers that you use as they will be used later in the Apache Configuration below. We would recommend port numbers that are over 1024 to reduce the chance of conflict.

You will also need to alter existing shortcuts to remove 'ss' or 'ss6' from the /W1 argument. For example, /W1ss would become /W1.

Install Microsoft Visual Redistributables from https://support.microsoft.com/en-ca/kb/2977003. Choose the x86 option (32-bit) and x64 installers. 2010 is installed on Server 2012 R2 by default, so you just need to install 2012 and higher.

Top of page.

Install Wamp

Open a browser and download the applicable version of WAMP from http://www.wampserver.com/en/. We recommend that you use the Default Location: C:\wamp64, but it is not required if you want to use a data drive or have experience with Wamp.

Warning Note WARNING: The instructions below are specific to Wamp's version of Apache, not Apache directly or any other web service tool.

Top of page.

Openssl

Wamp does not always have the latest version of OpenSSL. If you want the latest version, you can download the latest OpenSSL binaries here: https://indy.fulgan.com/SSL/

The should be placed in the following locations:
C:\wamp64\bin\php\php7.x.x\libeay32.dll
C:\wamp64\bin\php\php7.x.x\ssleay32.dll
C:\wamp64\bin\apache\apache2.x.x\bin\libeay32.dll
C:\wamp64\bin\apache\apache2.x.x\bin\openssl.exe
C:\wamp64\bin\apache\apache2.x.x\bin\ssleay32.dll

Top of page.

Editing Files

Open using a plain-text editor such as UltraEdit, Notepad++, or Sublime Text. Dot not use Notepad or Word as they add characters

or strip hard returns. https://notepad-plus-plus.org/download/

C:\wamp64\bin\Apache\Apache2.4.#\conf\httpd.conf

Modify and Add the following to lines 26-28 (line numbers approx.)

ServerSignature Off
ServerTokens Prod
TraceEnable Off

Uncomment (remove the # symbol) from the beginning of the lines in the Dynamic Shared Objects (DSO) section:

LoadModule headers_module modules/mod_headers.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf

At the bottom of file, add the following lines and edit the 'yourdomain' section:

Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Redirect / https://something.yourdomain.com/portal/

C:\wamp64\bin\Apache\Apache2.4.#\conf\extras\httpd-ssl.conf

Find the following section (approx. line 125) and update it with the appropriate information for your server. You will need to change htdocs to wwww.

General setup for the virtual host
ServerName client.example.com
ServerAdmin info@example.com

Ensure that ServerName matches what you have or will have on your TLS/SSL certificate.

Alter the following lines with the location of the SSL certs.

SSLCertificateFile "C:/Collect/bin/webhost.crt"
SSLCertificateKeyFile "C:/Collect/bin/webhost.rsa"
SSLCertificateChainFile "C:/Collect/bin/intermediate.crt" - Optional - see below

At some point you will need to generate a TLS/SSL certificate or use Collect!'s built in self-signed certificate. Optionally, depending on what certificate authority or CA you use, you may also need to add an intermediate chain file. If that's the case, upload that file, and update and uncomment SSLCertificateChainFile on line 165.

Useful Note The SSLCertificateChainFile is optional. If you purchase an SSL certificate, it will likely come with the intermediate certificate. You can either drop the file into the Collect\bin folder and is and give it the applicable filename above,

or you can rename the file to intermediate.crt.

Add the following content to the bottom of the httpd-ssl.conf file before </VirtualHost> (the last line), up to and includi ng the </Proxy>. Replace ports 8091-8094 below with the port numbers you used above.

Header set X-FRAME-OPTIONS SAMEORIGIN
ProxyPass /portal balancer://mycluster stickysession=CV12SESSION
ProxyPassReverse /portal balancer://mycluster
ProxyPassReverseCookieDomain 127.0.0.1:8091 localhost
ProxyPassReverseCookieDomain 127.0.0.1:8092 localhost
ProxyPassReverseCookieDomain 127.0.0.1:8093 localhost
ProxyPassReverseCookieDomain 127.0.0.1:8094 localhost
ProxyPassReverseCookiePath / /portal
ProxyPreserveHost Off
ProxyTimeout 600

<Proxy balancer://mycluster>
BalancerMember http://127.0.0.1:8091 keepalive=On route=8091
BalancerMember http://127.0.0.1:8092 keepalive=On route=8092
BalancerMember http://127.0.0.1:8093 keepalive=On route=8093
BalancerMember http://127.0.0.1:8094 keepalive=On route=8094
</Proxy>
Redirect / https://something.yourdomain.com/portal/
Header always set Strict-Transport-Security "max-age=63072000;"

Top of page.

Start Up Apache

Open the WampServer "W" icon on your desktop. The icon in the bottom right of the Windows taskbar should turn green. If it was already running, click the icon and select "Restart All Services".

If the icon is red or orange, a service didn't start. Go to the Windows Event Viewer and bring up the application log to review the errors.

If you've resolved all your errors, you can now click on the WampServer "W" icon in the bottom right of the Windows desktop, and choose "Restart All services".

If everything goes well it should go Red -> Orange -> Green and you can begin testing.

If it does not go green, go into C:/wamp64/logs/ and review the logs that were last written to, for errors. Or go to the Windows Logs. Once you've fixed the errors, click the W, Restart All services and when the W goes green, you can begin testing.

Top of page.

Troubleshooting

Wamp uses a file extension called .SYMLINKS to link .DLL files together instead of having multiple copies of the same .DLL file.

Installing the MS Redistributable files is supposed to take care of this automatically. If you run into issues with the 'mod-ssl' not being installed or configured properly each time you open Wamp, do the following:

Delete
C:\wamp64\bin\apache\apache2.x.x\bin\libeay32.dll
C:\wamp64\bin\apache\apache2.x.x\bin\ssleay32.dll

Copy
C:\wamp64\bin\php\php7.x.x\libeay32.dll
C:\wamp64\bin\php\php7.x.x\ssleay32.dll

Paste Them Both To
C:\wamp64\bin\apache\apache2.x.x\bin\

If you'd prefer a more permanent solution and are comfortable editing the Wamp files, you can do this:

Open: C:\wamp64\scripts\config.inc.php

Find the variable: $phpDllToCopy (around line 129)

Comment out the following from the array list (put /* and */ around the text):

'libeay32.dll',
'ssleay32.dll',

Example:

/*'libeay32.dll',*/
/*'ssleay32.dll',*/

Top of page.

Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.

Please click this link to send us your comments: helpinfo@collect.org