天天看點

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

繼續閱讀