Linux (RedHat-Fedora) Installation: Difference between revisions

From IHRIS Wiki
No edit summary
 
(14 intermediate revisions by 2 users not shown)
Line 19: Line 19:


<pre>
<pre>
yum install httpd mysql-server php php-devel php-mysql
yum install httpd mysql-server php php-devel php-mysql php-xml
</pre>
</pre>


If you have never used mysql on your system, you will be asked to set the 'root' password for mysql. We will refer to this password as XXXXX below.
Please ensure your system can send email properly before continuing. RedHat and Fedora typically will have a configured version of sendmail installed by default.
 
== Configuring PHP ==
 
Next, you'll need to increase the memory limit for PHP. You can do this by editing the /etc/php.d/php.ini. Change the following line:
 
<pre>
memory_limit = 32M
</pre>
 
to:


Please ensure your system can send email properly before continuing. RedHat and Fedora typically will have a configured version of sendmail installed by default.
<pre>
memory_limit = 128M
</pre>


== Installing Pear and PECL Packages ==
== Installing Pear and PECL Packages ==
Line 35: Line 47:
</pre>
</pre>


During certain activities like installation and upgrades you may need more memory than APC uses by default. To increase the memory limit, edit /etc/php.d/php.ini and add the following line:
During certain activities like installation and upgrades you may need more memory than APC uses by default. To increase the memory limit, edit /etc/php.d/php.ini and change:
 
<pre>
apc.shm_size=32
</pre>
 
to


<pre>
<pre>
Line 50: Line 68:
The pecl package ''FileInfo'' is used to verify the validity of file types used for uploading (e.g. for uploaded images or docuemnts). You can install this with the following commands:
The pecl package ''FileInfo'' is used to verify the validity of file types used for uploading (e.g. for uploaded images or docuemnts). You can install this with the following commands:


yum install file-devel
  pecl install Fileinfo
  pecl install Fileinfo
  echo extension=fileinfo.so >> /etc/php.ini
  echo extension=fileinfo.so >> /etc/php.ini
Finally, edit /etc/php.ini and set your timezone:
date.timezone = America/New_York
Change "America/New_York" to match your locality -- the county and city spellings should match the directory structure found in /usr/share/zoneinfo/.


After installing these supplemental packages, be sure to restart apache with the following command:
After installing these supplemental packages, be sure to restart apache with the following command:


  apache2ctl restart
  apachectl restart


== Database Setup ==
== Database Setup ==
 
=== Manual Setup ===
To create the needed database you can do:
To create the needed database you can do:
  mysql -u root -p
/etc/init.d/mysqld start
  mysql -u root
  mysql> CREATE DATABASE ihris_manage;
  mysql> CREATE DATABASE ihris_manage;
  mysql> GRANT ALL PRIVILEGES ON ihris_manage.* TO ihris_manage@localhost identified by 'PASS';
  mysql> GRANT ALL PRIVILEGES ON ihris_manage.* TO ihris_manage@localhost identified by 'PASS';
Line 68: Line 94:
In version 4.0.1 of iHRIS we create mysql functions.  If you are having trouble creating routines see [http://www.ispirer.com/wiki/sqlways/troubleshooting-guide/mysql/import/binary-logging this].
In version 4.0.1 of iHRIS we create mysql functions.  If you are having trouble creating routines see [http://www.ispirer.com/wiki/sqlways/troubleshooting-guide/mysql/import/binary-logging this].


Alternatively, you may choose to install phpmyadmin to administer database through the web
On Fedora systems, you'll also need to execute these commands to ensure database connectivity functions correctly:
<pre>
 
yum install phpMyAdmin
ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock
</pre>
Now browse to:
<center>
http://localhost/phpmyadmin
</center>
login with the user 'root' and password XXXX that you set above.  Once logged in you will create a database and user called ihris_manage.  To
do this, click on  the 'Privileges' link and select 'Add a new User'. Then fill out the form as follows:
[[Image:Phpmyadmin_create_user.gif|center|frame|Creating iHRIS_Manage Database and User]].  For security, make sure the password
you choose is different than the root password for mysql. Let us refer to this password as YYYYY.


== Downloading the Software ==
== Downloading the Software ==
Line 87: Line 104:
mkdir iHRIS
mkdir iHRIS
cd /var/lib/iHRIS
cd /var/lib/iHRIS
mkdir 4.0.0
mkdir 4.1.5
ln -s 4.0.0 4.0
ln -s 4.1.5 4.1
ln -s 4.0 current
ln -s 4.1 current
cd /var/lib/iHRIS/4.0.0
cd /var/lib/iHRIS/4.1
wget http://launchpad.net/ihris-manage/4.0/4.0.0/+download/ihris-manage-full-4_0_0.tar.bz2
wget http://launchpad.net/ihris-manage/4.1/4.1.5/+download/ihris-manage-full-4_1_5.tar.bz2
tar -xjf ihris-manage-full-4_0_0.tar.bz2
tar -xjf ihris-manage-full-4_1_5.tar.bz2
</pre>
</pre>


Line 164: Line 181:
Finally, we make iHRIS Manage site we just created available via the webserver:
Finally, we make iHRIS Manage site we just created available via the webserver:
<pre>
<pre>
ln -s /var/lib/iHRIS/sites/manage/pages /var/www/manage
ln -s /var/lib/iHRIS/sites/manage/pages /var/www/html/manage
cp /var/www/manage/htaccess.TEMPLATE /var/www/manage/.htaccess
cp /var/www/html/manage/htaccess.TEMPLATE /var/www/html/manage/.htaccess
vim  /var/www/manage/.htaccess
vim  /var/www/html/manage/.htaccess
</pre>
</pre>
We need to look for the line RewriteBase and change it to the web directory we want to use we are using,  ''/manage''.  You may now save and quit.
We need to look for the line RewriteBase and change it to the web directory we want to use we are using,  ''/manage''.  You may now save and quit.
Line 175: Line 192:
Now we need to make sure we can use the ''.htaccess'' file.
Now we need to make sure we can use the ''.htaccess'' file.
<pre>
<pre>
vim /etc/apache2/sites-available/default
vim /etc/httpd/conf/httpd.conf
</pre>
</pre>
Change:
Change:
<pre>
<pre>
         <Directory /var/www/>
         <Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
Options Indexes FollowSymLinks MultiViews
AllowOverride None
AllowOverride None
Line 188: Line 205:
to:
to:
<pre>
<pre>
         <Directory /var/www/>
         <Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
Options Indexes FollowSymLinks MultiViews
AllowOverride All
AllowOverride All
Line 200: Line 217:
Let us restart the Apache webserver using:
Let us restart the Apache webserver using:
<pre>
<pre>
/etc/init.d/apache2 restart  
/etc/init.d/httpd restart  
</pre>
</pre>
Now we are ready to begin the site installation.  Simply browse to:
Now we are ready to begin the site installation.  Simply browse to:
Line 212: Line 229:
Here are samples of the files we edited above:
Here are samples of the files we edited above:
<ul>
<ul>
<li> [[Media:default.txt | /etc/apache2/sites-available/default]] </li>
<li> [[Media:default.txt | /etc/httpd/sites-available/default]] </li>
<li> [[Media:IHRIS-Manage-Site_xml.txt | /var/lib/iHRIS/sites/manage/iHRIS-Manage-Site.xml]] </li>
<li> [[Media:IHRIS-Manage-Site_xml.txt | /var/lib/iHRIS/sites/manage/iHRIS-Manage-Site.xml]] </li>
<li> [[Media:htaccess.txt | /var/www/manage/.htaccess ]] </li>
<li> [[Media:htaccess.txt | /var/www/manage/.htaccess ]] </li>
<li> [[Media:Config_values_php.txt | /var/www/manage/config.values.php]] </li>
<li> [[Media:Config_values_php.txt | /var/www/manage/config.values.php]] </li>
</ul>
</ul>
[[Category:Installation]][[Category:Review2013]]

Latest revision as of 16:33, 16 July 2013

Getting Ready

Here are instructions for installing the iHRIS Suite on an Linux (RedHat or Fedora) system. If you need help installing a RedHat distribution, visit:

The following steps assume you have root-level access to your Linux machine. Root-level access is achieved by any of the following steps

  • Login to your server directly as the root user.
  • Use "su" at the command prompt to switch to the root user.
  • Prepend the "sudo" command to each command listed here to execute as root.

First, if your Linux installation includes SELinux, disable it using by modifying /etc/sysconfig/selinux to read:

SELINUX=disabled

Now, install a Lamp server.

yum install httpd mysql-server php php-devel php-mysql php-xml

Please ensure your system can send email properly before continuing. RedHat and Fedora typically will have a configured version of sendmail installed by default.

Configuring PHP

Next, you'll need to increase the memory limit for PHP. You can do this by editing the /etc/php.d/php.ini. Change the following line:

memory_limit = 32M

to:

memory_limit = 128M

Installing Pear and PECL Packages

We need to install a few Pear and PECL packages for PHP. For the Pear packages you can do:

yum install php-pear php-pecl-apc
pear install MDB2 MDB2#mysql text_password console_getopt

During certain activities like installation and upgrades you may need more memory than APC uses by default. To increase the memory limit, edit /etc/php.d/php.ini and change:

apc.shm_size=32

to

apc.shm_size=100

There are two optional packages you may wish to install:

yum install php-gd php-tidy

These packages are used to for inserting images into PDF output of reports and for exporting XML files in a nicely formatted manner.

The pecl package FileInfo is used to verify the validity of file types used for uploading (e.g. for uploaded images or docuemnts). You can install this with the following commands:

yum install file-devel
pecl install Fileinfo
echo extension=fileinfo.so >> /etc/php.ini

Finally, edit /etc/php.ini and set your timezone:

date.timezone = America/New_York

Change "America/New_York" to match your locality -- the county and city spellings should match the directory structure found in /usr/share/zoneinfo/.

After installing these supplemental packages, be sure to restart apache with the following command:

apachectl restart

Database Setup

Manual Setup

To create the needed database you can do:

/etc/init.d/mysqld start
mysql -u root
mysql> CREATE DATABASE ihris_manage;
mysql> GRANT ALL PRIVILEGES ON ihris_manage.* TO ihris_manage@localhost identified by 'PASS';

where you substitute PASS with something appropriate. If you want to install iHRIS Qualify (or iHRIS Plan) just replace everywhere you see manage with qualify (or plan).

In version 4.0.1 of iHRIS we create mysql functions. If you are having trouble creating routines see this.

On Fedora systems, you'll also need to execute these commands to ensure database connectivity functions correctly:

ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock

Downloading the Software

To download the software you enter these commands:

cd /var/lib
mkdir iHRIS
cd /var/lib/iHRIS
mkdir 4.1.5
ln -s 4.1.5 4.1
ln -s 4.1 current
cd /var/lib/iHRIS/4.1
wget http://launchpad.net/ihris-manage/4.1/4.1.5/+download/ihris-manage-full-4_1_5.tar.bz2
tar -xjf ihris-manage-full-4_1_5.tar.bz2

Creating a Site Configuration File

We are going to start by modifying the BLANK site for iHRIS Manage. If you wish to install iHRIS Qualify or iHRIS Plan, you can follow the same instructions below but change manage to qualify or plan. To copy the BLANK site:

cd /var/lib/iHRIS/
mkdir sites
cp -R /var/lib/iHRIS/current/ihris-manage/sites/blank /var/lib/iHRIS/sites/manage
mv /var/lib/iHRIS/sites/manage/iHRIS-Manage-BLANK.xml  /var/lib/iHRIS/sites/manage/iHRIS-Manage-Site.xml

We now need to edit the site configuration file:

vim /var/lib/iHRIS/sites/manage/iHRIS-Manage-Site.xml

by changing:

    <path name='modules'>
      <value>./modules</value>
      <!-- If this site module is not installed under the iHRIS Manage
           file structure, then remember to include a path to the rest of
           the modules here. 
           e.g. <value>..</value>
        -->
    </path>

to:

   <path name='modules'>
      <value>./modules</value>
      <value>/var/lib/iHRIS/current</value>
    </path>

You may choose to change the email address feedback is sent to by changing:

      <configuration name='email' path='to' values='single'>
      <displayName>Email Address</displayName>
        <value>BLANK</value>
      </configuration>

to:

      <configuration name='email' path='to' values='single'>
      <displayName>Email Address</displayName>
        <value>my_email@somewhere.com</value>
      </configuration>

You may also choose to change BLANK everywhere with your organization's name. For best results, please choose one word, possilby with a dash, such as Sample, MOH, or MOH-Taifeki. To make this change, hit the replace icon, fill in blank under Search for and MOH-Taifeki under Replace With, then hit replace all.

Making the Site Available

We will now edit the configuration to let the site know about the database user and options:

vim /var/lib/iHRIS/sites/manage/pages/config.values.php

We now need to uncomment and set the value of a few variables. They are:

Variable Name Value
$i2ce_site_i2ce_path /var/lib/iHRIS/current/I2CE
$i2ce_site_database ihris_manage
$i2ce_site_database_user ihris_manage
$i2ce_site_database_password YYYYY (the password you set above)
$i2ce_site_module_config /var/lib/iHRIS/sites/manage/iHRIS-Manage-Site.xml

Save and quit.

Finally, we make iHRIS Manage site we just created available via the webserver:

ln -s /var/lib/iHRIS/sites/manage/pages /var/www/html/manage
cp /var/www/html/manage/htaccess.TEMPLATE /var/www/html/manage/.htaccess
vim  /var/www/html/manage/.htaccess

We need to look for the line RewriteBase and change it to the web directory we want to use we are using, /manage. You may now save and quit. You will see we are using the apache rewrite module. To enable the module:

a2enmod rewrite

Now we need to make sure we can use the .htaccess file.

vim /etc/httpd/conf/httpd.conf

Change:

        <Directory /var/www/html/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
        </Directory>

to:

        <Directory /var/www/html>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
        </Directory>

Save and quit.

Finishing up

Let us restart the Apache webserver using:

/etc/init.d/httpd restart 

Now we are ready to begin the site installation. Simply browse to:

http://localhost/manage

and wait for the site to initalize itself. Congratulations! You may log in as the administrator with the default password administator.


Files

Here are samples of the files we edited above: