Skip to content
This repository has been archived by the owner on Feb 4, 2019. It is now read-only.

Latest commit

 

History

History
129 lines (103 loc) · 4.53 KB

README.org

File metadata and controls

129 lines (103 loc) · 4.53 KB

This is a Drupal installation profile for Q-Translate Server. Q-Translate is an application that helps to improve the translations of the Quran, by getting review and feedback from lots of people. http://info.qtranslate.org

Installation

Installation is done inside a Docker container. For instructions about installing Docker see: https://docs.docker.com/installation/

  • Create a working directory:
    mkdir workdir/
        
  • Link the docker directory inside the working directory:
    cd workdir/
    ln -s ../qtr_server/docker .
        
  • Modify and customize the settings:
    cp docker/settings.sh .
    vim settings.sh
        
  • Build a Docker image:
    docker/build.sh settings.sh
    tail -f logs/nohup-qtr_server-master-20150929.out
    less -r logs/nohup-qtr_server-master-20150929.out
        

    This will create a docker image, named qtr_server:master with a minimal ubuntu system and everything that is needed for the normal work of the Drupal application.

  • Create a Docker container like this:
    docker/create.sh
        

    It will create a container with port forwarding like this: -p 80:80 -p 443:443 -p 2201:2201. If you don’t like the default port forwarding, edit config and modify it.

  • Now you can start and stop the container with docker/start.sh and docker/stop.sh, enter the shell of the container with docker/enter.sh, etc.
  • If development=true is set on the settings, then the code of the application inside the container will be linked to the directories qtr_server/ and qtr_client/ inside the workdir, so that you can edit and work on it easily.
  • If it is installed on a local machine (for testing or development), add the domain names qtranslate.org and qtranslate.net on /etc/hosts, like this:
    127.0.0.1 qtranslate.org
    127.0.0.1 qtranslate.net
        

    This way it can be accessed by typing https://qtranslate.org and https://qtranslate.net on the browser location.

Quick install

An easier way to install is by using the script utils/docker-install.sh which automates the steps above, with certain conventions for directory names etc.

vim utils/docker-install.sh
utils/docker-install.sh --qcl_domain=test.qtranslate.net
or
utils/docker-install.sh $(pwd)/settings.sh \
    --git_branch=test --qcl_domain=test.qtranslate.net

This script also installs wsproxy, which allows to run more that one containers with ports 80/443. For this to work, the variable ports on config is set to empty, so that docker does not forward the ports 80 and 443 to the containers. The HTTP request forward to the correct website container is handled by the wsproxy container, based on the domain name.

NOTE: Although utils/docker-install.sh is handy for making a quick installation, it is highly recommended to read and understand this script, because this will be helpful for maintaining the installation. It is not so long and it is easy to understand.

Change configuration

To change the configuration of the server after it has been built, or in case of using a pre-built image, run:

docker/exec.sh install/config.sh

and give the new settings interactively.

Another option is to edit the configuration settings file and give it as a argument to the script:

docker/enter.sh
cp install/settings.sh .
vim settings.sh
install/config.sh settings.sh

It is also possible to run configuration scripts individually, to change only certain configurations. For example:

docker/exec.sh install/config/domain.sh
docker/exec.sh install/config/languages.sh

These scripts can be found on install/config/.

Import translations

By default only a few English translations are imported, just for testing. To import all the translations, call the script import.sh for each language.

docker/exec.sh /var/www/data/import.sh en
docker/exec.sh /var/www/data/import.sh fr
docker/exec.sh /var/www/data/import.sh de
docker/exec.sh /var/www/data/import.sh it