CgiProxy is a small tool which allows you to expose your Customer Centre and eMarketing link tracking to the Internet without having to install CRM/Customer Service/eMarketing outside your firewall. This is accomplished by having the CgiProxy installed on a server outside your firewall, and then only this program is allowed to communicate with your CRM installation on the inside, using only the HTTP protocol. This means that the only opening you need to make in your firewall is HTTP from your outside server to your inside server. This should be considered a much more secure solution than exposing your whole CRM installation on the outside, or exposing ODBC and fileshare to the outside.
Installation of the CgiProxy
CgiProxy.exe requires only a few support files:
- CgiProxy.exe.config (must be renamed according to renaming of CgiProxy.exe).
All these files can be placed in a folder underneath your Internet Information Server (e.g. "c:\inetpub\cgiproxy") on the server available on the internet.
Installation of static files
Configuration of the CgiProxy
The CgiProxy program is configured by a file in the same folder as the executable, but with the added extention ".config", i.e. "CgiProxy.exe.config". This file only contains a few lines, where only three is mandatory, the URL the proxy should relay all requests to:
url = http://internal_server/scripts/customer.exe
replace = http://internal_server/
replaceWith = http://external_server/
Additionally, you can specify any of the following:
logFile = c:\temp\cgiproxy.log
sleep = 5
Which will log all requests to a log file, and also sleep 5 seconds for each request.
Configuration of the external IIS
IIS needs to be configured so that all requests towards the external URL of your system gets managed by CgiProxy.exe. Since it is not possible to specifically configure the external URL in Customer Service, you need to use the same as on the inside, but with different hostname (this will be improved in 7.1SR1). In other words; if your internal installation is located at http://internal_server/scripts/customer.exe, then your external URL must be http://external_server/scripts/customer.exe.
The way you configure this is first to add "scripts" as an application folder to IIS under the site for your external hostname: right-click the site, click "Add application"
Choose "scripts" as the alias, and choose the folder where you installed CgiProxy (e.g. "c:\inetpub\cgiproxy").
Secondly, you need to configure module mappings in this folder. This is how you configure IIS to respond to customer.exe and what should be done. Double click "Handler mappings" when in the new scripts folder:
Then click “Add Module Mapping…” in the top right corner:
In the new dialog, you will configure the mapping of how IIS should manage this request:
Basically, this dialog now says that any request for customer.exe in this folder should be managed by the CgiModule by executing C:\inetpub\cgiproxy\CgiProxy.exe, and that we name this mapping “customer-cgiproxy” (you can choose any name you like).
TIP: If you want to make sure the redirection works for both CGI modules (.exe) and FastCGI modules (.fcgi) you can use .* in the name of the file in the Request path, like: customer.* . This will make sure that any request to the customer module (irrespective if it is CGI or FCGI) will be correctly redirected. Leave the file name in Executable field as it is configured on the CS side (with .exe or .fcgi).
Test the proxy
You should now be able to navigate your browser to http://external_server/scripts/customer.exe and get the customer center. If this is not working, you will have to investigate the response you are getting. Possible causes for failure are:
- IIS is incorrectly configured: you will get a response saying 404 (not found). Verify your handler and the location of CgiProxy.exe.
- You get a white page with “GeneralException: …”. This is an error message from CgiProxy. Make sure the configuration file for it (“cgiproxy.exe.config”) is correct. Also, make sure your firewall allows connections from the external server to the internal server.
Configure Customer Service
Finally, if the external site is working, you can configure Customer Service to use the external server name in all the URLs it is sending out (through eMarketing, auto replies, etc). This is configured under Settings > System in the field “External URL”. Set this to your external server name, e.g. “http://external_server”.
Configure http redirect
It’s possible that the external address (External URL) is blocked when you internally work with eMarketing. This can lead to issues regarding adding pictures to you e-mail message. The pictures will not be visible in the preview windows as well as inside the mailing message.
To prevent these issues you need to create a http redirect using the following steps:
Install the http-redirect service on the eMarketing server (internal)
Create a website using the external hostname (external_server)
Go to the website you just created and create a http redirect pointing to the internal_server