天天看点

LNMP

lnmp部署

安装nginx

安装依赖程序

yum -y install pcre-devel zlib-devel

yum -y install cmake

mysql依赖

LNMP

创建管理nginx用户

useradd -m -s /sbin/nologin nginx

解压

LNMP

配置

LNMP

安装

LNMP

调优

LNMP

测试完整性

LNMP

开启服务

LNMP

创建管理mysql用户

LNMP

安装mysql

LNMP
LNMP

cmake -dcmake_install_prefix=/usr/local/mysql -ddefault_charset=

utf8-ddefault_collation=utf8_general_ci

-dwith_extra_charsets=all -dsysconfdir=/etc

生成配置文件,生成服务控制文件

LNMP

设置开机自启

LNMP

优化mysql命令

LNMP
LNMP
LNMP
LNMP

初始化数据库

LNMP

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=

/usr/local/mysql --datadir=/usr/local/mysql/data

LNMP

重启测试

LNMP

设置密码

LNMP

登录

LNMP

安装php

LNMP
LNMP

安装依赖

LNMP
LNMP

./configure --prefix=/usr/local/php --with-config-file-p

ath=/usr/local/php --with-gd --with-zlib --with-mysql=/usr/local/mysql/ --with-jpeg-dir=/usr/lib --enable-mbstring --enable-fpm

查看是否安装成功

LNMP

生成主配置文件

LNMP
LNMP

优化php命令

LNMP

移动zend到php加速访问

LNMP

vim /usr/local/php/php.ini

LNMP

vim /usr/local/php/etc/php-fpm.conf

LNMP

启动

LNMP
LNMP

配置虚拟ip

LNMP
LNMP

设置静态

LNMP

设置动态

LNMP
LNMP
LNMP

server {

        listen   192.168.100.10:80;

        server_name  www.benet.com;

        charset utf-8;

        access_log  logs/www.benet.com.access.log ;

        location / {

            root     /var/www/benetcom/;

            index  index.html index.htm index.php;

        }

          location ~ \.php$ {

           root           /var/www/benetcom/;

           fastcgi_pass   127.0.0.1:9000;

             fastcgi_index  index.php;

             include        fastcgi.conf;

    }

LNMP

dns

LNMP
LNMP
LNMP
LNMP

安装dns

LNMP

修改配置文件

LNMP
LNMP
LNMP
LNMP

测试

LNMP
LNMP

客户端测试

LNMP

继续阅读