参考: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. weekend110(Hadoop)的 第四天笔记

    (2015年1月18日) 课程目录 01-复习 02-hadoop中的序列化机制 03-流量求和mr程序开发 04-hadoop的自定义排序实现 05-mr程序中自定义分组的实现 06-shuffle ...

  2. Oracle学习.Windows 命令行 启动ORACLE服务与实例

    使用数据库前要先打开数据库的实例和监听器! --总结启动命令如下: lsnrctl  [start|stop|status]                  --启动监听器,停止监听器,查看监听器的 ...

  3. 如何把select出来的一列数据放在第一个单元格

    有如下表: STORE_ID |  CUSTOMER_ID S001       |      C001 S001       |      C002 能不能把上表SELECT出来变成下面这种形式: ...

  4. 用tsung测试openfire 服务器性能

    最近公司需要做一个有聊天功能的应用,客户讲的是很宏大,用户超多,以前搞过openfire,但没有深入的去了解,就想用它来搞,而且是用 java写的,想扩展也容易些,但在性能上一直担忧,想测试一下它的性 ...

  5. OpenJDK和Sun/OracleJDK 区别 与联系

    首先要先明确之间,以及OpenJDK 6.OpenJDK 7.OpenJDK 7u和OpenJDK 8等项目之间是什么关系,这有助于确定接下来编译要使用的JDK版本和源码分支.从前面介绍的Java发展 ...

  6. 和菜鸟一起学linux内核源码之基础准备篇 系列 体系结构图

    http://blog.csdn.net/eastmoon502136/article/details/8711104

  7. dll注册到GAC还是bin - sharepoint程序

    通常来说程序在使用dll的时候,会先去GAC中查找是否有存在合适的dll,然后才会到应用程序下的bin目录去查找: 前几天遇到了一个奇葩问题,web项目工程添加了一个第三方dll的引用,然后把这个第三 ...

  8. System Operations on AWS - Lab 6W - Using Auto Scaling (Windows)

    创建你的一个web server,然后将这个实例制成你的AMI,通过启动配置生成一个Auto Scaling组(包括scale-in/scale-out策略),配置一台Load Balancer指向你 ...

  9. Java Post 数据请求和接收

    这两天在做http服务端请求操作,客户端post数据到服务端后,服务端通过request.getParameter()进行请求,无法读取到数据,搜索了一下发现是因为设置为text/plain模式才导致 ...

  10. datatables定义列宽自适应方法

    不同的分辨率以及浏览器自适应,列表不出现滚动条,表格内容自动换行. 方法:通过定义表格列属性,结合<table>CSS样式和定义的列单元格样式 'td_huanhang'/'td_unhu ...