HowTo: Install Memcached: Difference between revisions

From IHRIS Wiki
(Created page with 'With version 4.0.4 of iHRIS you can use memcahced to improve performance. ==Install Memcached== First install memcached by opening a terminal and typing: <source lang="bash"> su…')
 
No edit summary
 
(12 intermediate revisions by one other user not shown)
Line 1: Line 1:
With version 4.0.4 of iHRIS you can use memcahced to improve performance.
With version 4.0.4 of iHRIS you can use memcahced to improve performance  


==Install Memcached==
Note:  Memcached is used to cache data from the database.  Thus if you are an a sitaution
where you would need to restart the webserver by
sudo /etc/init.d/apache2 restart
you should now do
sudo /etc/init.d/apache2 restart && sudo /etc/init.d/memcached restart
 
==Installation on Intrepid==
'''Warning:'''This is only a rough guide as I did not take good notes.  Please correct.
===Install Memcached===
First install memcached by opening a terminal and typing:
<source lang="bash">
sudo apt-get install memcached
</source>
 
Then make sure that memcached is enabled.  Look at /etc/default/memcached and make sure that it is set to be enabled.  You can edit it by typing:
<source lang="bash">
sudo gedit /etc/default/memcached
</source>
 
Then make sure the content is:
<source lang="ini">
ENABLE_MEMCACHED=yes
</source>
 
If memcached wasn't enabled then after editing that file you'll need to restart it by typing:
<source lang="bash">
sudo /etc/init.d/memcached restart
</source>
 
===Install libmemcached2===
We first need to install libmemcached2 before we can install the PECL module.  It is not a part of the regular software distribution channels
If you are using 32-bit Ubuntu
cd /tmp
wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached2_0.31-1intrepid1_i386.deb
wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached-dev_0.31-1intrepid1_i386.deb
sudo dpkg -i  libmemcached2_0.31-1intrepid1_i386.deb libmemcached-dev_0.31-1intrepid1_i386.deb
 
If you are using 64-bit ubuntu
wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached2_0.31-1intrepid1_amd64.deb
wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached-dev_0.31-1intrepid1_amd64.deb
sudo dpkg -i libmemcached2_0.31-1intrepid1_amd64.deb libmemcached-dev_0.31-1intrepid1_amd64.deb
 
===Install PECL memcached===
Before we can install a PECL module, we need to install some stuff to compile the PECL modules development stuff
sudo apt-get install apache2-prefork-dev php5-dev
 
Now we can install the PECL memcached module.  The newer releases of pecl-memcached, 1.0.2 and greater, are not compatible with the libcached2  version 0.31 that we installed above.  I believe that version 1.0.1 works.  In which case you can do
cd /tmp
wget http://pecl.php.net/get/memcached-1.0.1.tgz
sudo pecl install memcached-1.0.1
 
If this doesn't work, try version 1.0.0 from [http://pecl.php.net/package/memcached here]
 
==Installation on Karmic==
 
===Install Memcached===
First install memcached by opening a terminal and typing:
First install memcached by opening a terminal and typing:
<source lang="bash">
<source lang="bash">
Line 22: Line 77:
</source>
</source>


==Install PHP Module==


Now we need to link memcached with PHP using the memcached PECL library.  First make sure the development packages are installed so PECL can compile memcached.  Type the following in a terminal:
===Install PECL memcached Module===
Next we need to link memcached with PHP using the memcached PECL library.  First make sure the development packages are installed so PECL can compile memcached.  Type the following in a terminal:
<source lang="bash">
<source lang="bash">
sudo apt-get install libmemcahed2 libmemcached-dev apache2-prefork-dev php5-dev
sudo apt-get install libmemcached2 libmemcached-dev apache2-prefork-dev php5-dev
</source>
</source>


Line 34: Line 89:
</source>
</source>


==Enable PHP Memcached==
 
 
Now enable the module by creating and editing a config file for PHP.
Now enable the module by creating and editing a config file for PHP.


Line 46: Line 102:
</source>
</source>


==Restart Apache==
===Restart Apache===
Now restart apache to enable the PHP memcached library by typing the following in a terminal:
Now restart apache to enable the PHP memcached library by typing the following in a terminal:


Line 52: Line 108:
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2 restart
</source>
</source>
==Installation on Lucid or Meerkat==
Simply do
sudo apt-get install php5-memcached memcached
[[Category:Installation]]

Latest revision as of 10:57, 18 July 2013

With version 4.0.4 of iHRIS you can use memcahced to improve performance

Note: Memcached is used to cache data from the database. Thus if you are an a sitaution where you would need to restart the webserver by

sudo /etc/init.d/apache2 restart

you should now do

sudo /etc/init.d/apache2 restart && sudo /etc/init.d/memcached restart

Installation on Intrepid

Warning:This is only a rough guide as I did not take good notes. Please correct.

Install Memcached

First install memcached by opening a terminal and typing: <source lang="bash"> sudo apt-get install memcached </source>

Then make sure that memcached is enabled. Look at /etc/default/memcached and make sure that it is set to be enabled. You can edit it by typing: <source lang="bash"> sudo gedit /etc/default/memcached </source>

Then make sure the content is: <source lang="ini"> ENABLE_MEMCACHED=yes </source>

If memcached wasn't enabled then after editing that file you'll need to restart it by typing: <source lang="bash"> sudo /etc/init.d/memcached restart </source>

Install libmemcached2

We first need to install libmemcached2 before we can install the PECL module. It is not a part of the regular software distribution channels If you are using 32-bit Ubuntu

cd /tmp
wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached2_0.31-1intrepid1_i386.deb 
wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached-dev_0.31-1intrepid1_i386.deb 
sudo dpkg -i  libmemcached2_0.31-1intrepid1_i386.deb libmemcached-dev_0.31-1intrepid1_i386.deb 

If you are using 64-bit ubuntu

wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached2_0.31-1intrepid1_amd64.deb 
wget http://ppa.launchpad.net/libmemcached/ubuntu/pool/main/libm/libmemcached/libmemcached-dev_0.31-1intrepid1_amd64.deb 
sudo dpkg -i libmemcached2_0.31-1intrepid1_amd64.deb libmemcached-dev_0.31-1intrepid1_amd64.deb

Install PECL memcached

Before we can install a PECL module, we need to install some stuff to compile the PECL modules development stuff

sudo apt-get install apache2-prefork-dev php5-dev

Now we can install the PECL memcached module. The newer releases of pecl-memcached, 1.0.2 and greater, are not compatible with the libcached2 version 0.31 that we installed above. I believe that version 1.0.1 works. In which case you can do

cd /tmp
wget http://pecl.php.net/get/memcached-1.0.1.tgz
sudo pecl install memcached-1.0.1

If this doesn't work, try version 1.0.0 from here

Installation on Karmic

Install Memcached

First install memcached by opening a terminal and typing: <source lang="bash"> sudo apt-get install memcached </source>

Then make sure that memcached is enabled. Look at /etc/default/memcached and make sure that it is set to be enabled. You can edit it by typing: <source lang="bash"> sudo gedit /etc/default/memcached </source>

Then make sure the content is: <source lang="ini"> ENABLE_MEMCACHED=yes </source>

If memcached wasn't enabled then after editing that file you'll need to restart it by typing: <source lang="bash"> sudo /etc/init.d/memcached restart </source>


Install PECL memcached Module

Next we need to link memcached with PHP using the memcached PECL library. First make sure the development packages are installed so PECL can compile memcached. Type the following in a terminal: <source lang="bash"> sudo apt-get install libmemcached2 libmemcached-dev apache2-prefork-dev php5-dev </source>

Now install memcached by typing: <source lang="bash"> sudo pecl install memcached </source>


Now enable the module by creating and editing a config file for PHP.

<source lang="bash"> sudo gedit /etc/php5/conf.d/memcached.ini </source>

Save the following for that file: <source lang="ini"> extension=memcached.so </source>

Restart Apache

Now restart apache to enable the PHP memcached library by typing the following in a terminal:

<source lang="bash"> sudo /etc/init.d/apache2 restart </source>

Installation on Lucid or Meerkat

Simply do

sudo apt-get install php5-memcached memcached