An urgent need to catch the bug

There is a problem to register a new patient with the Version 2 Patient Portal. After successful setting an smtp email in OpenEMR 5.0.1(4) I was happy to test appointment scheduling using my existing test patients. That was a long awaited and very desirable feature.

Unfortunately I could not registered any new patients. After I clicked ‘Register’ the profile screen did not appear. I got this one instead:

I tried to step further by clicking ‘Next’ and got the next insurance screen and then the final screen after. But the ‘Send Request’ button was dead. Clicking it did not produce any action and the registration process eventually failed.

Then I decided to check the current Demo. On the demo link https://demo.openemr.io/c/openemr/portal the situation was slightly different:

But the alternate demo https://demo.openemr.io/d/openemr/portal unexpectedly worked! The Profile screen appeared, the ‘Send Request’ button was alive and the registration process was almost completed. Due to the most likely lack of an email set up for a demo I got an error message but the registration process itself looked good.

I think there is an urgent need to compare the code in /c/ and /d/ demos while the bug is still there and make some corrections to the current production version.

I’m using OpenEMR Version 5.0.1(4), Browser: Firefox 61.0.1, Amazon Linux 2018.03
There is nothing in the PHP log.

hi @alexvolin, the demo had most likely been tampered with which caused the discrepancy. I’m guessing your situation has something to do with the settings in apache2 openemr.conf file, openemr-devops/openemr.conf at master · openemr/openemr-devops · GitHub

edit: actually @brady.miller stated this

The one funny thing about the portal is that you can’t have a portal session and openemr session open at the same time on the same web browser. Hopefully this is the issue. Does this fix issue? (ie. try the portal on a separate web browser where there is no active openemr session)

edit: may need an alias like Alias /openemr /var/www/localhost/htdocs/openemr

Thank you @StephenWaite for your reply. But I am not an expert in apache configuration especially virtual hosts. Could you please elaborate a little bit more about this? Is it a part of the 5.0.1 installation that I missed? Is there a manual or an article in OpenEMR Wiki about it?

How do I use this openemr.conf file? Should I add the content of it to the httpd.conf or put it somewhere else? I could only find the file with this name in my copy of 5.0.1 in the /ubuntu_package_scripts/ and it is different and simpler.

Btw, Amazon Linux is rather CentOS but not ubuntu. I do not use Docker for OpenEMR installation. And I always close the OpenEMR window before opening a Portal one and vise versa to avoid that session conflict.

P.S. I’ve found the Apache2 Notes article in the Wiki but it is for Ubuntu also and too brief.

hi @alexvolin, not sure this is the fix but you could try to add a directory entry in httpd.conf like the one in contrib you found and restart apache

Thank you again @StephenWaite for your help. I sorted it out eventually. You were right about openemr.conf file but to make it work I had to do something first.

  1. Modify the file openemr.conf itself (attached below). I had to correct the path to the document root for my OS version which is Amazon Linux based on CentOS. The default path must be /var/www/html.

  2. Upload this file to the Apache configuration extension directory. In my case it was:
    /etc/httpd/conf.d

  3. Restart Apache

Unfortunately, it was not enough. I received an error:
[Thu Aug 16 02:44:42.289098 2018] [rewrite:error] [pid …] [client …] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions: /var/www/html/openemr/portal/patient/patientdata, referer: https://XXX.XXX.XXX.XXX/openemr/portal/account/register.php

Due to the Apache heightened security there were some specific settings recommended in the installation guide:
Options -FollowSymLinks
That was preventing the required redirection. I did not want to remove this limitation so the only option left was to replace it with:
Options -FollowSymLink +SymLinksIfOwnerMatch
in the httpd.conf.

Finally, the Portal Registration started working but I am not sure that this was the best solution from the security standpoint. Looks like the developers counted on the .htaccess file in the /portal/patient directory. But then again the security considerations required to set:
AllowOverride none
meaning that all .htaccess files in any OpenEMR directory were disabled.

I think we need to correct the Linux installation guide in the Wiki to inform users about openemr.conf file and how to handle it, i.e.

  • how to correct it (if necessary) depending on their Linux distro,
  • where to upload it in the server file system,
  • what settings should be corrected in the main Apache configuration file.

openemr.conf (1.0 KB)