Information Systems:UWDOSS - Open Source Development Server

From uniWIKI
Jump to navigation Jump to search

Overview

uwdoss.unipharm.local is a production server VM that hosts InfoNext as well as the integrations database. The software components installed on this machine constitute the majority of the modernization stack uniPHARM is using for new development, with the other component being Iptor Integrator, integration middleware that exists on xtgui.unipharm.local

The server runs Debian Linux.

History

Prior to this server, uniPHARM ran strictly Windows Server for all server applications and workloads. However, there began to be a need for open-source software. For example, Moodle and Mediawiki have been in production since 2015. These are currently being hosted on Windows, using a pre-packaged WAMP stack that arguably is better-suited for development environments. It was decided a Linux server would be useful to uniPHARM's growing need and usage of open-source software.

Installed Software

The major software components running on this server are:

  • PostgreSQL relational database (no longer used)
  • MariaDB (MySQL) relational database
  • Apache web server - Hosts the Django application through mod_wsgi, as well as the static files (HTML/CSS/Javascript)
  • Redis DB - In-memory cache for loading frequently used datasets (e.g. customer name and number)
  • Python - To run Django, and other supporting scripts.
  • Django, Django REST Framework, which are Python packages
  • Other Python packages, such as venv and mysqlclient to help support the solution

Projects

  • InfoNext - extension of Infonet (company intranet)
  • uwdpy - random scripts/utilities for housekeeping, reports. Replaced by Integrator, but this development environment may still be useful (Python is often quicker to get going with, and connectivity to IBM i is sufficient i.e. XML Toolkit, ODBC)

Server Administration

General Linux administration skills are required for the administration of this server. uniPHARM currently has these skills in-house.

This server does not have a GUI. Instead, command-line prompt through vSphere remote console or SSH can be used. Credentials for the user and admin user are as follows:

Generic user
  Username: unipharm
  Password: visionit

Dev/admin user
  Username: uwddev
  Password: CH3CH3O

Superuser (root)
  Root user: root
  Password: visionit

Software updates

The software listed above are all installed as Debian packages and managed with apt/aptitude. The setup is such that there should be no issues doing upgrades and distribution upgrades using the standard Debian upgrade process (i.e. using apt-get dist-update and apt-get upgrade, or the aptitude counterparts).

Python Virtual Environment (venv)

InfoNext uses a virtual environment (through the venv Python module), which is located in /uwdapps/lib/.venv/inx. To activate a particular venv in a console/SSH session: source /root_path_of_venv/bin/activate For InfoNext this is: source /uwdapps/env/bin/activate uwdpy also has its own virtual environment.

ODBC

pyodbc is installed in the inx Python virtual environment. This is for facilitating direct connections to IBM Db2. A DSN for the connection to bart is configured in /etc/odbc.ini. However, this connection is not registered in Django.

Troubleshooting and how-to

Restart web server

  • To restart Apache: sudo systemctl restart apache2

Renew SSL certificate

InfoNext uses a LetsEncrypt certificate for https. certbot is installed on this server to manage the cert (it was used to generate it as well). LetsEncrypt certs can use HTTP or DNS validation. For HTTP validation, the site must be accessible through HTTP. Since the site is not publicly accessible (only VPN and intranet), certbot renewal has been switched to DNS challenge using the DNSME (DNS Made Easy) certbot plugin. DNSME API credentials are stored in /home/unipharm/

  • Enable the DNAT and firewall rule in the firewall (or if already enabled, ensure that the 'Any IPv4' object is added to the Source of the rule).
  • Run certbot renew.
  • Disable the DNAT and firewall rules.

Other Notes

  • This server is backed up using Veeam.