Linux (Ubuntu) Installation - Supporting Software - Old
From IHRIS Wiki
Here are instructions for installing the supporting software for iHRIS on a Linux (Ubuntu) system. If you need help installing Ubuntu you may want to take a look at these directions for installing a Server or a Desktop system. For a server setup, we recommend using a LTS (long term support) version of Ubuntu.
Note: Unless specifically mentioned, all the commands below are run using a terminal. You can start this in Ubuntu by going to Applications -> Accessories -> Terminal. Any time a command begins with sudo it will prompt for your password because this will be run with administrative privileges. When you run sudo multiple times, only the first time will ask for your password.
Note: Some installation commands will prompt for inputs in the terminal window, usually with a blue background. The mouse doesn't work to click on options here. You can use Tab to move between options and the space bar to check or uncheck selections.
Note: Some commands will launch the gedit file editor. Look at the documentation if you need additional help.
We begin by install a Lamp server (You can find more help here): <source lang="bash"> sudo tasksel install lamp-server </source> 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.
Important: Make sure your email system is correctly configured. Under a default Ubuntu installation, you can do this with one of two commands: <source lang="bash"> sudo apt-get install postfix sudo dpkg-reconfigure postfix </source>
Follow the on-screen instructions to set up email on your system. For additional help with installing Postfix, look at these instructions. On Debian systems, the same commands can be used, but exim4 is the default MTA instead of postfix
If you are using another Linux distribution, make sure your system can send email properly before continuing.
Make sure you have in /etc/mysql/my.cnf the following values set: <source lang="bash"> sudo gedit /etc/mysql/my.cnf </source> <source lang="ini"> query_cache_limit = 4M query_cache_size = 64M </source> It appears that they were reduced with Karmic.
To configure MySQL so iHRIS can create needed functions: <source lang="bash"> mysql -u root -p </source> Enter the password you set above (XXXXX) for MySQL. You will now be able to send commands to MySQL and the prompt should always begin with 'mysql> '. Type these commands: <source lang="mysql"> SET GLOBAL log_bin_trust_function_creators = 1; exit </source>
Next, you'll need to increase the memory limit for PHP. You can do this by editing the /etc/php5/apache2/php.ini. <source lang="bash"> sudo gedit /etc/php5/apache2/php.ini </source>
Change the following line: <source lang="ini"> memory_limit = 32M </source> to: <source lang="ini"> memory_limit = 128M </source>
Installing Pear and PECL Packages
We need to install a few Pear and PECL packages for PHP. For the Pear packages you can do: <source lang="bash"> sudo apt-get install php-pear php-mdb2 php-mdb2-driver-mysql sudo pear install text_password console_getopt </source>
We need to install the APC module for PHP.
|APC in Oneiric (11.10) and Later||APC in Natty (11.04)|
|In Oneiric the default version works correctly.
<source lang='bash'> sudo apt-get install php-apc </source>
|In Natty, the default version is not behaving well.
<source lang='bash'> sudo add-apt-repository ppa:chris-lea/php-pecl-extras sudo apt-get update sudo apt-get install php-apc </source>
|APC in Ubuntu Lucid (10.04) and Meerkat (10.10)||APC in Earlier Versions of Ubuntu|
|In Lucid and Meerkat, the default version is not behaving well.
<source lang='bash'> sudo add-apt-repository ppa:chris-lea/php-pecl-extras sudo apt-get update sudo apt-get install php5-apc </source>
sudo apt-get install php-apc </source>
APC all version of Ubuntu
During certain activities like installation and upgrades you may need more memory than APC uses by default. We also want to turn of the slam defense. We need to edit the configuration file file for apc: <source lang="bash"> sudo gedit /etc/php5/conf.d/apc.ini </source> It should look like this: <source lang="ini"> extension=apc.so apc.write_lock=1 apc.shm_size=100M apc.slam_defense=0 </source> See slam defense and this.
You'll need to restart Apache after making this change. <source lang="bash"> sudo /etc/init.d/apache2 restart </source>
Tidy and GD
There are two optional packages you may wish to install: <source lang="bash"> sudo apt-get install php5-gd php5-tidy </source> which are used to for inserting images into PDF output of reports and for exporting XML files in a nicely formatted manner
FileInfo (for Ubuntu versions prior to 10.4)
Note: If you're running Ubuntu 10.4 (Lucid Lynx) or later then you do not need to install Fileinfo and should skip this step.
The pecl package FileInfo is used to verify the validity of file types used for uploading (e.g. for uploaded images or documents) <source lang="bash"> cd /tmp wget http://pecl.php.net/get/Fileinfo sudo pecl install Fileinfo* echo extension=fileinfo.so | sudo tee /etc/php5/apache2/conf.d/fileinfo.ini </source>
Configuring Apache Web Server
You will see later we are using the apache rewrite module. To enable the module: <source lang="bash"> sudo a2enmod rewrite </source> Now we need to make sure we can use the .htaccess file. <source lang="bash"> sudo gedit /etc/apache2/sites-available/default </source> Change: <source lang="apache"> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </source> to: <source lang="apache"> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </source> Save and quit.
Let us restart the Apache webserver using: <source lang="bash"> sudo /etc/init.d/apache2 restart </source>