一:安装前的准备工作

1)源码安装就是指从官方网上下载的最新版本的源代码, LNMP是指linux系统中nginx+mysql+php的结合,而LAMP是在linux系统中apache+mysql+php的结合,apache使用的机制是select,事件是轮询,所以效率比较低。LNMP中的nginx可以实现反向代理加速,占用的内存空间也比较少,它使用的机制是epoll机制,事件是触发更新,所以效率比较高。今天我们就使用最新的源代码来搭建LNMPlinux的操作系统我使用的是5.4版本,nginxnginx-1.0.11压缩文件,mysql使用的是mysql-5.5.15压缩文件,它是绿色软件包,里面存放的不是源代码而是二进制文件,php使用的是php-5.4.13压缩文件,在LAMPphp的工作是调用apache的模块,而在LNMPphp是通过使用fastcginginx进行工作,fastcgi可以启动n多个子进程,所以效率会提高,而管理fastcgi的是fpm,在php5.3之前是通过打补丁来管理的,在php5.3之后就支持fmp了。为了更加完美我们把php的加速也源码安装,使用的是xcache-2.0.1.tar.gz版本的。然后我们从相关的官方网上下载这些源代码。

2)在安装nginx之前,首先安装pcrelibevent

PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正规表达式库.这些在执行正规表达式模式匹配时用,与Perl 5同样的语法和语义是很有用的。 Boost太庞大了,使用boost regex后,程序的编译速度明显变慢。测试了一下,同样一个程序,使用boost::regex编译时需要3秒,而使用pcre不到1秒。因此改用pcre来解决C语言中使用正则表达式的问题。安装pcreLinux5.4中存在该软件包并且已经安装,但是我们还要安装pcre-devel这个软件包里存放很多的库文件,所以先用rpm安装pcre-delve

libevent是一个强大的跨平台的事件通知库,如果不想被多线程困扰,可以考虑这个平台,它从1.2.* 版本开始支持轻量级的http server 开发支持,随后陆续还推出轻量级 DNS serverRPC server 开发支持,这组事件API提供了一种当某个指定文件描述符有效或时间到达时执行某个函数的机制,在使用事件API前必须使用event_init()初始化。在Linux5.4中已经安装了libevent,但是版本比较低,所以我们从libevent的官网libevent.org 最新版本是2.0.16,下载该压缩文件。

3)对于nginxmysqlphp的安装顺序其实没有太多要求,但是php要与nginx进行结合,还要调用mysql,所以我们把php放在最后安装,我们先安装mysql,在安装nginx,最后安装php

二:安装步骤

1)安装mysql,它是二进制文件

把下载的压缩包传到root家目录

[root@localhost ~]# ll

total 171460

-rw------- 1 root root      1053 Apr 23 20:31 anaconda-ks.cfg

drwxr-xr-x 2 root root      4096 Apr 25 19:07 Desktop

-rw-r--r-- 1 root root     27974 Apr 23 20:30 install.log

-rw-r--r-- 1 root root      4389 Apr 23 20:27 install.log.syslog

-rwxrw-rw- 1 root root    837650 Apr  3  2012 libevent-2.0.16-stable.tar.gz

-rwxrw-rw- 1 root root 162247449 Jul 15  2011 mysql-5.5.15-linux2.6-i686.tar.gz

-rwxrw-rw- 1 root root    691501 Apr  3  2012 nginx-1.0.11.tar.gz

-rwxrw-rw- 1 root root  11545777 Mar 15 16:01 php-5.4.13.tar.bz2

拆包到/usr/local目录下,一般的源代码都要解压到/usr/local/src目录下,但我们使用的是绿色软件包(二进制文件)所以拆包到/usr/local

[root@localhost ~]# tar -zxvf mysql-5.5.15-linux2.6-i686.tar.gz -C /usr/local

[root@localhost ~]# cd /usr/local     

[root@localhost local]# ll

drwxr-xr-x 13 root root 4096 Apr 25 10:08 mysql-5.5.15-linux2.6-i686

解压后的文件名太长不容易写,所以要更改文件名或者建立软连接,在这使用软连接

[root@localhost local]# ln -s mysql-5.5.15-linux2.6-i686 mysql

[root@localhost local]# ll

lrwxrwxrwx  1 root root   26 Apr 25 10:08 mysql -> mysql-5.5.15-linux2.6-i686

drwxr-xr-x 13 root root 4096 Apr 25 10:08 mysql-5.5.15-linux2.6-i686

[root@localhost local]# cd mysql     #切换到mysql目录查看文件,其中有一个安装二进制文件(INSTALL-BINARY

[root@localhost mysql]# less INSTALL-BINARY    #查看该文件

存放的是mysql的安装步骤

 To install and use a MySQL binary distribution, the basic command

   sequence looks like this:

1.shell> groupadd mysql              #建立组名

2.shell> useradd -r -g mysql mysql   #建立帐号为系统帐号,加入到mysql组中

3.shell> cd /usr/local               #切换到/usr/local

4.shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz   #mysql压缩文件解压

5.shell> ln -s full-path-to-mysql-VERSION-OS mysql   #创建软连接

6.shell> cd mysql                    #切换到mysql目录

7.shell> chown -R mysql .     #mysql目录下所以对象改变所有者,-R表示递归

8.shell> chgrp -R mysql .     #mysql目录下所以对象改变所有组,-R表示递归

9.shell> scripts/mysql_install_db --user=mysql  #产生初始化脚本

10.shell> chown -R root .       #mysql目录下把所有者还该为管理员

11.shell> chown -R mysql data   #mysql目录下只有data所有者为mysql

# Next command is optional

12.shell> cp support-files/my-medium.cnf /etc/my.cnf  #mysql的配置文件

13.shell> bin/mysqld_safe --user=mysql &

# Next command is optional

14.shell> cp support-files/mysql.server /etc/init.d/mysql.server  #mysql的控制脚本

mysql的安装步骤中345我们在上面已经做过了,我们只做剩下的

[root@localhost ~]# groupadd -r mysql    #创建组为系统组

[root@localhost ~]# useradd -r -g mysql mysql  -M   #创建系统帐号加入系统组中,-M表示不创建家目录

[root@localhost ~]# cd /usr/local/mysql

[root@localhost mysql]# chown -R mysql .    #mysql目录下所以对象改变所有者权限,-R表示递归

[root@localhost mysql]# chgrp -R mysql .  #mysql目录下所以对象改变所有组权限,-R表示递归

[root@localhost mysql]# scripts/mysql_install_db --user=mysql #产生初始化脚本

Installing MySQL system tables...

OK

Filling help tables...

OK

[root@localhost mysql]# chown -R root .   #mysql目录下把所有者还该为管理员

[root@localhost mysql]# chown -R mysql data  #mysql目录下只有data所有者为mysql

[root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf  #mysql的配置文件

[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysqld  #mysql的控制脚本

[root@localhost mysql]# chmod a+x /etc/init.d/mysqld  #改变控制脚本的权限可执行

[root@localhost mysql]# chkconfig --add mysqld        #添加mysqlchkconfig

[root@localhost mysql]# chkconfig --list |grep mysql  #开机能够自动启动

mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off

[root@localhost mysql]# service mysqld start

Starting MySQL........                                     [确定]

[root@localhost mysql]# netstat -tupln |grep mysql   #mysql端口为3306

tcp        0      0 :::3306                     :::*                        LISTEN      6078/mysqld        

[root@localhost mysql]# mysql     #进入mysql数据库时出错,没有mysql命令

bash: mysql: command not found

[root@localhost mysql]# cd bin    #切换到bin

[root@localhost bin]# ll

[root@localhost bin]# ./mysql     #执行./mysql能进入数据库

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.5.15-log MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;             #查看数据库

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| test               |

+--------------------+

4 rows in set (0.00 sec)

mysql> \q                         #退出数据库

Bye

我们要把它加入到搜索路径中去

[root@localhost bin]# vim /etc/profile      #环境变量

fi

PATH=$PATH:/usr/local/mysql/bin          #加入该命令在export之前

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

[root@localhost bin]# . /etc/profile     #执行一次

[root@localhost bin]# mysql           #登陆直接输入mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

mysql> \q

Bye

接下来我们给mysql数据库设置一个管理员帐号和密码

[root@localhost ~]# mysqladmin -u root -p password '123'  #-u表示帐号-p表示密码

Enter password:

[root@localhost ~]# mysql -u root –p           #输入帐号和密码登录数据库

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

mysql> \q

Bye

mysql目录下有头文件(include)和库文件(lib),我们要把这些文件导入到环境中去这些文件被调用

[root@localhost ~]# cd /usr/local/mysql

[root@localhost mysql]# vim /etc/ld.so.conf.d/mysql.conf  #ld.so.conf.d目录下随便创建一个文件只要是.conf结尾的,

/usr/local/mysql/lib             #输入库文件的存放路径

[root@localhost mysql]# ldconfig         #ldconfig 刷新缓存文件

[root@localhost mysql]# ldconfig -pv |grep mysql  #查看

        libtcmalloc_minimal.so.0 (libc6) => /usr/local/mysql/lib/libtcmalloc_minimal.so.0

        libmysqlclient.so.18 (libc6) => /usr/local/mysql/lib/libmysqlclient.so.18

        libmysqlclient.so (libc6) => /usr/local/mysql/lib/libmysqlclient.so

[root@localhost mysql]# ln -s include /usr/include/mysql    #给头文件创建一个软连接mysql放在/usr/include

Mysql安装完毕

2)安装nginx

A. 首先我们先安装pcrelibevent

linux系统中已经安装了pcre,我们直接安装pcre-devel软件包

[root@localhost ~]# mkdir /mnt/cdrom       #建立光盘挂载点

[root@localhost ~]# mount /dev/cdrom /mnt/cdrom    #挂载光盘到光盘挂载点

mount: block device /dev/cdrom is write-protected, mounting read-only

[root@localhost ~]# cd /mnt/cdrom/Server      

[root@localhost Server]# rpm -qa |grep pcre     #查看pcre已经安装过

pcre-6.6-2.el5_1.7

[root@localhost Server]# rpm -ivh pcre-devel-6.6-2.el5_1.7.i386.rpm   #安装pcre-devel

Preparing...                ########################################### [100%]

   1:pcre-devel             ########################################### [100%]

然后安装libevent压缩包,压缩包已经传入到root目录下,安装源代码的步骤:配置,编译,安装

[root@localhost ~]# tar -zxvf libevent-2.0.16-stable.tar.gz -C /usr/local/src

#拆包到存放源代码的位置/usr/local/src目录下

[root@localhost ~]# cd /usr/local/src/libevent-2.0.16-stable/    #切换到源代码

[root@localhostlibevent-2.0.16-stable]# ./configure --prefix=/usr/local/libevent 

#进行安装,为了方便以后删除,我们把它放到一个目录下

[root@localhost libevent-2.0.16-stable]# make      #make之后直接make install

[root@localhost libevent-2.0.16-stable]# make install

[root@localhost libevent-2.0.16-stable]# cd /usr/local/libevent

#libevent目录下存放的有头文件和库文件,我们要导入到环境中能被调用

[root@localhost libevent]# ll

total 12

drwxr-xr-x 2 root root 4096 Apr 25 13:56 bin

drwxr-xr-x 3 root root 4096 Apr 25 13:56 include

drwxr-xr-x 3 root root 4096 Apr 25 13:56 lib

[root@localhost libevent]# vim /etc/ld.so.conf.d/libevent.conf  #创建一个libevent.conf的文件

/usr/local/libevent/lib         #输入库文件的存放位置

[root@localhost libevent]# ldconfig      #刷新缓存文件

[root@localhost libevent]# ldconfig -pv |grep libevent    #查看

        libevent_pthreads-2.0.so.5 (libc6) => /usr/local/libevent/lib/libevent_pthreads-2.0.so.5

        libevent_openssl-2.0.so.5 (libc6) => /usr/local/libevent/lib/libevent_openssl-2.0.so.5

        libevent_extra-2.0.so.5 (libc6) => /usr/local/libevent/lib/libevent_extra-2.0.so.5

        libevent_core-2.0.so.5 (libc6) => /usr/local/libevent/lib/libevent_core-2.0.so.5

        libevent-2.0.so.5 (libc6) => /usr/local/libevent/lib/libevent-2.0.so.5

        libevent-1.1a.so.1 (libc6) => /usr/lib/libevent-1.1a.so.1

[root@localhost libevent]# ln -s include /usr/include/libevent    

#对于头文件我们创建软连接到/usr/include的目录下创建libevent

B.安装nginx

[root@localhost ~]# tar -zxvf nginx-1.0.11.tar.gz -C /usr/local/src

#nginx运行者身份

[root@localhost ~]# groupadd -r nginx        #建立组

[root@localhost ~]# useradd -r -g nginx nginx –M    #帐号加入到组中

[root@localhost ~]# cd /usr/local/src/nginx-1.0.11/

[root@localhost nginx-1.0.11]# ./configure \      #后面跟的参数,\表示续行符

>   --conf-path=/etc/nginx/nginx.conf \          #指明配置文件路径

>  --error-log-path=/var/log/nginx/error.log \   #出错日志存放的位置

>   --http-log-path=/var/log/nginx/access.log \  #应用http访问时成功的日志

>   --pid-path=/var/run/nginx/nginx.pid \        #表示进程号存放的位置

>   --lock-path=/var/lock/nginx.lock \        #表示所文件的存放位置

>   --user=nginx \           #运行者

>  --group=nginx \           #运行者组

>   --with-http_ssl_module \    #支持ssl加密,数字证书

>   --with-http_flv_module \    #支持flv流媒体模式

>   --with-http_stub_status_module \   #本地的信息输出

>   --with-http_gzip_static_module \    #支持压缩和解压缩

>   --http-client-body-temp-path=/var/tmp/nginx/client/ \ #表示客户端进行访问时临时存放的目录,我们需要创建该client目录

>  --http-proxy-temp-path=/var/tmp/nginx/proxy/ \   #反向代理加速的临时目录

>   --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \   #表示fastcgi的临时目录

>   --with-pcre      #安装pcre-devel的存放目录

[root@localhost nginx-1.0.11]#make

[root@localhost nginx-1.0.11]#make install

编辑Nginx的控制脚本程序

[root@localhost ~]# vim /etc/init.d/nginx     #inid.d目录下编辑nginx文件

#!/bin/sh

#set -x

NGINXD='/usr/local/nginx/sbin/nginx'

#description: nginx web server

#chkconfig: 2345 88 60

if [ -f /etc/init.d/functions ];then

. /etc/init.d/functions

fi

start(){

      [ -f /var/lock/subsys/nginx ]&& echo "nginx is started" && exit

     echo -n  "starting nginx......"

        sleep  1

     $NGINXD   && RETVAL=0 ||RETVAL=1

     [ $RETVAL -eq 0 ]&& touch /var/lock/subsys/nginx && echo "ok" || echo "fail"   

}

stop(){

     [ ! -f  /var/lock/subsys/nginx ] && echo "nginx is stoped..." && exit

     echo -n "stoping nginx........"

 sleep  1

     killproc nginx  && RETVAL=0 ||RETVAL=1

     [ $RETVAL -eq 0 ] && rm -rf /var/lock/subsys/nginx && echo "ok" || echo "fail"

}

case $1 in

start)

        start

        ;;

stop)

        stop

        ;;

restart)

       stop

       start

        ;;

*)

        echo "start|stop|restart"

 ;;

esac

[root@localhost ~]# chmod a+x /etc/init.d/nginx        #改变权限可执行

[root@localhost ~]# service nginx start          #启动nginx服务

starting nginx......ok

[root@localhost ~]# netstat -tupln |grep 80       #查看端口

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      5595/nginx         

[root@localhost ~]# cd /usr/local/nginx/html      #切换到站点目录下

[root@localhost html]# vim index.html             #查看网页内容

<html>

<head>

<title>Welcome to nginx!</title>

</head>

<body bgcolor="white" text="black">

<center><h1>Welcome to nginx!</h1></center>

</body>

</html>

安装nginx成功

Nginx也是一个服务器,nginx能够处理php,我们要修改nginx的配置文件

[root@localhost ~]# vim /etc/nginx/nginx.conf

location / {

            root   html;

            index index.php  index.html index.htm;

        }

location ~ \.php$ {

            root           html;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html$fastcgi_script_name;

            include        fastcgi_params;

        }

[root@localhost ~]# cd /usr/local/nginx/html      #修改网页内容

[root@localhost html]# ll

total 8

-rw-r--r-- 1 root root 383 Apr 25 16:33 50x.html

-rw-r--r-- 1 root root 151 Apr 25 19:32 index.html

[root@localhost html]# mv index.html index.php

[root@localhost html]# vim index.php

<html>

<head>

<title>Welcome to nginx!</title>

</head>

<body bgcolor="white" text="black">

<center><h1>Welcome to nginx!</h1></center>

</body>

</html>

<?php

phpinfo();

?>

mysql结合,编写网页

<html>

<head>

<title>Welcome to nginx!</title>

</head>

<body bgcolor="white" text="black">

<center><h1>Welcome to nginx!</h1></center>

</body>

</html>

<?php

$link=mysql_connect('127.0.0.1','root','123');

if($link)

echo "ok";

else

echo "not";

?>

重启服务

3)安装php源代码

[root@localhost ~]# tar -jxvf php-5.4.13.tar.bz2 -C /usr/local/src

[root@localhost ~]# cd /usr/local/src/php-5.4.13/

[root@localhost php-5.4.13]#./configure    \

>       --prefix=/usr/local/php \           #安装目录

>        --enable-fpm   \                #支持fastcgi

>        --enable-sockets  \             #服务

>        --with-mysql=/usr/local/mysql \  #支持mysql

>         --with-mysqli=/usr/local/mysql/bin/mysql_config  \  #mysql的接口文件

>         --enable-mbstring  \   #多种字符串

>         --enable-xml  \      #字符格式

>         --with-png-dir \     #图像和图形相关的

>         --with-png  \

>         --with-jpeg-dir  \

>         --with-zlib  \      #支持压缩

>          --with-freetype-dir \

>         --with-config-file-path=/etc/php \  #放置php的配置文件的

>         --with-config-file-scan-dir=/etc/php5.d    #额外功能的控制文件

[root@localhost php-5.4.13]#make

[root@localhost php-5.4.13]#make install

1.Php的配置文件,进入源码目录

[root@localhost ~]# cd /usr/local/src/php-5.4.13/

[root@localhost php-5.4.13]# mkdir /etc/php /etc/php5.d

[root@localhost php-5.4.13]# cp php.ini-production  /etc/php/php.ini

2.php-fpm的控制脚本,fpm也是一个服务器来管理fastcgi

[root@localhost php-5.4.13]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

改变权限可执行

[root@localhost php-5.4.13]# chmod a+x /etc/init.d/php-fpm

3.产生php-fpm的配置文件,进入php的安装目录下的etc

[root@localhost php-5.4.13]# cd /usr/local/php/etc/

You have new mail in /var/spool/mail/root

[root@localhost etc]# ll

total 28

-rw-r--r-- 1 root root  1152 Apr 25 20:01 pear.conf

-rw-r--r-- 1 root root 21590 Apr 25 20:01 php-fpm.conf.default    #配置文件样例

[root@localhost etc]# cp php-fpm.conf.default php-fpm.conf

[root@localhost ~]# service php-fpm start      #开启服务

Starting php-fpm  done

[root@localhost ~]# netstat -tupln |grep php-fpm     #查看端口

tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      7041/php-fpm.conf) 

[root@localhost ~]# ps aux |grep fpm      #查看fpm进程

root      7041  0.0  0.4  30428  2228 ?        Ss   10:06   0:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)                                                                   

nobody    7042  0.0  0.3  30428  2060 ?        S    10:06   0:00 php-fpm: pool www                                                                                                            

nobody    7043  0.0  0.3  30428  2060 ?        S    10:06   0:00 php-fpm: pool www                                                                                                           

root      7711  0.0  0.1   4788   660 pts/1    R+   10:44   0:00 grep fpm

 

4)测试

 

 5xcache的安装

[root@localhost ~]# tar -zxvf xcache-2.0.1.tar.gz -C /usr/local/src

[root@localhost ~]# cd /usr/local/src/xcache-2.0.1/       #当切换到安装目录查看并没有configure,所以我们查看安装文件

[root@localhost xcache-2.0.1]# less INSTALL               #安装xcache的安装步骤

Installtion:

 

    $ phpize --clean && phpize

    $ ./configure --help

    $ CFLAGS='your cflags' ./configure --enable-xcache --enable...

    $ make

    $ su

    # make install

        (update php.ini, restart php)

[root@localhost xcache-2.0.1]# /usr/local/php/bin/phpize

Configuring for:

PHP Api Version:         20100412

Zend Module Api No:      20100525

Zend Extension Api No:   220100525

[root@localhost xcache-2.0.1]# ls           #查看就有configure

[root@localhostxcache-2.0.1]#./configure   --enable-xcache --with-php-config=/usr/local/php/bin/php-config

[root@localhost xcache-2.0.1]# make

[root@localhost xcache-2.0.1]# make install

[root@localhostxcache-2.0.1]# ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/

total 416

-rwxr-xr-x 1 root root 418702 Apr 28 12:22 xcache.so

安装完成后把xcache的配置文件拷贝到/etc/php5.d

[root@localhost xcache-2.0.1]# cp xcache.ini /etc/php5.d

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

#xcache.so的位置写正确

;; windows example:

;;zend_extension_ts = c:/php/extensions/php_xcache.dll       #这句注释

[root@localhost ~]# cd /usr/local/nginx/html

[root@localhost html]# vim index.php

<html>

<head>

<title>Welcome to nginx!</title>

</head>

<body bgcolor="white" text="black">

<center><h1>Welcome to nginx!</h1></center>

</body>

</html>

<?php

phpinfo();

?>

重启php-fpm服务,测试在php的信息中有xcache信息

 

为了方便管理xcache

[root@localhost xcache-2.0.1]# cp  -r admin /usr/local/nginx/html       #xcacheadmin文件夹拷贝到nginxhtml目录下,访问时就能很清晰的看到xcache的使用情况

[root@localhost xcache-2.0.1]# cd /usr/local/nginx/html/

[root@localhost html]# ll

total 12

-rw-r--r-- 1 root root  383 Apr 25 16:33 50x.html

drwx------ 2 root root 4096 Apr 29 16:10 admin

-rw-r--r-- 1 root root  171 Apr 28 12:36 index.php

[root@localhost html]# chmod a+rx admin      #改变权限

[root@localhost xcache-2.0.1]# cd admin/

[root@localhost admin]# chmod a+r index.php    #admin存在index.php网页,改变权限可读

我们管理xcache是通过认证

[root@localhost admin]# cd /etc/php5.d

[root@localhost php5.d]# ll

total 4

-rw-r--r-- 1 root root 3047 Apr 28 12:35 xcache.ini

[root@localhost php5.d]# vim xcache.ini

[xcache.admin]       #大约在14

xcache.admin.enable_auth = On

xcache.admin.user = "admin"

; set xcache.admin.pass = md5($your_password)

; login use $your_password

xcache.admin.pass = "21232f297a57a5a743894a0e4a801fc3" 

密码必须是md5加密的

[root@localhost ~]# echo -n "admin" |md5sum

21232f297a57a5a743894a0e4a801fc3  -       #把密码拷贝过去

重启php-fpm,然后再访问http://192.168.255.250/admin