参考:http://54im.com/tag/libmcrypt

http://www.educity.cn/linux/1240338.html

  1. 设置防火墙,并开启3306 80端口:vi /etc/sysconfig/iptables && service iptables stop && service iptables start
  2. yum清缓存并更新:yum clean all && yum update
  3. 下载安装编译工具和依赖包 :
    yum -y install cmake gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* wget pcre-devel zlib-devel gd-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel bison automake zlib* libxml* ncurses-devel libtool-ltdl-devel* unzip
  4. 下载安装包
    1. 创建存放源码的目录

      mkdir /opt/src && cd /opt/src
    2. wget下载程序源码
      wget http://nginx.org/download/nginx-1.7.8.tar.gz #最新
      wget http://cn2.php.net/distributions/php-5.4.36.tar.gz
      wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6

      wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F&ts=1418528625&use_mirror=tcpdiag

      wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
      wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash%2F0.9.9.9%2F&ts=1418530194&use_mirror=hivelocity

      wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt%2F2.6.8%2F&ts=1418531968&use_mirror=softlayer-dal

      wget http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gzwget http://www.cmake.org/files/v3.1/cmake-3.1.0.tar.gz
      wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?modtime=1175740843&big_mirror=0"
      wget https://github.com/eaccelerator/eaccelerator/archive/master.zip -O eaccelerator.zip
      #更名
      mv libmcrypt-2.5.8.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F libmcrypt-2.5.8.tar.gz
      
      
    3. 重命名压缩包
      mv libmcrypt-2.5..tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F libmcrypt-2.5..tar.gz
      mv mcrypt-2.6..tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt%2F2.6.8%2F mcrypt-2.6..tar.gz
      mv mhash-0.9.9.9.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash%2F0.9.9.%2F mhash-0.9.9.9.tar.gz
      mv eaccelerator-0.9.6.1.tar.bz2\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Feaccelerator%2Ffiles%2Feaccelerator%2FeAccelerator%200.9.6.1%2F eaccelerator-0.9.6.1.tar.bz2
    4. 安装libiconv、libmcrypt、libltdl、mhash、mcrypt
       tar zxvf mhash-0.9.9.9.tar.gz && cd mhash-0.9.9.9
      ./configure && make && make install
      ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
      ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
      ln -s /usr/local/lib/libmcrypt.so. /usr/lib/libmcrypt.so.
      ln -s /usr/local/lib/libmcrypt.so.4.4. /usr/lib/libmcrypt.so.4.4.
      ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
      ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
      ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
      ln -s /usr/local/lib/libmhash.so. /usr/lib/libmhash.so.
      ln -s /usr/local/lib/libmhash.so.2.0. /usr/lib/libmhash.so.2.0.
      ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
       tar zxvf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8
      ./configure && make && make install
      /sbin/ldconfig
      cd libltdl/
      ./configure -enable-ltdl-install
      make && make install
       tar zxvf libiconv-1.14.tar.gz && cd libiconv-1.14
      ./configure --prefix=/opt
      make && make install
    5. tar zxvf mcrypt-2.6..tar.gz && cd mcrypt-2.6.
      /sbin/ldconfig && ./configure && make && make install
    6. 安装cmake
      tar zxvf cmake-3.1..tar.gz && cd cmake-3.1.  && ./configure --prefix=/usr && gmake && gmake install
    7. 安装bison
       tar zxvf bison-3.0.tar.gz && cd bison-3.0
      ./configure && make && make install
    8. 准备用户、目录
      groupadd mysql
      useradd -g mysql mysql
      groupadd www
      useradd -g www www
      mkdir -p /data/mysql
      chown -R mysql:mysql /data/mysql
      mkdir -p /data/www
      chown -R www:www /data/www
    9. 安装mysql
      1. 编译:

        tar zxvf mysql-5.6..tar.gz && cd mysql-5.6.
        cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql -DMYSQL_DATADIR=/data/mysql -DWITH_INNOBASE_STORAGE_ENGINE= -DWITH_MEMORY_STORAGE_ENGINE= -DWITH_MYISAM_STORAGE_ENGINE= -DSYSCONFDIR=/etc/ -DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=on
        make && make install && ln -s /opt/mysql/lib/lib* /usr/lib/
      2. 配置:

        /opt/mysql/scripts/mysql_install_db --basedir=/opt/mysql/ --datadir=/data/mysql --user=mysql
        cd /opt/mysql/support-files
        cp my-default.cnf /etc/my.cnf
      3. 初始化并自启动

        #初始化
        cp /opt/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld
        chkconfig --add mysqld
        chkconfig mysqld on
        #启动mysql
        /etc/rc.d/init.d/mysqld start
        #设置mysql登录密码
        cd /opt/mysql && bin/mysql_secure_installation
    10. 安装php
      1. 编译:

        tar zxvf php-5.4..tar.gz && cd php-5.4.
        ./configure --prefix=/opt/php --with-mysql=/opt/mysql --with-mysqli=/opt/mysql/bin/mysql_config --with-iconv-dir=/opt/src/libiconv-1.14 --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap && make && make install
      2. 或者:./configure --prefix=/usr/local/php  --enable-fpm --with-iconv=/usr/local/bin/libiconv \--with-mcrypt=/usr/local/bin/libmcrypt \--enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath \--enable-inline-optimization --with-bz2  --with-zlib --enable-sockets \--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \--with-gd --with-jpeg-dir
      3. 配置php.ini
        cp php.ini-development /usr/local/php/etc/php.ini 

        安装扩展

        #安装
        unzip eaccelerator.zip && cd eaccelerator-master
        ./configure --enable-eaccelerator=shared --with-php-config=/opt/php/bin/php-config
        make && make install #配置
        zend_extension="/opt/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so"#检查是否存在
        eaccelerator.shm_size=""
        eaccelerator.cache_dir="/tmp/eaccelerator"
        eaccelerator.enable=""
        eaccelerator.optimizer=""
        eaccelerator.check_mtime=""
        eaccelerator.debug=""
        eaccelerator.log_file = "/opt/php/var/log/eaccelerator_log"
        eaccelerator.filter=""
        eaccelerator.shm_max=""
        eaccelerator.shm_ttl=""
        eaccelerator.shm_prune_period=""
        eaccelerator.shm_only=""
        eaccelerator.compress=""
        eaccelerator.compress_level="" #创建目录
        mkdir -p /tmp/eaccelerator
      4. 配置php-fpm

        cp /opt/php/etc/php-fpm.conf.default /opt/php/etc/php-fpm.conf
        vi /opt/php/etc/php-fpm.conf
        #几处修改,user/group要设好,其它选项可以自己调整
        [global]
        pid = run/php-fpm.pid
        error_log = log/php-fpm.log
        emergency_restart_threshold =
        emergency_restart_interval = 1m
        process_control_timeout = 5s
        [www]
        user = www
        group = www

        更改php.ini 设置时区

        vi etc/php.ini
        date.timezone = PRC
    11. 安装nginx
      1. 安装PCRE

        wget http://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F&ts=1418696677&use_mirror=iwebhttp://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F&ts=1418696677&use_mirror=iweb -O pcre-8.36.tar.gz
        mv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.%2F pcre-8.36.tar.gz
        tar zxvf pcre-8.36.tar.gz && cd pcre-8.36
        ./configure make && make install
      2. 安装nginx
        tar zxvf nginx-1.7..tar.gz && cd nginx-1.7.
        ./configure --user=www --group=www --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module
        make && make install
      3. 配置nginx
        1. vim /usr/local/nginx/conf/nginx.conf

          user www www;
          worker_processes ; error_log logs/error.log;
          #error_log logs/error.log notice;
          #error_log logs/error.log info; pid logs/nginx.pid; events {
          use epoll;
          worker_connections ;
          } http {
          include mime.types;
          default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
          # '$status $body_bytes_sent "$http_referer" '
          # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
          tcp_nopush on; #keepalive_timeout ;
          keepalive_timeout ; gzip on;
          gzip_min_length 1k;
          gzip_buffers 16k;
          gzip_comp_level ;
          gzip_types text/plain application/x-javascript text/css application/xml;
          server {
          listen ;
          server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
          root /data/www;
          index index.html index.htm index.php;
          } error_page /.html; # redirect server error pages to the static page /50x.html
          #
          error_page /50x.html;
          location = /50x.html {
          root html;
          } # proxy the PHP scripts to Apache listening on 127.0.0.1:
          #
          #location ~ \.php$ {
          # proxy_pass http://127.0.0.1;
          #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
          #
          location ~ \.php$ {
          root html;
          fastcgi_pass 127.0.0.1:;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;
          include fastcgi_params;
          } # deny access to .htaccess files, if Apache's document root
          # concurs with nginx's one
          #
          #location ~ /\.ht {
          # deny all;
          #}
          }

          启动nginx和php-fpm

          /opt/nginx/sbin/nginx
          /opt/php/sbin/php-fpm
jdhu 标记: 京东胡博客

CentOS6.5 编译安装lnmp环境的更多相关文章

  1. CentOS编译安装LNMP环境

    这里是教大家如何在centos下利用源码编译安装LNMP环境. 工具/原料 centos服务器一台 自用电脑一台 准备篇 配置好IP.DNS .网关,确保使用远程连接工具能够连接服务器 配置防火墙,开 ...

  2. Centos 6.8编译安装LNMP环境

    Centos 6.8编译安装LNMP环境 参考资料: http://www.jb51.net/article/107429.htm https://phperzh.com/articles/1360 ...

  3. SaltStack之编译安装LNMP环境

    使用saltstack编译安装LNMP环境 一,系统版本查看 二,安装salt-master和salt-minion 安装配置过程参考SaltStack概述及安装 三,修改配置文件 /etc/salt ...

  4. centos6源码编译安装lnmp环境

    操作系统 版本 64位 CentOS-6.6    10.0.0.20 安装环境所需依赖包 yum -y install gcc automake autoconf libtool make gcc- ...

  5. centos6.6编译安装lnmp系列之mysql

    简介: 环境:虚拟机+centos6.6 Mysql版本:5.6.21 Mysql下载地址:http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.21.t ...

  6. 源码编译安装lnmp环境(nginx-1.14.2 + mysql-5.6.43 + php-5.6.30 )------踩了无数坑,重装了十几次服务器才会的,不容易啊!

    和LAMP不同的是,LNMP中的N指的是Nginx(类似于Apache的一种web服务软件),并且php是作为一个独立服务存在的,这个服务叫做php-fpm,Nginx直接处理静态请求,动态请求会转发 ...

  7. CentOS6.8 编译安装LNMP

    思路:根据Linux系统以及公司网站系统的信息,选择合适的安装包进行安装 一.查看系统信息 # uname -a # 查看内核/操作系统/CPU信息 # /etc/issue # 查看操作系统版本 # ...

  8. CentOS 6.5 编译安装 LNMP环境

    建立一个软件包目录存放 mkdir -p /usr/local/src/ 清理已经安装包 rpm -e httpd rpm -e mysql rpm -e php yum -y remove http ...

  9. 源码编译安装lnmp环境

    一.源码编译安装步骤 首先说明源码安装的好处   速度快,可自定义路径 主要有三步:1.配置 进入源码安装包  ./configure --prefix=/uer/local/nginx  可指定参数 ...

随机推荐

  1. Compress、tar、gzip、zcat、bzip2、bzcat、打包解压命令行

    讲解内容: Linux环境中,压缩文件案的扩展名大多是*.tar,*.tar.gz,*.tgz,*.gz,*.Z,*.bz2. *.z             compress程序亚索的文件: *.g ...

  2. 报错:Cannot insert explicit value for identity column in table 't' when identity_insert is set to OFF

    通常情况下,不能向 SQL Server 自增字段插入值,如果非要这么干的话,SQL Server 就会好不客气地给你个错误警告: Server: Msg 544, Level 16, State 1 ...

  3. hdoj 2035 人见人爱A^B

    人见人爱A^B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

  4. DirectShow Filter 开发典型例子分析 ——字幕叠加 (FilterTitleOverlay)1

    本文分析一下<DirectShow开发指南>中的一个典型的Transform Filter的例子:字幕叠加(FilterTitleOverlay).通过分析该例子,我们可以学习到Direc ...

  5. ffmpeg的logo, delogo滤镜参数设置

    FFmpeg的添加logo,去logo滤镜的组合共有三种方式: 1. 只有添加logo滤镜 $ ./ffmpeg -i INPUT.FLV  \ -vf movie=/opt/logo.png[log ...

  6. [置顶] sqlplus 使用笔记

    关于sqlplus常用命令的一些记录 这两天去参加了一个关于orcale 12C release1的技术交流会,主要关注的是orcale Spatial 在12C上面的一些新的变化,一起交流的有学校的 ...

  7. 【HDU 2014 Multi-University Training Contest 1 1002】/【HDU 4862】Jump

    多校训练就这么华丽丽的到了 ,于是乎各种华丽丽的被虐也開始了. 这是多校的1002; 最小费用最大流. 题目大意: 有n*m个方格,每一个方格都一个的十进制一位的数.你能够操作K次. 对于每一次操作, ...

  8. careercup-链表 2.4

    2.4 编写代码,以给定值x为基准将链表分割成两部分,所有小于x的结点排在大于或等于x的结点之前. 思路:将小于的结点还是保存在原来的链表中,将大于等于x的结点加入一个新的链表,最后将这两个链表链接起 ...

  9. lambda与函数调用的转换

    14.38 编写一个类令其检查某个给定的string对象的长度是否与一个阈值相等.使用该对象编写程序,统计并报告在输入的文件中长度为1的单词有多少个,长度为2的单词有多少个.......长度为10的单 ...

  10. mysql 超时设置

      在Mysql的默认设置中,如果一个数据库连接超过8小时没有使用(闲置8小时,即   28800s),mysql server将主动断开这条连接,后续在该连接上进行的查询操作都将失败,将   出现: ...