Difference between revisions of "Server maintenence"

From TempusServa wiki
Jump to navigation Jump to search
old>Admin
old>Admin
Line 38: Line 38:


Example of format:  
Example of format:  
foo=foo.tempusserva.dk;bar=bar.tempusserva.dk;hello=hellojohn.tempusserva.dk
  foo=foo.tempusserva.dk;bar=bar.tempusserva.dk;hello=hellojohn.tempusserva.dk


==== Validate backup ====
==== Validate backup ====

Revision as of 07:46, 26 August 2020

Server automated services

This is the installation procedure for remote backup and monitoring.

Prerequisites:

  • SSH accces to the server
  • TS commandline tools installed and up to date

Set up monitoring

  1. Log in into [UptimeRobot.com]
  2. Add new monitor
    1. Monitor type = Keyword
    2. Frindly name = <anything>
    3. URL = <url to service page> (see example below)
    4. Keyword = HEALTHY
    5. Alert when = Keyword not exists
    6. Click the persons to get notified
    7. Create monitor
  3. Tjeck the monitor is working

Example of service page

 https://gdpr.tempusserva.dk/demo/service?OkToday

Set up remote backup

Client server setup

  1. Log into server via SSH
  2. Run: tsrefreshscripts.sh
  3. Run: tsbackupcertificates.sh
  4. Check if cronjobs are missing: sudo crontab -l
    1. Run: tsinstallcronjobs.sh

Backup server setup

  1. FTP download: /tsBackup/tsBackupConfig.php
  2. Add the server entry in the format: name=URL (semikolon seperated)
  3. FTP upload: /tsBackup/tsBackupConfig.php


Example of format:

 foo=foo.tempusserva.dk;bar=bar.tempusserva.dk;hello=hellojohn.tempusserva.dk

Validate backup

  1. Wait to 24h passes
  2. Check the backup status URL
    • Ensure server is in the list
    • Ensure size of backup is sensible (size > 1000)

Server monitor page

Each application contains a public page that can be queried for server status.

The page is: http://SERVER/APPLICATION/service?PASSWORD

Password can be set in the configuration: healthMonitorPassword

Reponse will look something like

<serverstatus>
<flag name="Source version">2081</flag>
<flag name="Unused storage">27%</flag>
<flag name="Database motor">OK</flag>
<flag name="Authentication">OK</flag>
<flag name="Daemon running">NO</flag>
<flag name="Server healthy">HEALTHY</flag>
<flag name="Is user online">NO</flag>
<flag name="Session length">30</flag>
<flag name="DB schema LIVE">tslive</flag>
<flag name="DB schema TEST">tstest</flag>
<flag name="Last view data">2013-02-12 16:53:11</flag>
<flag name="Last exception">2013-02-12 12:28:16</flag>
</serverstatus>

If the goodword HEALTY is found the following things are ok

  • Server is open for logins
  • DB connections are accessible
  • Data / log disc is not full

A good option for an online monitoring tool is Site24x7 which we strongly recommend.

Backup and restore

TS has inbuilt manual functions on the solution level, but measures have to taken to back the data IN the solutions.

Backups should optimally be done either by dumping the database. Alternatively the database can be stopped (important) and data folders can be backed up normally.

The following guide contains directions for setting up incremental backups to remote location, using rsync and SSH connections.

http://tempusserva.dk/mediawiki/index.php?title=Backup_and_restore

Table naming conventions

Every solution has its own table namespace of "data_" followed by the system solution name.

Example for the solution named XXX:

  • data_XXX

Other related tables include

  • data_XXX_file
  • data_XXX_mail
  • data_XXX_comment
  • data_XXX_contact
  • data_XXX_measure
  • data_XXX_member
  • data_XXX_t_YYY
  • data_XXX_accesslog
  • data_XXX_statuslog
  • data_XXX_revisionlog

Deleted tables are prefixed by a timestamp

Accessing the database (MySQL)

Normally Tempus Serva will maintain the database by itself.

Sometimes direct access is needed, for example

  • Partial table data restore
  • Sharding large tables (+1M records or many Blobs)

We recommend the following database tool

Other client tools include

URL redirects and rewrites

Tempus Serva (version 2090+) contains server filters for URL rewrite, redirects and forwards.

The filter is deactivated by default, but can be enabled by

  1. Rename /WEB-INF/web.xml.urlrewrite to web.xml
  2. Change /WEB-INF/urlrewrite.xml as needed
  3. Restart the server

Other options include merging web.xml.urlrewrite into the existing web.xml.

Documentation can be found in following pages