• Home
    • Cool Knowledge base
    • Light Knowledge base
    • Help Desk
    • OnePage Documentation
  • Services
    • Main Services
    • PPC Services
    • SEO Services
    • SMM Services
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Forum
    • Forums
    • Forum Topics
    • Topic Details
    • Ask Question
  • Pages
  • Contact

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

VideoJS – multiple source demo

2022-03-08

Add custom field to Woocommerce tab

2022-03-07

Surror Product Tabs for WooCommerce

2022-03-07
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram Pinterest VKontakte
SEO & Website build tips SEO & Website build tips
  • Home
    • Cool Knowledge base
    • Light Knowledge base
    • Help Desk
    • OnePage Documentation
  • Services
    • Main Services
    • PPC Services
    • SEO Services
    • SMM Services
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Forum
    • Forums
    • Forum Topics
    • Topic Details
    • Ask Question
  • Pages
  • Contact
SEO & Website build tips SEO & Website build tips
Home»Uncategorized»centos 7 yum install memcached
Uncategorized

centos 7 yum install memcached

OxfordBy Oxford2020-05-26No Comments2 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter LinkedIn Pinterest Email

linux下配置使用memcache功能,比win下稍微复杂一点,主要包括:安装libevent函数库、安装memcached、配置php扩展。

一、安装libevent函数库
libevent各版本地址:http://libevent.org/old-releases.html
在此我安装当前最稳定版本:libevent-2.0.21
1.下载:#

wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
2.解压:

#tar -zxvf libevent-2.0.21-stable.tar.gz
3 配置及编译安装:

#cd ibevent-2.0.21-stable
#./configure --prefix=/usr/local/libevent-2.0.21-stable 
#make
#make install
(我安装到了/usr/local/libevent-2.0.21-stable/下)

4.检查是否安装成功:

#ls -al /usr/local/libevent-2.0.21-stable/lib | grep libevent

这里写图片描述

二、安装memcached

memcached各版本下载地址:https://github.com/memcached/memcached/wiki/ReleaseNotes
在此我安装当前最稳定版本: memcache-1.5.9
1.下载:#wget http://memcached.org/files/memcached-1.5.9.tar.gz
2.解压:#tar -zxvf memcached-1.5.9.tar.gz
3. 配置及编译安装:

#cd memcached-1.4.32
#./configure -with-libevent=/usr/local/libevent-2.0.21-stable/ --prefix=/usr/local/memcached-1.5.9
#make
#make install

(同样安装到了/usr/local/memcached-1.5.9/下)
4.查看是否安装成功:
这里写图片描述

5.安装成功后启动一下看安装是否成功

# /usr/local/memcached-1.5.9/bin/memcached -d -m 1028 -p 11211 -u root

# ps -ef|grep memcached

 

6、配置开机自启动

# vim /etc/init.d/memcached

#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# config: /etc/sysconfig/memcached

# Source function library.
. /etc/rc.d/init.d/functions

PORT=11211
USER=nobody
MAXCONN=1024
CACHESIZE=64
OPTIONS=""

if [ -f /etc/sysconfig/memcached ];then
. /etc/sysconfig/memcached
fi

# Check that networking is up.
if [ "$NETWORKING" = "no" ]
then
exit 0
fi

RETVAL=0
prog="memcached"

start () {
echo -n $"Starting $prog: "
# insure that /var/run/memcached has proper permissions
chown $USER /usr/local/java/memcached-1.5.9
daemon /usr/local/java/memcached-1.5.9/bin/memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P /usr/local/java/memcached-1.5.9/memcached.pid $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
}
stop () {
echo -n $"Stopping $prog: "
killproc memcached
RETVAL=$?
echo
if [ $RETVAL -eq 0 ] ; then
rm -f /var/lock/subsys/memcached
rm -f /usr/local/java/memcached-1.5.9/memcached.pid
fi
}

restart () {
stop
start
}


# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status memcached
;;
restart|reload)
restart
;;
condrestart)
[ -f /usr/local/java/memcached-1.5.9 ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 1
esac

exit $?


并通过chmod命令赋予权限执行命令:

chmod 755 /etc/init.d/memcached

将memcached加入系统服务

执行命令:

# chkconfig --add memcached

# chkconfig memcached on

启动memcached服务

执行命令:

# service memcached start

通过命令 ps -ef|grep memcached 查看memcached服务是否启动成功,如果没有成功,检查脚本里的memcached目录是否正确,或者memcached是否安装完整。

reboot重启linux ,然后再用ps命令查看memcached是否自启动成功

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Avatar photo
Oxford

Related Posts

nginx multi sub domain proxy

2021-06-05

How TO – Position Text Over an Image

2021-05-24

bootstrapstudio.io

2021-03-25

how to get wordpress theme getmetrix and google speed insight 100 scores?

2021-03-12
Recent Posts
  • VideoJS – multiple source demo
  • Add custom field to Woocommerce tab
  • Surror Product Tabs for WooCommerce
  • How To Scrape Amazon at Scale With Python Scrapy, And Never Get Banned
  • Compile a Jekyll project without installing Jekyll or Ruby by using Docker
May 2020
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Apr   Jun »
Tags
app branding culture design digital Docly docs etc faq fashion featured fitness fix github Helpdesk Image issue leisure lifestyle magento Manual marketing memecached Photography picks planing seo sequrity tips Travel trending ui/ux web WordPress 爬虫
Editors Picks

Fujifilm’s 102-Megapixel Camera is the Size of a Typical DSLR

2021-01-05
Top Reviews
8.9

Which LED Lights for Nail Salon Safe? Comparison of Major Brands

By Oxford
8.9

Review: Xiaomi’s New Loudspeakers for Hi-fi and Home Cinema Systems

By Oxford
70

CES 2021 Highlights: 79 Top Photos, Products, and Much More

By Oxford
Advertisement
Demo
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
About Us
About Us

Your source for the lifestyle news. This demo is crafted specifically to exhibit the use of the theme as a lifestyle site. Visit our main page for more demos.

We're accepting new partnerships right now.

Email Us: [email protected]
Contact: +1-320-0123-451

Facebook Twitter Instagram Pinterest YouTube LinkedIn
Recent Posts
  • VideoJS – multiple source demo
  • Add custom field to Woocommerce tab
  • Surror Product Tabs for WooCommerce
  • How To Scrape Amazon at Scale With Python Scrapy, And Never Get Banned
  • Compile a Jekyll project without installing Jekyll or Ruby by using Docker
From Flickr
Ascend
terns
casual
riders on the storm
chairman
mood
monument
liquid cancer
blue
basement
ditch
stars
© 2025 Designed by 九号资源网.

Type above and press Enter to search. Press Esc to cancel.