Installing TimeTrex on Linux

Home / Installation Help

Installing TimeTrex on CentOS Linux v8 from the .ZIP file:

  1. Install the prerequisite packages:
    dnf -y install epel-release
    dnf config-manager --set-enabled remi
    dnf -y module install php:remi-8.1
    dnf -y install php-cli php-pgsql php-pspell php-gd php-gettext php-imap php-intl php-json php-soap php-zip php-curl php-ldap php-xml php-xsl php-mbstring php-bcmath php-process httpd postgresql-server unzip nano policycoreutils-python-utils
  2. Enable Apache to start on boot then restart the service:
    systemctl enable httpd
    service httpd restart
  3. Open the firewall to allow HTTP/HTTPS connections from the public zone:
    firewall-cmd --permanent --zone=public --add-port=80/tcp
    firewall-cmd --permanent --zone=public --add-port=443/tcp
    firewall-cmd --reload
  4. Download the TimeTrex .ZIP file to your computer.
  5. Unzip the TimeTrex .ZIP file to the root web directory:
    unzip <TimeTrex-installer>.zip -d /var/www/html/
    Rename the unzipped directory:
    mv /var/www/html/TimeTrex_v<version>/ /var/www/html/timetrex
  6. Rename the TimeTrex.ini.php file:
    mv /var/www/html/timetrex/timetrex.ini.php-example_linux /var/www/html/timetrex/timetrex.ini.php
  7. Edit the timetrex.ini.php and confirm all paths are correct:
    nano /var/www/html/timetrex/timetrex.ini.php
    Note: Make sure the log directory and storage paths are created and that Apache can write to them.

    If you are using the default directories you can use these commands:
    mkdir -p /var/timetrex/storage
    mkdir -p /var/log/timetrex
    chgrp -R apache /var/timetrex
    chmod 775 -R /var/timetrex
    chgrp -R apache /var/log/timetrex
    chmod 775 -R /var/log/timetrex
    chgrp apache -R /var/www/html/timetrex
    chmod 775 -R /var/www/html/timetrex
    Configure SELinux so access to the above directories is allowed:
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/timetrex(/.*)?"
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/timetrex(/.*)?"
    semanage fcontext -a -t httpd_sys_rw_content_t "/var/log/timetrex(/.*)?
    restorecon -r "/var"
    setsebool -P httpd_can_network_connect 1
    setsebool -P httpd_can_sendmail 1
  8. Create a user and database for TimeTrex to use:
    postgresql-setup initdb
    systemctl start postgresql
    systemctl enable postgresql
    su postgres
    CREATE DATABASE timetrex;
  9. Once you have made the database and user we need to set the authentication for connections to md5. We do this so we can log in with the password we set for the timetrex user:
    nano /var/lib/pgsql/data/pg_hba.conf
    Change the end of the following line:
    "local   all             all                                     peer"
    To this instead:
    "local   all             all                                     md5"
    Then restart postgres to load the new configuration:
    systemctl restart postgresql
  10. Point your web browser to the TimeTrex web-based installer:
    http://<web server address>/<timetrex directory>/interface/install/install.php
  11. Follow the on screen instructions that will walk you through the installation wizard. *NOTE: On the "Database Configuration" step you will need to enter the above created password for the database in the "Database Password" field. As well you will need to set the "Host Name" field to be two single quotes ('') so unix socket connections are used.

See the following guides for instructions on installing TimeTrex for other operating systems: