Installation guide

1.1.Requirements

To use Myddleware you need a server

  • With a web server like apache.
  • PHP from version 5.5
  • MYSQL

Please have a look at the Symfony2 requirements to install Myddleware : http://symfony.com/doc/2.8/reference/requirements.html

Myddleware uses Doctrine so you will need to have the PDO driver installed for the database server you intend using.

Make sure that only_full_group_by isn’t in the MySQL option sql_mode.

1.2.Download Myddleware

Please download the latest version of Myddleware here.

1.3.Copying files to web server

Once you have downloaded the Myddleware package, copy and extract it on your web server.

You should have these directories :

installation_fichiers

Set the following permissions :

  • Make sure that these permissions are correctly set up :
    • Directory myddleware/app/cache/ has to be writable by the web user
    • Directory myddleware/app/logs/ has to be writable by the web user
    • File myddleware/app/config/myddleware.yml has to be writable by the web user

1.4.Install Myddleware

To install Myddleware, open the URL : http://<path_to_myddleware>/web/installMyddleware.php

Change your file permission or PHP configuration if you have permission error or PHP requirement missing :

installation_1

Once you have fixed every error, you should be able to install Myddleware.

Create a database on your server. Fill in the form to connect to this database then create your user profile to log into Myddleware :

installation_2

Wait until the page is refreshed (this could take 30 seconds) :

installation_3

For security reasons, please delete the installation file : http://<path_to_myddleware>/web/installMyddleware.php

Then click on the URL to open Myddleware and log in with the user profile you have just created :

installation_4

Myddleware is now ready to use:

installation_5

1.5.Install via command

Before starting, make sure your configuration is correct : open a command shell and run the program check.php in the directory app : php app/check.php

contab_1

Change your file permission or PHP configuration in case of permission error or missing PHP requirement :

contab_2

Create a database on your server then change these parameters in the file /myddleware/app/config/myddleware.yml:

  • database_driver: pdo_mysql
    • Don’t change the driver pdo_mysql
  • database_host:
    • It is “localhost” if the database is on the server where you have installed Myddleware
  • database_port:
  • database_name:
  • database_user:
  • database_password:
  • secret:
    • You have to create a random string of 32 characters (more info here)

 

Then, go to your Myddleware directory and run these commands :

Clear the cache in case you have already tried to install Myddleware

  • php app/console cache:clear --env=prod

Generate the file Myddleware needs to run (more info here)

  • php app/console assetic:dump --env=prod --no-debug

Generate web bundles files

  • php app/console assets:install web --env=prod

Create tables into your database

  • php app/console doctrine:schema:update --force --env=prod

Add data in the tables created

  • php app/console doctrine:fixtures:load --append --env=prod

Create the user profile to log into Myddleware. Change the values myddleware_username, myddleware_user_email, myddleware_password into your own parameters

  • php app/console fos:user:create myddleware_username myddleware_user_email myddleware_password --env=prod

Add the admin role to the user you have just created

  • php app/console fos:user:promote myddleware_username ROLE_ADMIN --env=prod

 

Now make sure that these permissions are correctly set up :

  • Directory myddleware/app/cache/ has to be writable by the web user
  • Directory myddleware/app/logs/ has to be writable by the web user
  • File myddleware/app/config/parameters.yml has to be writable by the web user

For security reasons, please delete the installation file : <path_to_myddleware>/web/installMyddleware.php

You can now access Myddleware with this URL :

http://<path_to_myddleware>/web/app.php

1.6.Install from Github

To get Myddleware from Github, use this command :
git clone https://github.com/Myddleware/myddleware.git

Go in the Myddleware root directory and install the vendors :
php composer.phar update --no-plugins --no-scripts
php composer.phar install --no-plugins --no-scripts

Create your parameter.yml file :
cp app/config/parameters.yml.dist app/config/parameters.yml

Then follow the steps for installation via command here.

 

2.Set up cron task

Myddleware can work with background tasks to sync your data, send notifications, clean data, and more.

If you wish to do so, you will have to set up some background tasks using the crontab.

Before creating the crontask, make sure your configuration is correct, open a command shell and run the program check.php in the directory app : php app/check.php

contab_1

Change your file permission or PHP configuration in case of permission error or missing PHP requirement :

contab_2

You can now start the following tasks depending on your needs :

cd <myddleware directory>; php app/console myddleware:synchro ALL  --env=background  > /dev/null 2>&1

  • This program will synchronise the data by running every active rule.
  • Parameter => ALL or rule_name_slug :

cd <myddleware directory>; php app/console myddleware:rerunerror 100 5  --env=background  > /dev/null 2>&1

  • This program will read the documents in error and will try to send them again
  • 1st parameter => limitation on the number of documents in error that the program will read. In this particular case, the program will read a maximum of 100 documents in error
  • 2nd parameter => limitation on the number of attempts : documents that Myddleware tried to send maximum 5 times will be read.

cd <myddleware directory>; php app/console myddleware:cleardata  --env=background  > /dev/null 2>&1

  • This program will clear all data depending on whether the parameter “Deleting data” is set on the rule.
  • Don’t run this program if you don’t want to clear data.

cd <myddleware directory>; php app/console myddleware:notification  --env=background  > /dev/null 2>&1

  • This program will send a notification if some documents are in error. An e-mail will be sent to the email address set up in the file myddleware/app/config/config_background.yml , parameter notification_emailaddress

Here is an example of the crontab :

cron_example

3.Upgrade Myddleware

We suggest you use git to update Myddleware. If you don’t have git on your server, here are the instructions on how to install it : https://git-scm.com/download/linux

Before doing any thing, close all your opened data transfer (or in error). Then create a backup of your Myddleware before updating.

After the backup, go to the root directory of Myddleware and run the command as stated below to update all the Myddleware’s files.

If you have never used git with Myddleware, please send these commands:

git init
git remote add -t master origin https://github.com/Myddleware/myddleware.git
git fetch
git checkout origin/master -ft

Otherwise you can only send the command :

git pull

If you get this message below during the pull, you have probably changed at least on file in Myddleware standard code. Please read the good practices article to learn how add custom upgrade safe code in Myddleware. It will help you to manage the conflicts. You can also delete these files, run the pull and you will get the last version of this files. But you will lost your custom code.

If you update Myddleware from version 2.2.1 or inferior, rune this commande :
php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php

Then update Symfony2 vendors and their dependencies:
php composer.phar install --no-plugins --no-scripts
php composer.phar update --no-plugins --no-scripts

Then run this command to update Myddleware’s database:
php app/console doctrine:schema:update --force --env=background
php app/console doctrine:fixtures:load --append --env=background

At this stage, if it is your first upgrade with git, you will have to answer “yes” several times to this question:

Then clear the cache and refresh css and js files with these commands:
rm -rf app/cache/*
php app/console assetic:dump --env=background --no-debug
php app/console assets:install web --env=background
php app/console myddleware:upgrade --env=background

If you have any problem updating Myddleware, please contat us on our forum : https://github.com/Myddleware/myddleware/issues

Suggest Edit