Ubuntu-debian package bugs

bradymiller wrote on Monday, April 28, 2014:

Hi,

I’ve done some testing and noted the following bugs:

  1. Ubuntu 14.04 now uses /var/www/html/ rather than /var/www/ for apache.
    Planned solution is to place a soft symbolic link at /var/www/html/openemr, which directs to /var/www/openemr (via command ‘sudo ln -s /var/www/openemr /var/www/html/openemr’). Note the code interface/globals.php to collect the $web_root also needs to be optimized for this to work (https://github.com/bradymiller/openemr/commit/99601fe1220fb6978edad3536e06812fd8ace325). Also need to configure the paths in apache to not allow access (documents, edi, era, etc) with the /var/www/html/openemr… and /var/www/openemr… paths.

  2. Ubuntu 12.10 and greater decided to do away with the /etc/apache2/httpd.conf file and instead need to place stuff to not allow access to (documents, edi, era) at the end of the /etc/apache2/apache2.conf file.

  3. Need to also test it on most recent Debian (considering Debian is a rolling stable OS with some common sense, so would likely not do what ubuntu is doing (ie. changing paths and configuration files), am guessing it will work fine still on most recent Debian (but do plan to test it).

Goal is to get this stuff done, but if don’t have the resources, then will likely need to drop support for the Ubuntu package in the future.

-brady
OpenEMR

bradymiller wrote on Monday, April 28, 2014:

Hi,

First step is requesting a code review on the following commit to optimize the $web_root parsing in interface/globals.php :
https://github.com/bradymiller/openemr/commit/99601fe1220fb6978edad3536e06812fd8ace325

Note that the original code breaks when have the following setup(this happens when I place a symbolic link in /var/www/html/openemr that is directed to /var/www/openemr, which is for ubuntu 14.04):
apache_document_root: /var/www/html
webserver_root: /var/www/openemr
web_root: /emr
(note how the web_root is incorrect because it simply uses the number of characters in apache_document_root to calculate the web_root(from webserver_root), thus removing too many characters; note web_root should be /openemr)

The above commit will give the following:
apache_document_root: /var/www/html
webserver_root: /var/www/openemr
web_root: /openemr
(the above commit calculates the number of same characters (from left to right) in the apache_document_root and webserver_root strings and then uses this number to collect the web_root from webserver_root. This algorithm won’t break for the normal use case (ie. no soft links used).

Looks good on testing so far. Thoughts?

-brady
OpenEMR

bradymiller wrote on Monday, April 28, 2014:

Debian 7 testing (this is just for record purposes).
OpenEMR ubuntu/debian package works and Debian 7 still uses /var/www as apache directory.
However, in this case, also the /etc/apache2/httpd.conf file no longer exists and need to place the apache security settings in the /etc/apache2/apache2.conf file.

kodusote wrote on Monday, April 28, 2014:

Dear Brady

Thanks for the observation. It would be appreciated if the wiki for installing OpenEMR on Ubuntu is updated with this information for those who want to use Ubuntu 14.04.

Kayode

blankev wrote on Monday, April 28, 2014:

Kayode,

are you offering help on creation of the WIKI pages on UBUNTU packages? Please ask Brady for permission if you don’t have it yet and start including the latest!

Important information indeed for the UBUNTU package users.

fsgl wrote on Monday, April 28, 2014:

Pimm,

I hope some of the despair has dissipated.

Documentation is the easy part. Brady has risen to the challenge and is doing the heavy lifting.


Brady,

Seems that the headache has been replaced by a brainstorm. Attaboy!

Good to hear that Debian is a decent alternative. Have become used to Linux Mint. May have to use LMDE instead of Mate.

blankev wrote on Monday, April 28, 2014:

Never have felt the despair more than after the latest of Brady. Yes indeed the solutions could be around the corner and I could make many red fields into green!

But since you did not see the advantage of a spreadsheet with green, orange, and yellow, why invest time in something that is possible not needed and even better, is out of date, before I can make the updates.

fsgl wrote on Monday, April 28, 2014:

The spreadsheet is a good idea, but the problem is that things are in flux.

After Brady and the other developers have completed this task, by all means, publish the chart in the Wiki.

blankev wrote on Monday, April 28, 2014:

Good ideas without support are a waste of time.

So Wait and see what is around the corner. In the magic world of paperless age visions, more paper is used than ever before. UNFORSEEN future.

The Egytians had great vision and with their comic strips in their education system they were way ahead of time

sunsetsystems wrote on Monday, April 28, 2014:

Brady, this thing with the symlink and setting $web_root seems way too complicated to me. I think it will lead to more problems than it solves. You can instead change the Apache config to set documentroot to /var/www, or tell the user to do that.

Rod
http://www.sunsetsystems.com/

sunsetsystems wrote on Monday, April 28, 2014:

Also look at what happens when you install phpmyadmin. Its web directory is actually installed to /usr/share, and /etc/apache2/conf-available and conf-enabled have a file added to access it via an Alias and take care of other Apache configuration. Perhaps openemr should do something similar (future goal, not now).

Rod
http://www.sunsetsystems.com/

bradymiller wrote on Tuesday, April 29, 2014:

Hi Kayode,

At this point, this is all preliminary (for example, Rod has some good thoughts below that I plan to look into). On the website/wiki, I’ve basically made it clear that the current package is not compatible with Ubuntu 14.04 along with a statement that we are currently working on a compatible package.

-brady
OpenEMR

bradymiller wrote on Tuesday, April 29, 2014:

Hi Rod,

Good thoughts.

Note the change in commit above to “calculating” the $web_root should be more accurate with these changes (ie. in normal use case will still work, however in several use cases where users use soft links it will also work; note I do recall somebody in the past on the forums stating that OpenEMR did not work with soft links).

I’ll try out the phpmyadmin package and look into the conf-available and conf-enabled stuff, since this may be a nice way to ensure direction to /var/www/openemr even on ubuntu 14.04 (would like to avoid migrating the directory since this would require much more work and testing) and perhaps allow inclusion of the directory permissions easier.

Probably not a good idea to auto change apache ubuntu 14.04 setting to path /var/www/ from /var/www/html since may cause security issues (ie. opening stuff to public that was not meant to be) and also would hate to have users need to do anything manually like that (which, again, may be bad advice if a user unknowingly opens stuff to the public that shouldn’t be).

Another consideration is to make the OpenEMR package an official debian package, but that would also involve more effort (and guessing would need to migrate the package to another directory such as /usr/share in that scenario).

I think the main take home right now is that this will take some time, so recommend avoiding the OpenEMR package for ubuntu 14.04 for now.

-brady
OpenEMR

bradymiller wrote on Tuesday, April 29, 2014:

To clarify above,
For now, recommend avoiding the ubuntu OpenEMR package for ubuntu 14.04. The tarball method will work just fine on ubuntu 14.04.
-brady

sunsetsystems wrote on Tuesday, April 29, 2014:

Hi Brady, yes I looked at the commit and do understand it, but got a headache in the process. :slight_smile:

Longer term, doing it similarly to phpmyadmin would also mean figuring out a better place to put the “sites” directories, documents etc. Maybe something like /etc/openemr plus a global setting for file storage location.

Rod
http://www.sunsetsystems.com/

fsgl wrote on Tuesday, April 29, 2014:

For Rod and all other developers joining this thread:
alternate text

We know you can fix this.

blankev wrote on Tuesday, April 29, 2014:

Don’t forget to give stomach protection. We need to get a solution, not an active bleeding ulcer! Keep your eyes open to watch the details… White tablets can go green or red in a wink ;-))

bradymiller wrote on Wednesday, April 30, 2014:

ok,

Including the following Alias and directory permissions in newly created /etc/apache2/conf-enabled/openemr-apache.conf and /etc/apache2/conf-available/openemr-apache.conf files seems to work (Do note that the above webroot fix in interface/globals.php is still required (for the same reason as the soft link method), so will need to get that commit in and tested a bit.):

#OpenEMR default Apache configuration
Alias /openemr /var/www/openemr
<Directory "/var/www/openemr/sites/*/documents">
 order deny,allow
 Deny from all
</Directory>
<Directory "/var/www/openemr/sites/*/edi">
 order deny,allow
 Deny from all
</Directory>
<Directory "/var/www/openemr/sites/*/era">
 order deny,allow
 Deny from all
</Directory>

-brady
OpenEMR

iankarlwallace wrote on Wednesday, April 30, 2014:

Brady - Been following the thread with interest. Was a package maintainer
for RPM stuff on a commercial project in the past so point me to the Debian
package files so that I can start taking a look (and tweaking how they are
built). Cleaner method for this is probably:

  1. Package with a preinstall script that gathers if on less than x version
    of Ubuntu and decides to place ‘openemr’ in /var/www/html instead of
    /var/www. I remember how to work this in RPM (relative dirs and placing
    files in particular locations), shouldn’t be that much different on the
    Debian side of the house.
  2. Installed configuration files for apache (as you noted above) and not
    mucking around with the apache2.conf or the like (poor form).

In my past experience as a sysadmin symlinks (while helpful) usually point
out a quick fix.
cheers
ian

On Tue, Apr 29, 2014 at 5:33 PM, Brady Miller bradymiller@users.sf.netwrote:

ok,

Including the following Alias and directory permissions in newly created
/etc/apache2/conf-enabled/openemr-apache.conf and
/etc/apache2/conf-available/openemr-apache.conf files seems to work (Do
note that the above webroot fix in interface/globals.php is still required
(for the same reason as the soft link method), so will need to get that
commit in and tested a bit.):

#OpenEMR default Apache configurationAlias /openemr /var/www/openemr<Directory “/var/www/openemr/sites//documents">
order deny,allow
Deny from all<Directory "/var/www/openemr/sites/
/edi”>
order deny,allow
Deny from all<Directory “/var/www/openemr/sites/*/era”>
order deny,allow
Deny from all

-brady
OpenEMR http://www.open-emr.org/

ubuntu-debian package bugshttps://sourceforge.net/p/openemr/discussion/202506/thread/e82523fd/?limit=25#457f

Sent from sourceforge.net because you indicated interest in
OpenEMR / Discussion / Developers

To unsubscribe from further messages, please visit
SourceForge.net: Log In to SourceForge.net


Ian Wallace - Advanced Procedures Fellow - Salud Family Health Center (c)
303.681.5732

bradymiller wrote on Wednesday, April 30, 2014:

Hi Ian,

Thanks for offering to help. It would be much tougher to support OpenEMR version upgrading if we don’t keep it in one place. The package pieces are in the codebase here:

(note I am process of modifying the scripts: see soon to come post below)

-brady
OpenEMR