Ch 11: Basic server management
This chapter outlines some useful procedures for managing Heurist servers, including the servers managed by the Heurist development team / Heurist Network.
General observations
Heurist is designed to run on any Linux server
Handy Unix commands
- Disk usage of subdirectories, largest first :
sudo du -sh /var/log/*/ | sort -hr - Delete files older than 30 days :
/usr/bin/find /var/log -maxdepth 1 -type f -name '*.gz' -mtime +30 -delete
(maxdepth 1 will go down one level into immediate subdirectory)
Protocol for full update of Heurist servers
On HeuristRef.net (Heurit development team)
These are commands to be run from the unix interface accessed through SSH
Update the version number as required in the hx-alpha code on the reference server (HeuristRef.net)
and commit to the gitHub repository
cd /var/www/html/HEURIST
cd h7-alpha Change to the current development version (or beta)
sudo nano configIni.php Update the version number (also update on gitHub)
sudo ./copy_distribution_files.sh h7-alpha Update the development version distribution tarfile
sudo ./copy_distribution_files.sh h7-test Update the test version distribution tarfile
cd .. Change back to HEURIST directory
sudo ./copy_h7-alpha-to-heurist.sh Update the ' production' version from h7-alpha
cd heurist Change to the ' production' /heurist/ directory
sudo ./copy_distribution_files.sh heurist Update the production version distribution tarfile
Contents of /var/www/html/HEURIST/DISTRIBUTION :
-rw-rwxr--. 1 apache heurist 15980782 Jun 5 06:57 heurist.tar.bz2
-rw-rwxr--. 1 apache heurist 2506 Jun 5 06:57 verifyInstallation.zip
-rw-rwxr--. 1 apache heurist 6472 Jun 5 06:57 copy_distribution_files.sh
-rw-rwxr--. 1 apache heurist 15947835 Jun 5 06:55 h7-alpha.tar.bz2
-rw-rwxr--. 1 apache heurist 15954804 Jun 5 06:05 h7-test.tar.bz2
-rw-rwxr--. 1 apache heurist 9324732 Jun 5 00:45 h8-alpha.tar.bz2
-rwxrwxr--. 1 apache heurist 6333 Jan 16 09:44 update_heurist.sh
drwxrwxr-x. 2 apache heurist 75 Nov 25 2025 HEURIST_SUPPORT
On other Heurist servers
This protocol is that used on the servers managed by the Heurist development team as of 2026 (Heurist.Huma-Num.fr, HeuristAU.Net and Greek NHRF server)
The same principles can be applied on any server, but this should be automated (at least for h7-alpha)
through a cron setting (typically edited with sudo crontab -e)
# Update heurist alpha version from reference server - build runs daily at 00:30
# Note: 'dummy' parameter replaces sudo param as some servers eg. Huma-Num do not accept sudo without a tty
# This does not update the support libraries, need to run manually without "codeonly" to do this
30 00 * * * curl -l https://heuristref.net/HEURIST/DISTRIBUTION/update_heurist.sh | bash -s h7-alpha dummy codeonly >> /var/www/html/HEURIST/h7-alpha_install.log 2>&1
# precautionary fix of group ownership and permissions
00 01 * * * chown -R apache:heurist /var/www/html/HEURIST
00 01 * * * chmod -R g+rwx /var/www/html/HEURIST
00 01 * * * chown -R apache:heurist /data/HEURIST_FILESTORE
00 01 * * * chmod -R g+rwx /data/HEURIST_FILESTORE
Omitting codeonly at the end causes the support files to be updated - this is generally unnecessary and is only needed once, as all versions share the same support files (we make sure that is always the case, even if there are copies of different versions of the same library)
Update the test version including the support files
curl -l https://HeuristRef.net/HEURIST/DISTRIBUTION/update_heurist.sh | bash -s h7-test sudo
Update the code only for h7-alpha:
curl -l https://HeuristRef.net/HEURIST/DISTRIBUTION/update_heurist.sh | bash -s h7-alpha sudo codeonly
Copy h7-alpha to heurist:|
cd /var/www/html/HEURIST
sudo ./copy_h7-alpha-to-heurist.sh
or alternatively:
cd /var/www/html/HEURIST
chown -R apache heurist
chgrp -R heurist heurist
rm -Rf heurist-temp
cp -R h7-alpha heurist-temp
rm -Rf heurist-prev
mv heurist heurist-prev
mv heurist-temp heurist
chown -R apache heurist
chgrp -R heurist heurist
rm -Rf heurist-temp
Remember to update the version number in configIni.php
and commit to gitHub with a title suh as "Version 7.?.? distribution"
Server Manager functions
Heurist's web interface includes a restricted menu (Admin > Server Manager) which is accessed through a special password set in the heuristConfigIni.php file. This allows the managers of a particular instance to carry out operations across all the databases on the server, including some general integrity checks and maintenance operations, obtaining lists of users and the databases they are attached to, statistics about usage and disk space, bulk mailing users etc.
Since this is only available to the server managers, and since the functions are relatively self obvious and include some explanation when selected, we will not bother with further documentation.
