Jumla Sign Language Annotation Tool

Home Image

Installation

Below all required instruction to setup a server in order to run the Jumla Sign Language Annotation Tool.

Packages

  • Apache - 2.2.41(Latest Version)
  • PHP - 7.4.3(Depending on the Laravel requirement)
  • MySQL - 8.0.26(Latest Version)
  • Node - 14.16.1(Depending on some frontend packages)
  • Npm - 6.14.4(Latest version)
  • Composer - 1.10.5(Latest version)
  • Laravel - 8.12(Latest stable version from Laravel framework)

Step 1 - Server Updates

To update the local package index with the latest changes made in the repositories.

Update your system by running:

sudo apt update

Step 2 - Install Apache

The Apache HTTP server is the most widely used web server in the world. It provides many powerful features including dynamically loadable modules, robust media support, and extensive integration with other popular software.

Install apache2

sudo apt install apache2

This command is used to install the apache2 web server.

check the apache2 status: [ make sure that is active]

sudo systemctl status apache2

This command is used to view the status of a service.

after see "Active: active" press

q

Step 3 - Firewall, Allow Web Traffic

Before test Apache, need to modify our firewall to allow outside access to the default web ports. During installation, Apache registers itself with UFW to provide a few application profiles. We can use these profiles to simplify the process of enabling or disabling access to Apache through our firewall.

sudo ufw allow in "Apache Full"

enabling mod_rewrite:

mod_rewrite operates on the full URL path, including the path-info section. A rewrite rule can be invoked in httpd.conf or in .htaccess. The path generated by a rewrite rule can include a query string, or can lead to internal sub-processing, external request redirection, or internal proxy throughput.

sudo a2enmod rewrite

Here we need to activate mod_rewrite using the above command. It's available but not enabled with a clean Apache 2 installation, this command will activate the module or alert you that the module is already enabled. To put these changes into effect, restart Apache.

restrat apache:

sudo systemctl restart apache2

Testing Phase:

Step 1 - Open the browser
Step 2 - Enter the URL http://YOUR-IP/
Step 3 - You will see the Apache Home Page

Step 4 - Install MySQL

MySQL is a powerful database management system used for organizing and retrieving data. It's more friendly with PHP Language.

sudo apt install mysql-server

Finish up by running the MySQL set up script:

setup security:

sudo mysql_secure_installation

Press y|Y for Yes, any other key for No:

Y

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:

1

To set the password security level. Recommended level is 1

choose new password:

[AnyPassword]

To set the required password

Do you wish to continue with the password provided? (Press y|Y for Yes, any other key for No):

Y

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users?

Y

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely?

Y

By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing and should be removed before moving into a production environment.

Remove test database and access to it?

Y

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now?

Y

Step 5 - Install PHP

PHP is an open source web scripting language that is widely used to build dynamic webpages.

sudo apt install php libapache2-mod-php php-mysql

After you answer yes to the prompt twice, PHP will install itself.

Important php modules to be activated:

PHP also has a variety of useful libraries and modules that you can add onto your virtual server.

sudo apt install php7.4-common php7.4-cli php7.4-gd php7.4-mysql php7.4-curl 
php7.4-intl php7.4-mbstring php7.4-bcmath php7.4-imap php7.4-xml php7.4-zip
  • php7.4-common The common is includes common files for PHP
  • php7.4-cli The cli command-line interpreter for the PHP scripting language
  • php7.4-gd The gd Graphics Library is a graphics software library for dynamically manipulating images
  • php7.4-mysql The MySQL module for PHP
  • php7.4-curl The curl makes HTTP request in PHP
  • php7.4-intl The intl Internationalization module for PHP
  • php7.4-mbstring The mbstring Multibyte encoding in PHP
  • php7.4-bcmath The bcmath Binary Calculator is used to working with float values in PHP
  • php7.4-imap The imap is used to connect with mailbox in PHP
  • php7.4-xml The xml eXtensible Markup Language for structured document interchange on the web
  • php7.4-zip The zip is used to transparently read or write ZIP compressed archives and the files inside them.

Tell the web server to prefer PHP files over others:

sudo nano /etc/apache2/mods-enabled/dir.conf
- move the index.php to the first, as like as:

DirectoryIndex index.php index.html index.cgi index.pl

- Then Ctrl+x and answer yes to override and save the file.

Restart apache:

sudo systemctl restart apache2

Testing Phase:

Step 1 - Open the browser
Step 2 - Enter the URL http://YOUR-IP/
Step 3 - You will see the PHP Info Page

Step 6 - Install Composer

Composer is a popular dependency management tool for PHP, created mainly to facilitate installation and updates for project dependencies. It will check which other packages a specific project depends on and install them for you, using the appropriate versions according to the project requirements.

download the Composer installer:

php -r "copy('https://getcomposer.org/installer', 'composer- setup.php');"

Install PHP Composer:

apt-get install curl php-cli php-mbstring git unzip

Set Composer as a command accessible from the whole system:

php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Step 7 - Clone a Git repository

When we create a repository on GitHub, it exists as a remote repository. We can clone our repository to create a local copy on our Droplet and sync between the two locations.

Config:

git config --global user.name "YOUR-NAME" 
git config --global user.email "YOUR-EMAIL"

clone repository to html folder

cd/var/www/html
git clone git@github.com:madainnovation/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center.git 

Are you sure you want to continue connecting (yes/no)?

Yes

Step 8 - install all the framework's dependencies

Install all the framework's dependencies

cd/var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center
composer install

project and storage directory accessible

The web server should now have the permissions it needs to serve content, and our user should be able to create content within the necessary folders.

chmod -R 777 /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/storage
chmod -R 777 /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/bootstrap
chmod -R 777 /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/public

Add .env file

mv /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/.env.example /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/.env
touch /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/storage/logs/laravel.log
chmod -R 777 /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/storage
nano var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/.env
  • change
  • [APP_NAME, APP_URL, DB_DATABASE,DB_USERNAME,DB_PASSWORD and all mail configuration]
press CTRL+x and press y to save the change
php artisan key:generate
php artisan config:cache

Step 9 - Set Up Apache Virtual Hosts

Each domain or individual sites known as "Virtual Hosts".

Delete the default Apache2 index page:

rm /var/www/html/index.html                          

setup the default virtual host

nano /etc/apache2/sites-available/000-default.conf
change DocumentRoot /var/www/html to DocumentRoot /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/public
  • at the bottom add
<Directory /var/www/html/Jumla-Sign-Language-Annotation-Tool-By-Mada-Center/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>                         

press bash CTRL+X and press bash y to save the change

sudo systemctl restart apache2

Step 10 - Database

sudo mysql -u root -p and use root password                         

Access to the MySQL server

CREATE DATABASE DBNAME;                        

To create a new DB

USE DBNAME;
CREATE USER 'DBUSER'@'localhost' IDENTIFIED BY 'USER_PASSWORD';                     

To work with the new databse

GRANT ALL ON DBNAME.* to 'DBUSER'@'localhost';

To create a new database user and assigned all privileges on the madadb

FLUSH PRIVILEGES;

Refresh the privileges

Exit

To give your application a speed boost, you should cache all of your configuration files into a single file using the config:cache Artisan command. This will combine all the configuration options for your application into a single file which will be loaded quickly by the framework.php artisan migrate Update the key stored in the application's environment file.

php artisan config:cache
php artisan migrate --seed

if you’re writing or working about this tool, please cite this paper:

Achraf Othman, Oussama El Ghoul, “Syntactic and semantic annotation tool for Qatari Sign Language Corpus”, 8th International Conference on Information and Communication Technology and Accessibility ICTA’21, December 8-10, 2021 [online].