源码安装redis

redis的编译安装很简单,步骤如下:

# wget http://redis.googlecode.com/files/redis-2.4.4.tar.gz

# tar -xzf redis-2.4.4.tar.gz

# cd redis-2.4.4

# make #先用make test

# make PREFIX=/usr/local/redis-2.4.4 install

cp redis.conf /usr/local/redis-2.4.4

至此,编译安装完毕。

 

启动服务:

# cd /usr/local/redis-2.4.4

修改配置文件,将其中的”daemonize no”行改为”daemonize yes”,让其在后台运行。

vim redis.conf

启动redis服务

# ./bin/redis-server redis.conf


报错: jemalloc/jemalloc.h: No such file or directory
原因是:jemalloc重载了Linux下的ANSI C的malloc和free函数。解决办法:make时添加参数。
make MALLOC=libc

remi源

现在安装remi源,会自动安装依赖源epel

1.

安装最新的 Remi 源自动安装文件*

# CentOS 6 / RHEL 6
yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# CentOS 7 / RHEL 7
yum install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

2.官网:http://rpms.famillecollet.com/
3.安装指定源的软件 :yum install XXX –enablerepo=YYY

nginx源码安装

1:首先安装Nginx所需要的库a.GCC编译器
yum install -y gcc
b.G++编译器:C++来编译Nginx的http模块
yum install -y gcc-c++
c.PCRE库:正则表达式
yum install -y pcre pcre-devel
d.zlib库
对HTTP包的内容作gzip压缩
yum install -y zlib zlib-devel
e.OpenSSL开发库
如果服务器要支持在SSL协议上传输HTTP就需要OpenSSL
yum install -y openssl openssl-devel

  1. ./configure –prefix=/usr/local/nginx –http-proxy-temp-path=/var/cache/nginx/proxy_temp –http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp –http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp –http-scgi-temp-path=/var/cache/nginx/scgi_temp –user=nginx –group=nginx –with-http_ssl_module –with-http_realip_module –with-http_addition_module –with-http_sub_module –with-http_dav_module –with-http_flv_module –with-http_mp4_module –with-http_gunzip_module –with-http_gzip_static_module –with-http_random_index_module –with-http_secure_link_module –with-http_stub_status_module –with-http_auth_request_module –with-mail –with-mail_ssl_module –with-file-aio –with-ipv6 –with-http_spdy_module –with-cc-opt=’-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic’

3.make

4.make install

错误:

1./configure: error: the HTTP rewrite module requires the PCRE library.

安装pcre-devel

2../configure: error: the HTTP gzip module requires the zlib library.

安装zlib-devel


1.安装原则是系统环境使用yum安装,软件使用源码安装,方便许多
2.解压目录与安装目录不用放在同一个地方,否则目录会很乱:如解压时在/root/nginx-1.8.1,安装时指定–prefix=/usr/local/nginx


已安装好的nginx中加入模块:http://www.cnblogs.com/lixigang/articles/5130052.html

淘宝开源软件:tengine,在nginx源码上修改,完全兼容nginx