1. Compile and install libevent2. compile and install Memcached. When I write this article, libevent has 1.4.8 stable version and MemcachedServer has 1.3.0 version. This article takes the two versions as an example. My gcc is gccversion3.3.4 (Debian1: 3.3.4-7 ). First install libeventwgethttp: www.monkey.org
1. Compile and install libevent
2. Compile and install MeMcAchEd
When I wrote this article, libevent has a stable version of 1.4.8.
, Memcached Server already has version 1.3.0
. This article takes these two versions as an example. My gcc is gcc version 3.3.4 (Debian. 3.4-7 ).
First install libevent
Wget http://www.monkey.org /~ Provos/libevent-1.4.8-stable.tar.gz
Tar zxvf libevent-1.4.8-stable.tar.gz
CdLibevent-1.4.8-stable
./Configure-prefix =/usr specifies to install in/usr. At first, I did not specify the installation directory, causing libevent to be installed in/usr/local/lib. As a result, the libevent library cannot be found after Memcached is installed, even if the path is manually specified.
Make & make install
Make clean
Then install Memcached Server
Wget http://www.danga.com/memcached/dist/memcached-1.3.0.tar.gz
Tar zxvf memcached-1.3.0.tar.gz
Cd memcached-1.3.0/
./Configure -- with-libevent =/usr here you need to specify the libevent path
Make & make install
Make clean
Compilation and installation are complete in the twinkling of an eye.
Test whether Memcached is successfully installed:
/Usr/local/bin/memcached-d-m 10-u root-l 192.168.0.200-p 12000-c 256-P/tmp/memcached. pId
If no error message is displayed, it indicates that the Memcached service has been successfully installed and started.
Memcached basic description:
Startup parameters:
-D option is to start a daemon,
-M indicates the amount of memory allocated to Memcache. The unit is MB.
-U is the user who runs Memcache.
-L is the IP address of the listener server.
-P is the port used to set Memcache listening.
-The c option is the maximum number of concurrent connections. The default value is 1024.
-P is the pid file for saving Memcache.
Use the following statement to end the Memcached process:
Kill'Cat/Tmp/memcached. pid '......