Troubleshooting
Current Page:  Documentation / Troubleshooting

 
Don't Panic!

e-gateway is a complicated application with various dependencies that affect whether or not it will work.  We will take you step-by-step through a checklist that will hopefully see your e-gateway installation up and running as quickly as possible...

  1. if you see an error message from e-gateway itself (i.e. a box with an animated exclamation mark beginning "e-gateway error..."), then you'll be pleased to know that your problem is easy to resolve; simply follow the instructions returned by e-gateway.  If e-gateway doesn't return an error message then the program itself probably isn't running... this indicates either a configuration error or a server problem

  2.  
  3. run e-gateway directly by pointing your web-browser at its' URL (e.g.  http://www.yourdomain.com/cgi-bin/mail_gateway.pl).  If e-gateway returns an error message titled "No Data Submitted", then you know that Perl is correctly installed and the required libraries and modules are available (because e-gateway is running); this indicates that there is an error in your form page or your configuration file.  You must remember to include the address to e-gateway (mail_gateway.pl) in your <Form ...>: tag and to specify a configuration file in that form, otherwise e-gateway won't work.  Check your configuration file very carefully (refer to "Developing for e-gateway" for detailed documentation).  Common mistakes in the configuration file include mixing server paths with URL's, incorrect syntax and inaccurate SMTP server addresses or "sendmail" paths

  4.  
  5. ensure that you have uploaded all e-gateway files as ASCII file-types, NOT as binaries (only applies to those users who have used the FTP service to copy their e-gateway files on to their web-server)

  6.  
  7. check the first line of "mail_gateway.pl"... it should include the complete (physical) path to the Perl interpreter on your web-server (your System Administrator or ISP should be able to help with this).  Note: this is not required for Microsoft Windows NT servers running IIS (Internet Information Server) so you can leave this line unchanged (do not delete it though)

  8.  
  9. check that your web-server has a complete and working Perl version 5.6+ installation (your System Administrator or ISP should be able to help with this)

  10.  
  11. ensure that all the modules and libraries required by e-gateway are properly installed and in Perl's search path.  The libraries and modules that should be available are: "LWP::Simple", "Socket", "MIME::Lite" and "CGI.pm" (your System Administrator or ISP should be able to help with this)

  12.  
  13. check the file permissions, "mail_gateway.pl" must be executable (refer to "Installing e-gateway" for more detailed documentation).  Some servers do not allow you to adjust file permissions via FTP, consult your System Administrator (or ISP) for help with this

  14.  
  15. check your paths:  you specify various paths in the configuration file that must match the physical paths on the web-server if e-gateway is going to run successfully.  Server paths are used to locate your template files (if they are not in the same directory as "mail_gateway.pl") and to describe the location of "sendmail" (if you aren't using e-gateways' internal SMTP engine).  NOTE: All such paths should use the "/" as path separators - even when installing on a Windows NT server; never use "\" as a path separator.  Consult your System Administrator or ISP for exact server paths (or read the "CGI Doctor" notes at the bottom of this page)

  16.  
  17. Microsoft Windows NT / IIS (and other web-servers) require that file-types are "mapped" to a specific application (when there is an application dependency).  That is, the web-server needs to be told that files with an extension of ".pl" (for example) should be run by Perl (or whatever application a particular file-type is dependent on).  Some System Administrators configure their servers so that only files with a ".plx" extension run via the Perl interpreter.  Rename "mail_gateway.pl" to "mail_gateway.plx" to rectify this or consult your System Administrator (or ISP).  If you do this, remember to adjust your form so that it calls "mail_gateway.plx", not "mail_gateway.pl".  You could also try renaming "mail_gateway.pl" to "mail_gateway.cgi"

  18.  
  19. certain Microsoft Windows NT / IIS installations won't work with e-gateway unless it sends an "OK" header before anything else...  load "mail_gateway.pl" in your preferred text editor and look for the line (line 18) which reads:
     
    # print "HTTP/1.0 200 OK\n";

    Remove the "# " characters from the beginning of the line, save and upload to implement this

  20.  
  21. a very common problem with Perl CGI applications is the "500 Server Error" (or "Internal Server Error"), some of the most common reasons for this (and their solutions) are listed below:
     
    1. the path to Perl is incorrect – please confirm the correct location of Perl with your System Administrator or ISP and then verify that the first line of "mail_gateway.pl" is the same as the path they give you
       
      Note:  The path to Perl is "#!/usr/bin/perl" by default on the standard e-gateway distribution, some hosts use "#!/usr/local/bin/perl" - you could try this first for a possible quick fix

    2.  
    3. you have inadvertantly uploaded some or all of the e-gateway files as binary files - you should upload all e-gateway files as ASCII

    4.  
    5. the Apache Server "srm.conf" file does not have a correct "ScriptHandler" set for ".cgi" and ".pl" extensions.  Consult with your System Administrator or ISP

    6.  
    7. the Apache Server "srm.conf" file does not allow "CGIExec".  Consult with your System Administrator or ISP

    8.  
    9. the ".plx" file extension is mapped to Perl but ".pl" is not.  Consult with your System Administrator or ISP.  Alternatively, rename "mail_gateway.pl" to "mail_gateway.plx" to rectify this.  If you do this, remember to adjust your form so that it calls "mail_gateway.plx", not "mail_gateway.pl"

  22.  

 

CGI Doctor

To help you with troubleshooting your e-gateway installation, we have included a small diagnostic program ("doctor.pl") that will analyse your web-server and report back to you on what it finds there.  Edit "doctor.pl" so that the first line points to the Perl interpreter (see step 4, above), then upload it into the same directory as "mail_gateway.pl" and give it executable permissions (remember to upload the file as an ASCII file, not as a binary).

Run the "CGI Doctor" (point your web-browser at http://www.yourdomain.com/cgi-bin/doctor.pl - use the equivalent URL for your website).

"CGI Doctor" will return a detailed analysis of your server environment that should give you enough information to adjust your e-gateway configuration details.  Pay particular attention to: "Current Working Directory", "HTTP Host", "OS (Operating System)", "Perl Version", "Server Name (Operational Domain)" and "Server Software".

"CGI Doctor" has one more useful feature...  if you submit form data to it, it will display a list of every variable it receives (name and value), which is great for debugging your e-gateway forms!  To use this feature simply point your form at "doctor.pl", enter some data into the form and submit it...  the doctor will do the rest...  :-)