Howto install memcached, setup firewall and php API? Print E-mail
Written by Administrator   
Friday, 25 May 2007

1. At first we need libevent library

 wget http://www.monkey.org/~provos/libevent-1.3b.tar.gz
tar -xzvf libevent-1.3b.tar.gz
cd libevent-1.3b
./configure && make && make install
 

 2. Install Memcached

 wget http://www.danga.com/memcached/dist/memcached-1.2.1.tar.gz
tar -xzvf memcached-1.2.1.tar.gz
cd memcached-1.2.1
./configure && make && make install
useradd memcached

3. Run memcached 

! Replace 10.0.0.40 wit your ip address  and 2048 with memory in KB witch you want to alocate with memcached (max. 2048)

In our example we have 4GB of free ram, so we runs 2x memcached with 2GB of RAM on port 11211 and 11212 

 ./memcached -d -m 2048 -l 10.0.0.40 -p 11211 

 ./memcached -d -m 2048 -l 10.0.0.40 -p 11212

4. Setup firewall

! Replace 10.0.0.0/255.255.255.0 with your net, where you can allow to use the memcached and eth1 with name of your interface 

iptables -A INPUT -s ! 10.0.0.0/255.255.255.0 -i eth1 -p tcp -m multiport --dports \ 11211,11212 -j DROP
iptables -A INPUT -s ! 10.0.0.0/255.255.255.0 -i eth1 -p udp -m multiport --dports \ 11211,11212 -j DROP

5. Install memcache phpapi 

!Replace /usr/local/php with path, where you have php 

 wget http://pecl.php.net/get/memcache-2.1.2.tgz
tar -xzvf memcache-2.1.2.tgz
cd memcache-2.1.2
export PHP_PREFIX="/usr/local/php"
$PHP_PREFIX/bin/phpize
./configure --with-php-config=$PHP_PREFIX/bin/php-config
make && make install

Edit php.ini and add - extension="memcache.so"

That´s all. Restart apache (apachectl restart) and you will have memcache support in PHP.

 See also php memcache documentation  


Add as favourites (118) | Quote this article on your site | Views: 1387

Comments (2)
RSS comments
1. 26-01-2008 12:18
wery good site
Written by This e-mail address is being protected from spam bots, you need JavaScript enabled to view it (Guest)
2. 08-05-2008 09:38
Thanks! :)
Written by Jupp (Guest)

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Personal verbal attacks will be deleted.
  • Please don't use comments to plug your web site. Such material will be removed.
  • Just ensure to *Refresh* your browser for a new security code to be displayed prior to clicking on the 'Send' button.
  • Keep in mind that the above process only applies if you simply entered the wrong security code.
Name:
E-mail
Homepage
Title:
BBCode:Web AddressEmail AddressLoad Image from WebBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:



Code:* Code
I wish to be contacted by email regarding additional comments

Powered by AkoComment Tweaked Special Edition v.1.4.5

 
< Prev   Next >
Main Menu
Home
Our Services
Contact Us
Search
News Feeds
Our offers
Linux Tutorials
Affiliate program
Links
Slick RSS
GetAFreelancer.com New Projects
Latest projects published at GetAFreelancer.com
ScriptLance Projects
The newest projects posted on ScriptLance.
Google AdSense
Last comments
Howto install memcached, setup...
Thanks! :)
08/05/08 09:38 More...
By Jupp

Howto install memcached, setup...
wery good site
26/01/08 12:18 More...
By u26stycznia2008

Script installation Services
Comment 13 2008
Helo1l, great site!
13/10/07 10:10 More...
By John 200809

Visitors Counter
68037 Visitors
Joomla Template by Joomlashack
components joomla modules Joomla Templates Joomla tutorials