[原创实践]RedHat Enterprise Linux 5 安装GCC和redis
Redis的安装需要使用GCC,Red Hat Enterprise 5默认是不安装gcc的,需要自己手动安装。
1:查看系统中是否有gcc
gcc -v
查看本机linux版本
lsb_release -a
LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Release: 5.3
Codename: Tikanga
2:安装gcc
cd /media/RHEL_5.3 x86_64 DVD/Server/
(1)安装kernel-headers-2.6.18-128.el5.x86_64.rpm
rpm -ivh ./kernel-headers-2.6.18-128.el5.x86_64.rpm
(2)安装
rpm -ivh ./glibc-headers-2.5-34.x86_64.rpm
(3)安装
rpm -ivh ./glibc-devel-2.5-34.x86_64.rpm
(4)安装
rpm -ivh ./libgomp-4.3.2-7.el5.x86_64.rpm
(5)安装
rpm -ivh ./gcc-4.1.2-44.el5.x86_64.rpm
(6)安装
rpm -ivh ./libstdc++-devel-4.1.2-44.el5.x86_64.rpm
(7)安装
rpm -ivh ./gcc-c++-4.1.2-44.el5.x86_64.rpm
安装完成后查看版本
gcc -v
使用内建 specs。
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-44)
3:安装redis
tar -zxvf redis-2.8.8.tar.gz -C /opt/app/appcode/TravelHub/
cd /opt/app/appcode/TravelHub/redis-2.8.8/
执行make
4:编写启动脚本start.sh上传到/opt/app/appcode/TravelHub/redis-2.8.8/目录下
#/bin/bash
NOHUP="/opt/app/appcode/TravelHub/redis-2.8.8/"
nohup /opt/app/appcode/TravelHub/redis-2.8.8/src/redis-server > $NOHUP/redis.out 2>&1 &
echo Redis-server2.8.8 is running.Start success!
启动redis
sh ./start.sh