Difference between revisions of "M2Web Installation"

From VistApedia
Jump to: navigation, search
(Added glossary link to Configuration~)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
Back: [[M2Web Overview]]
 +
 +
 +
This page uses the [[historical~| Historical]] meaning of the term "OpenVistA" [[VistA Trademark Issues]]
 +
 
The following page initially copied from:
 
The following page initially copied from:
 
   http://vista.vmth.ucdavis.edu/home/index/48.html
 
   http://vista.vmth.ucdavis.edu/home/index/48.html
Line 4: Line 9:
 
   Comments by K. Toppenberg will be marked with #//kt
 
   Comments by K. Toppenberg will be marked with #//kt
  
M2Web setup update 2006-05-19 by Jim Self
+
Note: The following instructions are for a standard apache2 installation.  For users with version 1 apache, or with RedHat or CentOS, then modifications will be needed.  See comments after Jim's instructions.
 +
 
 +
========================================
 +
'''M2Web setup update 2006-05-19 by Jim Self'''
  
 
The setup of M2Web on Debian with OpenVistA is pretty simple now if OpenVistA and Apache2 are already installed. I assume that OpenVista files are owned by user vista and installed in directory /usr/local/vista/OpenVistA/ and that M2Web files will be owned by user m2web and installed in /usr/local/m2web/. For a private or a demonstration server, M2Web files could as well be  installed in the same place and with the same owner as for OpenVistA.
 
The setup of M2Web on Debian with OpenVistA is pretty simple now if OpenVistA and Apache2 are already installed. I assume that OpenVista files are owned by user vista and installed in directory /usr/local/vista/OpenVistA/ and that M2Web files will be owned by user m2web and installed in /usr/local/m2web/. For a private or a demonstration server, M2Web files could as well be  installed in the same place and with the same owner as for OpenVistA.
Line 10: Line 18:
 
1. download and expand the latest m2web*.tgz file into directory "/usr/local/m2web".
 
1. download and expand the latest m2web*.tgz file into directory "/usr/local/m2web".
  
       # mkdir /usr/local/m2web  
+
       # mkdir /usr/local/m2web F
 
       # cd /usr/local/m2web
 
       # cd /usr/local/m2web
 
       # wget http://vista.vmth.ucdavis.edu/files/m2web_20060519_pre.tgz
 
       # wget http://vista.vmth.ucdavis.edu/files/m2web_20060519_pre.tgz
Line 41: Line 49:
 
       # ln -s mods-available/suexec.load mods-enabled/
 
       # ln -s mods-available/suexec.load mods-enabled/
  
7. Test the apache configuration for errors.
+
7. Test the apache [[configuration~|Configuration]] for errors.
  
 
       # apache2 -S
 
       # apache2 -S
  
8. Restart the apache web server to enable the new configuration.
+
8. Restart the apache web server to enable the new [[configuration~|Configuration]].
  
 
       # apache2ctl graceful
 
       # apache2ctl graceful
  
9. Append vista as an alternate name for 127.0.0.1 in /etc/hosts (for local testing). If your server name is testpc, the configuration line would look something like this:
+
9. Append vista as an alternate name for 127.0.0.1 in /etc/hosts (for local testing). If your server name is testpc, the [[configuration~|Configuration]] line would look something like this:
  
 
       127.0.0.1 localhost.localdomain localhost testpc vista
 
       127.0.0.1 localhost.localdomain localhost testpc vista
Line 68: Line 76:
  
 
Next try http://vista/notebook or http://vista/guestbook
 
Next try http://vista/notebook or http://vista/guestbook
 +
 +
========================================
 +
 +
'''Kevin's modifications of above'''
 +
 +
One of the most important issues with installing M2web (and the problem that took me a few days to figure out) is linux file permissions.  M2web will probably be running as a different user that one normally uses to run VistA.  An unless permissions are set properly, the Apache web server will not be able to access the needed VistA files.
 +
 +
The way I finally solved this problem, following Jim Self's advice, was to ensure that the apache user was a member of the vista group.  This may be different on your setup.  Find out what group your VistA files belong to, and then add the apache user to this group.  There should be tutorials on the web for determining group ownership for files, and for adding users to groups.  This is linux level stuff.
 +
 +
---
 +
 +
 +
Note: on my CentOS [[configuration~|Configuration]], apache2 has been renamed to httpd
 +
Also note, the "#" at the beginning of each line indicates that the user should be  administrator.
 +
    su -
 +
    enter password:    <--- enter password
 +
    #  <-- now in super user mode
 +
 +
5. edit m2web-vista-site to match your installation.  Then copy this file and append it to your httpd.conf file.  Here is how my final httpd.conf looks: [[KT's httpd.conf]]
 +
 +
6. Enable the vista virtual server in Apache and the suexec module so it can run as user vista.
 +
 +
    I don't know how to do this on my system, and it seems to run without it.
 +
    This susexec module allows Apache to operate as a different user. 
 +
    I don't need this because I specify:
 +
      User apache
 +
      Group vista
 +
    And then I made sure that the apache user was a member of the vista group,
 +
    and that all the VistA files were owned by the vista group.
 +
 +
7. Test the apache [[configuration~|Configuration]] for errors.
 +
 +
      # httpd -S
 +
 +
8. Restart the apache web server to enable the new [[configuration~|Configuration]].
 +
 +
      # /usr/bin/system-config-services
 +
      In this GUI, find and highlight httpd and press [restart] buttion
 +
 +
      or try
 +
      # httpd -k restart

Latest revision as of 18:44, 18 October 2012

Back: M2Web Overview


This page uses the Historical meaning of the term "OpenVistA" VistA Trademark Issues

The following page initially copied from:

 http://vista.vmth.ucdavis.edu/home/index/48.html
 on 10/12/06
 Comments by K. Toppenberg will be marked with #//kt

Note: The following instructions are for a standard apache2 installation. For users with version 1 apache, or with RedHat or CentOS, then modifications will be needed. See comments after Jim's instructions.

============================

M2Web setup update 2006-05-19 by Jim Self

The setup of M2Web on Debian with OpenVistA is pretty simple now if OpenVistA and Apache2 are already installed. I assume that OpenVista files are owned by user vista and installed in directory /usr/local/vista/OpenVistA/ and that M2Web files will be owned by user m2web and installed in /usr/local/m2web/. For a private or a demonstration server, M2Web files could as well be installed in the same place and with the same owner as for OpenVistA.

1. download and expand the latest m2web*.tgz file into directory "/usr/local/m2web".

     # mkdir /usr/local/m2web F
     # cd /usr/local/m2web
     # wget http://vista.vmth.ucdavis.edu/files/m2web_20060519_pre.tgz
     # tar xvfz m2web_20060519.tgz

2. load MUMPS data for m2web globals (htCGI, htGo, htNote, htPref, html, view)

     # cd /usr/local/m2web/w
     # $gtm_dist/mupip load -format=binary m2web_20041220.gtmbinary

3. If you did not place m2web files in "/usr/local/m2web/" then replace that in m2web-vista-cgi and m2web-vista-site with the location you chose. If you did not place OpenVistA files in "/usr/local/vista/" then change that as well. Also, If you want the CGI to run as a different user than vista or to respond to a different server name, replace that in m2web-vista-site.

4. edit and then copy file m2web-vista-cgi to /var/www/vista/m2web.cgi and set permissions to make it executable

     # vim m2web-vista-cgi
     # mkdir /var/www/vista
     # cp m2web-vista-cgi /var/www/vista/m2web.cgi
     # chown -R vista.vista /var/www/vista
     # chmod 700 /var/www/vista/m2web.cgi

5. edit and copy file m2web-vista-site to /etc/apache2/sites-available/vista

     # vim m2web-vista-site
     # cp m2web-vista-site /etc/apache2/sites-available/vista

6. Enable the vista virtual server in Apache and the suexec module so it can run as user vista.

     # cd /etc/apache2/
     # ln -s sites-available/vista sites-enabled/
     # ln -s mods-available/suexec.load mods-enabled/

7. Test the apache Configuration for errors.

     # apache2 -S

8. Restart the apache web server to enable the new Configuration.

     # apache2ctl graceful

9. Append vista as an alternate name for 127.0.0.1 in /etc/hosts (for local testing). If your server name is testpc, the Configuration line would look something like this:

     127.0.0.1 localhost.localdomain localhost testpc vista
     If you don't have access to a dns server and you want to make the server available to other local computers, you must make an entry for vista.net in the corresponding file on each client computer. If your server is at 192.168.1.128 then the entry on each client would look something like this:
     192.168.1.128 testpc vista.net

At this point you should now be able to access the VistA database.

For a first test, point your browser (mozilla preferred) on the same computer at http://vista/echo

For a second test, point your browser at http://vista/go

This will present a login screen if you are not already logged in.

If you log in as a programmer (a user with fileman access code = "@"), it will give you a web based MUMPS programmer shell, starting at the top of the page with a text entry field where you can enter MUMPS commands and define new "go" commands.

Next try http://vista/notebook or http://vista/guestbook

============================

Kevin's modifications of above

One of the most important issues with installing M2web (and the problem that took me a few days to figure out) is linux file permissions. M2web will probably be running as a different user that one normally uses to run VistA. An unless permissions are set properly, the Apache web server will not be able to access the needed VistA files.

The way I finally solved this problem, following Jim Self's advice, was to ensure that the apache user was a member of the vista group. This may be different on your setup. Find out what group your VistA files belong to, and then add the apache user to this group. There should be tutorials on the web for determining group ownership for files, and for adding users to groups. This is linux level stuff.

---


Note: on my CentOS Configuration, apache2 has been renamed to httpd Also note, the "#" at the beginning of each line indicates that the user should be administrator.

   su -
   enter password:    <--- enter password
   #   <-- now in super user mode

5. edit m2web-vista-site to match your installation. Then copy this file and append it to your httpd.conf file. Here is how my final httpd.conf looks: KT's httpd.conf

6. Enable the vista virtual server in Apache and the suexec module so it can run as user vista.

   I don't know how to do this on my system, and it seems to run without it.
   This susexec module allows Apache to operate as a different user.  
   I don't need this because I specify:
      User apache
      Group vista
   And then I made sure that the apache user was a member of the vista group,
   and that all the VistA files were owned by the vista group.

7. Test the apache Configuration for errors.

     # httpd -S

8. Restart the apache web server to enable the new Configuration.

     # /usr/bin/system-config-services
     In this GUI, find and highlight httpd and press [restart] buttion
     or try
     # httpd -k restart