CentOS 6.6 环境下 编译安装LNMP

环境:  
    OS:     CentOS 6.6
    IP: 172.16.66.100
    Nginx:  nginx-1.6.2
    PHP:     php-5.4.40
    Xcache: xcache-3.2.0
    Mysql:  mariadb-5.5.43

一、前期环境准备:

1、根据官方ISO 创建本地yum源
[[email protected] ~]# mkdir /mnt/cd
[[email protected] ~]# mount /dev/cdrom /mnt/cd
mount: block device /dev/sr0 is write-protected, mounting read-only
[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# vim cd.repo

[CD]
name=CentOS-$releasever - Base
baseurl=file:///mnt/cd
enable=1
gpgcheck=0

2、安装开发环境及必要的安装包

[[email protected] yum.repos.d]# yum -y groupinstall "Development tools" "Server Platform Development"
[[email protected] yum.repos.d]# yum -y install pcre-devel

二、安装Nginx
1、创建用户

[[email protected] ~]# groupadd -g 60 nginx
[[email protected] ~]# useradd -g 60 -u 60 -r -s /sbin/nologin nginx

2、创建编译安装时需要的目录
[[email protected] nginx-1.6.2]# mkdir -pv /var/tmp/nginx/{client,proxy,fastcgi,uwsgi,scgi}

3、编译安装nginx

[[email protected] tmp]# tar xf nginx-1.6.2.tar.gz 
[[email protected] tmp]# cd nginx-1.6.2
[[email protected] nginx-1.6.2]# ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --user=nginx --group=nginx --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi

4、为nginx提供SysV init脚本
[[email protected] nginx-1.6.2]# vim /etc/rc.d/init.d/nginx

#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig:   - 85 15 
# description:  Nginx is an HTTP(S) server, HTTP(S) reverse #               proxy and IMAP/POP3 proxy server
# processname: nginx
# config:      /etc/nginx/nginx.conf
# config:      /etc/sysconfig/nginx
# pidfile:     /var/run/nginx.pid
 
# Source function library.
. /etc/rc.d/init.d/functions
 
# Source networking configuration.
. /etc/sysconfig/network
 
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
 
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
 
NGINX_CONF_FILE="/etc/nginx/nginx.conf"
 
[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
 
lockfile=/var/lock/nginx.lock
 
make_dirs() {
   # make required directories
   user=`nginx -V 2>&1 | grep "configure arguments:" | sed ‘s/[^*]*--user=\([^ ]*\).*/\1/g‘ -`
   options=`$nginx -V 2>&1 | grep ‘configure arguments:‘`
   for opt in $options; do
       if [ `echo $opt | grep ‘.*-temp-path‘` ]; then
           value=`echo $opt | cut -d "=" -f 2`
           if [ ! -d "$value" ]; then
               # echo "creating" $value
               mkdir -p $value && chown -R $user $value
           fi
       fi
   done
}
 
start() {
    [ -x $nginx ] || exit 5
    [ -f $NGINX_CONF_FILE ] || exit 6
    make_dirs
    echo -n $"Starting $prog: "
    daemon $nginx -c $NGINX_CONF_FILE
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}
 
stop() {
    echo -n $"Stopping $prog: "
    killproc $prog -QUIT
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}
 
restart() {
    configtest || return $?
    stop
    sleep 1
    start
}
 
reload() {
    configtest || return $?
    echo -n $"Reloading $prog: "
    killproc $nginx -HUP
    RETVAL=$?
    echo
}
 
force_reload() {
    restart
}
 
configtest() {
  $nginx -t -c $NGINX_CONF_FILE
}
 
rh_status() {
    status $prog
}
 
rh_status_q() {
    rh_status >/dev/null 2>&1
}
 
case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart|configtest)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
            ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
        exit 2
esac

添加执行权限

[[email protected] nginx-1.6.2]# chmod +x /etc/rc.d/init.d/nginx

6、修改PATH环境变量,让系统可以直接使用nginx的相关命令

[[email protected] nginx-1.6.2]# echo "export PATH=/usr/local/nginx/sbin:$PATH" > /etc/profile.d/nginx.sh
重载文件
[[email protected] nginx-1.6.2]# .  /etc/profile.d/nginx.sh

7、添加至服务管理列表,并让其开机自动启动

[[email protected] nginx-1.6.2]# chkconfig --add nginx
[[email protected] nginx-1.6.2]# service nginx start

三、安装Mariadb

1、创建数据存放的文件系统--LVM

[[email protected] nginx-1.6.2]# fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to
         switch off the mode (command ‘c‘) and change display units to
         sectors (command ‘u‘).
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (7859-10443, default 7859): 
Using default value 7859
Last cylinder, +cylinders or +size{K,M,G} (7859-10443, default 10443): +6G
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 83
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

让内核识别分区表

[[email protected] nginx-1.6.2]# partx -a /dev/sda
[[email protected] nginx-1.6.2]# partx -a /dev/sda

创建LVM

[[email protected] nginx-1.6.2]# pvcreate /dev/sda3
[[email protected] nginx-1.6.2]# vgcreate myvg /dev/sda3
[[email protected] nginx-1.6.2]# lvcreate -L 4G -n mydata myvg
[[email protected] nginx-1.6.2]# mke2fs -t ext4 -L MYDATA /dev/myvg/mydata

2、编辑fstab文件自动挂载
[[email protected] nginx-1.6.2]# vim /etc/fstab

添加如下

----------------------
/dev/myvg/mydata    /data            ext4    defaults    0 0
或者 
LABEL=MYDATA         /data            ext4    defaults    0 0

---------------------------

[[email protected] nginx-1.6.2]# mkdir /data
[[email protected] nginx-1.6.2]# mount -a    //自动挂载
[[email protected] nginx-1.6.2]# mount
...
/dev/mapper/myvg-mydata on /data type ext4 (rw)
...

3、创建存放数据的目录,并创建系统mysql用户,以便安全运行进程

[[email protected] data]# mkdir /data/mydata
[[email protected] tmp]# groupadd -r mysql
[[email protected] tmp]# useradd -g mysql -r -s /sbin/nologin -M -d /data/mydata mysql
[[email protected] tmp]# chown -R mysql:mysql /data/mydata

4、安装并初始化mariadb-5.5.43

[[email protected] tmp]# tar xf mariadb-5.5.43-linux-x86_64.tar.gz -C /usr/local
[[email protected] tmp]# cd /usr/local
[[email protected] local]# ln -sv mariadb-5.5.43-linux-x86_64/ mysql
[[email protected] local]# cd mysql/
[[email protected] mysql]# chown -R mysql:mysql  .        //修改当前目录权限
[[email protected] mysql]# scripts/mysql_install_db --user=mysql --datadir=/data/mydata  //初始化数据

4、为mariadb-5.5.43 提供配置文件 

【MySQL的配置文件查找次序:/etc/my.cnf --> /etc/mysql/my.cnf --> ~/.my.cnf】
[[email protected] mysql]# mkdir /etc/mysql
[[email protected] mysql]# cp /usr/local/mysql/support-files/my-large.cnf /etc/mysql/my.cnf

并修改此文件中thread_concurrency的值为你的CPU个数乘以2 【其中cpu个数可以使用lscpu查看】
# vim /etc/mysql/my.cnf

thread_concurrency = 2
//并添加以下内容:
datadir = /data/mydata
innodb_file_per_table = on

5、为mariadb 提供sysv服务脚本

[[email protected] data]# cd /usr/local/mysql
[[email protected] mysql]# cp support-files/mysql.server  /etc/rc.d/init.d/mysqld

添加至服务列表

[[email protected] mysql]# chkconfig --add mysqld
[[email protected] mysql]# chkconfig mysqld on
[[email protected] mysql]#

而后就可以启动服务使用了。

为了使用mariadb的安装符合系统使用规范,这里还需要进行如下步骤:

6、输出mysql的man手册至man命令的查找路径:
编辑/etc/man.config,添加如下行即可:

MANPATH  /usr/local/mysql/man

7、输出mysql的头文件至系统头文件路径/usr/include:

这可以通过简单的创建链接实现:

[[email protected] mysql]# ln -sv /usr/local/mysql/include  /usr/include/mysql

8、输出mysql的库文件给系统库查找路径:

[[email protected] mysql]# echo ‘/usr/local/mysql/lib‘ > /etc/ld.so.conf.d/mysql.conf

然后让系统重新载入系统库:

[[email protected] mysql]# ldconfig

9、修改PATH环境变量,让系统可以直接使用mysql的相关命令

[[email protected] mysql]# echo "export PATH=/usr/local/mysql/bin:$PATH" > /etc/profile.d/mysql.sh
[[email protected] mysql]# . /etc/profile.d/mysql.sh

四、编译安装php-5.4.4

1、解决依赖关系并编译安装:
安装依赖程序包

[[email protected] php-5.4.40]# tar xf php-5.4.40.tar.bz2 
[[email protected] php-5.4.40]# cd php-5.4.40
[[email protected] php-5.4.40]# yum install bzip2 bzip2-devel -y
[[email protected] php-5.4.40]# yum install mhash mhash-devel mcrypt -y
[[email protected] php-5.4.40]# yum -y install libxml2 libxml2-devel
[[email protected] php-5.4.40]# yum -y install curl-devel
[[email protected] php-5.4.40]# yum install libmcrypt libmcrypt-devel -y

编译安装

[[email protected] php-5.4.40]# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --enable-fpm --enable-sockets --enable-sysvshm  --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-libxml-dir=/usr --enable-xml  --with-mhash --with-mcrypt  --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --with-curl 
[[email protected] php-5.4.40]# make && make install

2、为php提供配置文件

[[email protected] php-5.4.40]# cp php.ini-production /etc/php.ini

3、为php-fpm提供Sysv init脚本

[[email protected] php-5.4.40]# cp php.ini-production /etc/php.ini
[[email protected] php-5.4.40]# cp sapi/fpm/init.d.php-fpm  /etc/rc.d/init.d/php-fpm
[[email protected] php-5.4.40]# chmod +x /etc/rc.d/init.d/php-fpm

4、并将其添加至服务列表

[[email protected] php-5.4.40]# chkconfig --add php-fpm
[[email protected] php-5.4.40]# chkconfig php-fpm on

5、为php-fpm提供配置文件

[[email protected] php-5.4.40]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

6、编辑php-fpm的配置文件:
[[email protected] php-5.4.40]# vim /usr/local/php/etc/php-fpm.conf
配置fpm的相关选项为你所需要的值,并启用pid文件(如下最后一行):

pm.max_children = 150
pm.start_servers = 8
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pid = /usr/local/php/var/run/php-fpm.pid

7、现在就可以启动php-fpm了

[[email protected] php-5.4.40]# service php-fpm start

8、验证是否启动成功 (如果此命令输出有中几个php-fpm进程就说明启动成功了):

[[email protected] php-5.4.40]# ps aux | grep php-fpm
root     121717  0.0  0.4 253684  4308 ?        Ss   03:19   0:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)                                                                    
nobody   121800  0.7  2.2 259076 20700 ?        S    03:24   0:17 php-fpm: pool www                                                                                                            
nobody   121816  0.4  2.5 261892 23372 ?        S    03:28   0:08 php-fpm: pool www                                                                                                            
nobody   121817  0.3  2.2 259076 20700 ?        S    03:28   0:07 php-fpm: pool www

五、整合nginx和php5
1、编辑/etc/nginx/nginx.conf,启用如下选项:

location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include        fastcgi_params;
        }

2、编辑/etc/nginx/fastcgi_params,将其内容更改为如下内容:

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

并在所支持的主页面格式中添加php格式的主页,类似如下:

location / {
            root   html;
            index  index.php index.html index.htm;
        }

3、然后重新加载配置文件

[[email protected] php-5.4.40]# service nginx reload

4、接下来创建index.php页面,测试php是否能正常工作

[[email protected] nginx]# vim  /usr/local/nginx/html/index.php 
 <?php
 phpinfo();
 ?>

5、访问主页

能够正常访问,说明 nginx+ php  已经配置完成
    
6、在nginx中添加虚拟主机配置WordPress blog
编辑配置文件/etc/nginx/nginx.conf,添加如下内容:server {

        listen 80;
        server_name blog.1inux.com;
        access_log logs/blog.access;  //其日志目录为: /usr/local/nginx/logs/blog.access
        error_log logs/blog.error;
        location / {
                root /vhost/blog;
                index index.php index.html index.htm;
        }
        location ~ \.php$ {
            root           /vhost/blog;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
}

创建目录

# mkdir -pv /vhost/blog/    
# unzip wordpress-3.2.1-zh_CN.zip         
# mv wordpress/* /vhost/blog/        
# chown -R nginx:nginx /vhost/blog

创建数据库及数据库用户密码

[[email protected] ~]# mysql        
MariaDB [(none)]> create database wpdb;        
MariaDB [(none)]> GRANT ALL ON wpdb.* TO [email protected]‘localhost‘ IDENTIFIED BY ‘wppass‘;        
MariaDB [wpdb]> GRANT ALL ON wp.* TO [email protected]‘172.16.66.%‘ IDENTIFIED BY ‘wppass‘;

然后安装.......访问

六、安装xcache,为php加速:
1、安装 Xcache

[[email protected] tmp]# tar xf xcache-3.2.0.tar.bz2 
[[email protected] tmp]# cd xcache-3.2.0
[[email protected] xcache-3.2.0]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
[[email protected] xcache-3.2.0]# ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config

安装结束时,会出现类似如下行:

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/

2、编辑php.ini,整合php和xcache:

[[email protected] xcache-3.2.0]# mkdir /etc/php.d
[[email protected] xcache-3.2.0]# cp xcache.ini /etc/php.d

注:xcache.ini文件在xcache的源码目录中

3、编辑/etc/php.d/xcache.ini,找到extension开头的行,修改为如下行:
将 extension = xcache.so 修改为如下:

extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/xcache.so

注:如果php.ini文件中有多条zend_extension指令行,要确保此新增的行排在第一位。

4、重新启动php-fpm

[[email protected] xcache-3.2.0]# service php-fpm restart

OK  至此 Xcache就安装完成了接下来我们看下效果

七、使用ab进行压力测试

[[email protected] ~]# ab -n 1000 -c 10 http://blog.1inux.com/index.php  //总请求1000 并发10

 1、安装Xcache加速前进行的压力测试 效果如下

Server Software:        nginx/1.6.2
Server Hostname:        blog.1inux.com
Server Port:            80
Document Path:          /index.php
Document Length:        0 bytes
Concurrency Level:      10    //并发请求数
Time taken for tests:   30.660 seconds    //处理请求所花费的总时间
Complete requests:      1000    //总请求数
Failed requests:        0
Write errors:           0
Non-2xx responses:      1000
Total transferred:      257000 bytes
HTML transferred:       0 bytes
Requests per second:    32.62 [#/sec] (mean)  //服务器并发吞吐量
Time per request:       306.602 [ms] (mean)        //用户平均等待时间
Time per request:       30.660 [ms] (mean, across all concurrent requests)    //服务器平均请求处理时间
Transfer rate:          8.19 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:   192  306 129.9    253    1246
Waiting:      192  306 129.9    253    1246
Total:        192  306 129.9    253    1246
Percentage of the requests served within a certain time (ms)
  50%    253
  66%    308
  75%    350
  80%    421
  90%    483
  95%    492
  98%    596
  99%    737
 100%   1246 (longest request)

  2、安装Xcache加速并启用后  进行压力测试结果如下   

Server Software:        nginx/1.6.2
Server Hostname:        blog.1inux.com
Server Port:            80
Document Path:          /index.php
Document Length:        0 bytes
Concurrency Level:      10
Time taken for tests:   11.158 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Non-2xx responses:      1000
Total transferred:      257000 bytes
HTML transferred:       0 bytes
Requests per second:    89.62 [#/sec] (mean)
Time per request:       111.577 [ms] (mean)
Time per request:       11.158 [ms] (mean, across all concurrent requests)
Transfer rate:          22.49 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.0      0      33
Processing:    62  111  20.3    105     207
Waiting:       62  111  20.3    105     207
Total:         63  111  20.3    105     207
Percentage of the requests served within a certain time (ms)
  50%    105
  66%    114
  75%    125
  80%    131
  90%    142
  95%    149
  98%    157
  99%    161
 100%    207 (longest request)

可以明显看到 服务器并发吞吐量以及用户请求时长等性能都有了明显的提升........

不足之处还请各位看官指正。。。。。。

时间: 2024-08-06 05:49:12

CentOS 6.6 环境下 编译安装LNMP的相关文章

centos下编译安装LNMP环境

自PHP-5.3.3起,PHP-FPM加入到了PHP核心,编译时加上--enable-fpm即可提供支持. PHP-FPM以守护进程在后台运行,Nginx响应请求后,自行处理静态请求,PHP请求则经过fastcgi_pass交由PHP-FPM处理,处理完毕后返回. Nginx和PHP-FPM的组合,是一种稳定.高效的PHP运行方式,效率要比传统的Apache和mod_php高出不少. 二.依赖环境 yum -y install gcc gcc-c++ make cmake automake au

libCURL开源库在VS2010环境下编译安装,配置详解

libCURL开源库在VS2010环境下编译安装,配置详解 转自:http://my.oschina.net/u/1420791/blog/198247 CURL开源库VS2010环境下编译安装,配置详解 一 准备 1.1 CURL官网下载地址:http://curl.haxx.se/download.html 1.2 找到源码包,我这里下载的是7.32.0版:http://curl.haxx.se/download/curl-7.32.0.zip 二 步骤 2.1 打开curl-7.32.0\

centos6.7下编译安装lnmp

很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y groupinstall "Development Tools" "Server Platform Development" yum -y install pcre-devel  useradd -r nginx  mkdir /var/tmp/nginx   事先得创建

centos 6.2系统下编译安装lamp环境

系统环境:centOs 6.2(纯净系统环境,已做初步系统优化) 系统内核:2.6.32-220.el6.x86_64 软件版本:http-2.4.2;    mysql-5.5.23;    php-5.3.13 闲言碎语:通过源码方式安装软件,需要准备好安装环境(如gcc等工具) 个人学习.交流QQ:875656692 yum -y install gcc gcc-c++ openssl openssl-devel  yum install -y ncurses ncurses-devel

CentOS 6.4 linux下编译安装 LAMP环境

1.nginx编译安装 2.PHP编译安装 3.mysql编译安装 4.NGINX配置模板 5.CentOS 6.4 php-fpm 添加service 添加平滑启动/重启

centos7下编译安装lnmp和nginx代理实验

1.先安装mysql cd /usr/local/src wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz tar zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql cd /usr/local/mysql useradd

CentOS 6.4 linux下编译安装MySQL5.6.14

CentOS 6.4下通过yum安装的MySQL是5.1版的,比较老,所以就想通过源代码安装高版本的5.6.14. 正文: 一:卸载旧版本 使用下面的命令检查是否安装有MySQL Server rpm -qa | grep mysql 有的话通过下面的命令来卸载掉 rpm -e mysql //普通删除模式 rpm -e --nodeps mysql // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除 二:安装MySQL 安装编译代码需要的包 yum

CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10.1

一.安装前的准备工作 1.yum update    #更新系统 2.yum install gcc gcc-c++ autoconf automake cmake bison m4 libxml2 libxml2-devel libcurl-devel libjpeg-devel libpng-devel libicu-devel    #安装php.MySQL.Nngix所依赖的包 3.下载以下包   #我把所有源文件都下载在root目录,读者可自行修改源文件存放目录 3.1 libmcry

Linux下编译安装Lnmp

1.安装nginx 下载链接http://nginx.org/en/download.html (1)下载,解压 wget http://nginx.org/download/nginx-1.15.8.tar.gz tar zxf nginx-1.15.8.tar.gz cd nginx-1.15.8 (2)在编译安装之前先安装需要的依赖库和编译软件安装 yum install gcc gcc-c++ glibc -y yum install pcre-devel -y yum install