Skip to content

Installation instructions

Cătălin Frâncu edited this page Oct 17, 2024 · 23 revisions

Assumptions

  • You are running Arch Linux + MariaDB + Apache.
  • The source code will reside under /srv/http/dignitas.
  • The development site will be available at http://localhost/dignitas/www/.
  • The shared drive is /srv/http/dignitas-shared and will be available at http://localhost/dignitas/www/static/.
  • MariaDB connects with username=root, password=<none>, host=localhost, database=dignitas.

For different setups, please adapt the instructions below.

Install required packages

sudo pacman -S apache mariadb php php-apache git gettext imagemagick

Clone and set up the dignitas repo

cd /srv/http/
sudo git clone https://github.com/TeamDignitas/dignitas
sudo chown -R youruser:youruser dignitas
cd dignitas
scripts/setup.sh

Edit Config.php

Most likely you will only need to change

  • URL_HOST and URL_PREFIX if your website URL is different;
  • DB_* if your MariaDB has different connection parameters.

Set up the log file

Replace /var/log/dignitas.log with the value you chose for LOG_FILE in Config.php.

sudo touch /var/log/dignitas.log
sudo chmod 666 /var/log/dignitas.log

Create the shared drive

This is where uploaded files will be stored (author images and others).

sudo mkdir /srv/http/dignitas-shared

Create an empty database

mariadb -u root -e 'create database dignitas charset utf8mb4'

Enable some required PHP modules

In /etc/php/php.ini uncomment the lines

extension=gettext
extension=intl
extension=iconv
extension=pdo_mysql

Then restart Apache.

sudo apachectl restart

Run the import script

tail -f /var/log/dignitas.log &   # to see what the script does
sudo php scripts/importSampleData.php

Be sure you have read and understood the script's preamble. It deletes stuff!

Note that this gives you a Romanian dataset. We are not currently aware of clones in other languages that can offer working datasets.

Modify /etc/httpd/conf/httpd.conf (as root)

Activate mod_rewrite: ensure the following line is not commented out:

LoadModule rewrite_module modules/mod_rewrite.so

Configure php-apache following the instructions. Currently, this requires you to load php_module and php_module.conf as well as switch to using mpm_prefork_module.

Allow .htaccess files and map the shared drive:

<Directory "/srv/http">
    ...
    AllowOverride All
    ....
</Directory>

Restart the Apache service

sudo apachectl restart

Try it!

Now http://localhost/dignitas/www/ should work.

Keeping up to date

Update the code:

git pull

Git will let you know if any further action is needed:

  • database schema changes: run php scripts/migration.php;
  • config file changes: compare your Config.php file with Config.php.sample;
  • htaccess changes: compare your www/.htaccess file with www/.htaccess.sample.

You can also rerun the import script whenever you wish. In the long run, this is easier than dealing with all the schema changes.

Coding style

We follow the Google Java style guide. Most of the time you can just follow the style of existing code.

Further reading