-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild_memcached.sh
54 lines (43 loc) · 1.35 KB
/
build_memcached.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
########################################################################################
#
# Install Ejabberd Server
#
# Shawn Ma
#
########################################################################################
# Define
TARGET=memcached-1.4.15.tar.gz
SOURCE=http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
# Create a build directory
mkdir -p /opt/install/memcached && cd /opt/install/memcached
# Prepare for compilation source
curl -o $TARGET $SOURCE
mkdir -p tmp && tar -zxvf $TARGET -C tmp
# Install build dependencies
yum install -y gcc gcc-c++ make cmake autoconf automake
yum install -y libevent-devel
# Create a User Group
groupadd memcache
useradd -r -g memcache memcache
# Compile and deploy
mv tmp/* source && cd source
./configure \
--prefix=/opt/server/cache/memcached
make
make install
cd /opt/server/cache/memcached
mkdir -p conf var/run var/lock logs
curl -o conf/memcached.conf https://raw.github.com/fly2wind/TSShellScript/master/memcached/conf/memcached.conf
# Postinstallation setup
cd /opt/server/cache/memcached
chown -R memcache .
chgrp -R memcache .
chown -R root .
chown -R memcache var logs
# Configuration
curl -o /etc/init.d/memcached https://raw.github.com/fly2wind/TSShellScript/master/memcached/init/memcached
chmod a+x /etc/init.d/memcached
# Additional
chkconfig --add memcached
chkconfig memcached on