Code Monkey home page Code Monkey logo

civihr-installer's Introduction

CiviHR Installation Script

CiviHR is a complex system, with many moving parts. It's possible to create a new site manually, but, given the number of necessary steps, this a hard and time consuming task. This script tries to solve this problem, requiring a very minimum number of external tools and it's able complete an installation in just a few minutes.

Technical Requirements

In order to run the script and CiviHR you'll need:

  • PHP >= 5.5.9 and < 7 (With these extensions enabled: curl, mysql, gd, mbstring and all the xml extensions)
  • MySQL 5.5 or 5.6
  • Git
  • Curl
  • Drush >= 7 (Available globally)

You'll also need to enable URL rewriting on your web server.

Download and Installation

Just clone this repository to the computer where you want to install civihr and make the civihr-install script executable.

As an optional step, if you want to make the script globally accessible, you can add the cloned folder to your PATH environment variable. Example:

$export PATH=$PATH:/path/to/cloned/repository

Usage

You can always check the most recent usage instructions and all the available options by just calling the script without any params.

These are all the minimum required params:

civihr-install <civihr-site-name> --dbuser <mysql-username> --cmsdb <name-of-drupal-database> --crmdb <name-of-civicrm-database> --url <site-url>

Here's an example:

civihr-install civihr --dbuser root --cmsdb drupal --crmdb civicrm --url http://localhost:8080

This will:

  • Create a new civihr (name taken from the site name) folder inside your current directory
  • Create the drupal and civicrm databases
  • Install CiviHR inside the civihr folder

At the end of the installation you should see some information about your new site:

[[Show site summary (civihr)]]
 - CMS_ROOT: /example/folder/civihr
 - CMS_URL: http://localhost:8080
 - CMS_DB_DSN: mysql://[email protected]:3306/drupal?new_link=true
 - CIVI_DB_DSN: mysql://[email protected]:3306/civicrm?new_link=true
 - ADMIN_USER: admin
 - ADMIN_PASS: <random password>
[[General notes]]
 - You may need to restart httpd.
 - You may need to add the hostname and IP to /etc/hosts or DNS.

After the installation is complete, you'll probably need to create a new virtual host for your site. This configuration will depend on which web server you're using and the specificities of the system/environment on which you're installing CiviHR. Here's an example of how this can be done on Apache:

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost
    DocumentRoot "/example/folder/civihr"

    ServerName localhost
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory "/example/folder/civihr">
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>

Remember, CiviHR requires URL rewriting to be enabled in your web server

With the virtual host in place and the web server restarted, you should now be able to access the new site.

Depending on your permissions settings, you might need to change the permissions of the Drupal files folder (usually inside sites/default/files, /example/folder/civihr/sites/default/files in the example) so that the user running the web server can write to it.

Besides the admin user, the script will also create the civihr_staff, civihr_manager and civihr_admin users. Each one has a different access level to the system. The password for them is the same as their user names.

Upgrading CiviHR

Currently it's only possible to upgrade from one version of CiviHR to the next (for example from 1.6.9 to 1.6.10). So you'll need to run the upgrade script for each version.

For easier understanding upgrade scripts are split into 3 parts.

  • PRE RELEASE part which is done before any code is updated
  • RELEASE part which updates the code from the repos and runs upgrades
  • POST RELEASE which takes care of any new configurations that need to be made after upgrades

Upgrade scripts can be found in upgrade-scripts folder. They must be run from web root folder of the site, not any of it subdirs due to depending on relative paths to run git updates.

Known Issues and Limitations

  • If you pass the database password to the command (using the --dbpass option), you might see a warning saying "Using a password on the command line interface can be insecure". This is just a warning from MySQL and it doesn't interfere with the installation process.
  • If you check the command output, you might see an error message saying "Error while trying to find the common path for enabled extensions of project radix. Extensions are: civihr_default_theme, default, radix.". We're working on fixing this, but for the moment, you can igore it, since it doesn't interfere with the installation.
  • The created site is not suitable for development, as it lacks many of the tools necessary for this

civihr-installer's People

Contributors

hitesh-jain avatar davialexandre avatar aljazceru avatar steliosmilidonis avatar miyanoctem avatar mickadoo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.