LNMPビルドwordprees

A.ファイアウォールとSELinuxをオフにします

systemctl stop firewalld.service 
setenforce 0 

第二に、ファイルストレージ解析用/データ/サーバーを作成します。

mkdir /data/server

LNMPビルドwordprees

三nginxのソースコードのインストール
nginxのをダウンロードし、解凍します。

wget http://nginx.org/download/nginx-1.16.0.tar.gz

LNMPビルドwordprees
ダウンロードの依存関係:

yum install openssl openssl-devel zlib zlib-devel pcre pcre-devel gcc gcc-c++ -y

LNMPビルドwordprees
ディレクトリに:

cd /usr/local/src/nginx-1.16.0

コンパイルしてインストールします。

./configure  --prefix=/data/server/nginx   #(编译安装的路径,将服务都放在/data/server下)

make && nake install

LNMPビルドwordprees
LNMPビルドwordprees
次にコンパイルnginxの、nginxのを開始

cd /data/server/nginx/sbin
./nginx

LNMPビルドwordprees
あなたのIPをチェック

ifconfig

ブラウザで発見することはIP入力し
LNMPビルドwordprees
てコンパイルnginxのを

IV。ソースのMySQLのインストール
ソースパッケージをダウンロード
LNMPビルドwordprees
解凍を

unzip AliSQL-AliSQL-5.6.32-9.zip

LNMPビルドwordprees
環境に依存パッケージをダウンロード:

yum -y install cmake bison git ncurses-devel gcc gcc-c++

LNMPビルドwordprees
ユーザーの追加:
groupaddのMySQLの
は、useradd -g MySQLのMySQLの
インストールをしてからPerlを抽出します。

wget http://repo.openfusion.net/centos7-x86_64//perl-Data-Dumper-2.154-1.of.el7.x86_64.rpm
rpm -ivh http://repo.openfusion.net/centos7-x86_64//perl-Data-Dumper-2.154-1.of.el7.x86_64.rpm

LNMPビルドwordprees
良いディレクトリに解凍します

cd AliSQL-AliSQL-5.6.32-9/

その後、コンパイルしてインストールします。

cmake -DCMAKE_INSTALL_PREFIX=/data/server/mysql -DMYSQL_UNIX_ADDR=/data/server/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/server/mysql/data -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DENABLE_DOWNLOADS=1
make && make install 

LNMPビルドwordprees
メインディレクトリのパーミッションを変更します。

chown -R mysql:mysql /data/server/mysql

権限にファイルをコピーします。

cd /data/server/mysql  
cp support-files/my-default.cnf  ./my.cnf 
chown -R  mysql:mysql my.cnf

プロファイル

vim my.cnf 
    basedir = /data/server/mysql
    datadir = /data/server/mysql/data
    socket = /data/server/mysql/mysql.sock
    log-error= /data/server/mysql/data/error.log
    pid-file = /data/server/mysql/data/mysql.pid
    user = mysql
    tmpdir = /tmp

LNMPビルドwordprees

データベースの初期化

scripts/mysql_install_db  --defaults-file=./my.cnf --user=mysql 

LNMPビルドwordprees
データベースを起動します

support-files/mysql.server   start  

LNMPビルドwordprees

データベースソリューションを開始するPIDエラー:

    rm -rf /etc/my.cnf
    rm -rf my.conf
    cd data
    rm -rf *
    cd ..
    scripts/mysql_install_db  --defaults-file=./my.cnf --user=mysql 
    cd support-files/
    ./mysql.server start
    cd ..
    cd bin

データベースを再起動します。

support-files/mysql.server   start 

LNMPビルドwordprees
データベースを作成します。

    >create database wordpress;
    >grant all on wordpress.* to wordpress@'localhost' identified by'123456';
    >flush privileges;
    >exit

LNMPビルドwordprees

MySQLのインストール。
V.インストールソースのPHP:
ユーザーの追加:

groupadd www
useradd -g www -s /sbin/nologin -M www

LNMPビルドwordprees
インストールパッケージには依存:
yumのインストールのlibpngはzlibのlibxmlのlibjpegのFreeTypeのGd-develのlibxml2の-develのはzlibのlibjpeg-develのFreeTypeののlibpng-develのdevelの-GD-カール-develののdevel OpenSSLのOpenSSLの-develのlibxsltはの-Y-develのlibiconvをカール
LNMPビルドwordprees
インストールしたlibiconvは、解凍を:

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
tar zxf libiconv-1.15.tar.gz

LNMPビルドwordprees
libiconfにファイル

cd libiconv-1.15

libiconvをコンパイルします

./configure --prefix=/data/server/libiconv
make && make install

LNMPビルドwordprees
LNMPビルドwordprees

PHPをダウンロードし、解凍します。

tar -zxvf php-5.6.32.tar.gz

LNMPビルドwordprees

次のファイルのphp-5.6.30に進出

cd /data/server/php-5.6.30

コンパイル

./configure \
--prefix=/data/server/php \
--enable-fpm \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-openssl \
--with-zlib \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-iconv=/data/server/libiconv \
--enable-short-tags \
--enable-sockets \
--enable-zend-multibyte \
--enable-soap \
--enable-mbstring \
--enable-static \
--with-curl \
--enable-ftp \
--with-libxml-dir
make && make install 

LNMPビルドwordprees
LNMPビルドwordprees
php.iniの設定

cp php.ini-development /data/server/php/lib/php.ini

PHP-FPMの構成:

cp -R ./sapi/fpm/php-fpm.conf /data/server/php/etc/php-fpm.conf

PHPは、私たちに準備init.d.php-FPMバックアップを提供します

cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

リストをchkconfigのためにPHP-FPMサービスを追加します。

chkconfig --add php-fpm

スタートからの起動を設定します

chkconfig php-fpm on

サービスを開始

service php-fpm start

在这里会报错:Permission Denied

vim /etc/profile    #(在末尾加)
PATH=$PATH:$HOME/bin:/data/server/php56/bin

LNMPビルドwordprees

source /etc/profile     #(使环境生效)

设置开机自启动

chkconfig --add php-fpm

加权限

chkconfig php-fpm on

启动php-fpm

service php-fpm start

LNMPビルドwordprees
更改配置文件:

vim /data/server/nginx/conf/nginx.conf
将user 前面注释去掉  并将nobady改成www www

LNMPビルドwordprees
在server/location模块下的index栏下 加一个 index.php

![](https://s1.51cto.com/images/blog/201908/09/314bd443ebe1d4f5cd2d670458248004.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
 将location ~ \.php$ 模块注释去掉 并/scripts改成$document_root

LNMPビルドwordprees
去到html目录下
cd /data/server/nginx/html
添加test.php文件
vim test.php
<?php phpinfo() ; ?

LNMPビルドwordprees
进到nginx运行目录
cd /data/server/nginx/sbin
重读nginx
./nginx -s reload
在浏览器里输入 ip/test.php

LNMPビルドwordprees
PHPが完了する設定
VI。ワードプレスを構築するには
ワードプレスをダウンロードし、解凍し
wgetのhttps://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz
タール-zxvfのwordpress-4.9.4-zh_CN.tar.gz
LNMPビルドwordprees
ワードプレスのファイルをページのディレクトリにコピーし
、CP -rワードプレス/データ/サーバー/ nginxの/ htmlの
修正Wordpressのプロファイル
CD /データ/サーバー/ nginxの/ HTML /ワードプレス
コピープロファイル
CP -rのWP-CONFIG-WPをsample.php -config.php
config.phpの-WP修正
VimのWP-config.phpを
変更することができ
、データベース名、口座番号、パスワード(データベースの変更はmysqlの名前で作成され、ユーザー、パスワード)
(あなたがあなた自身のアクセス権を設定することができ、ホスト127.0.0.1に当時とを)
LNMPビルドwordprees
LNMPビルドwordprees
LNMPビルドwordprees
LNMPビルドwordprees

おすすめ

転載: blog.51cto.com/14375810/2427921