日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
CentOS上yum方式安裝配置LNMP

實(shí)驗(yàn)環(huán)境

  1. 一臺(tái)最小化安裝的centos 7.3虛擬機(jī)

安裝軟件包

yum install -y epel-*
yum install -y nginx mariadb-server php php-MySQL \
php-fpm php-pdo php-pdo_dblib php-gd php-pear \
php-xml php-pecl-zip php-json php-devel wget vim

配置nginx支持PHP

1.建立nginx的web主目錄

mkdir /var/wwwroot
cd /var/wwwroot
echo -e hello_world >> index.html
echo -e "" >> info.php

2.編輯nginx的配置文件

vim /etc/nginx/nginx.conf

3.修改nginx主目錄和索引

  1. http下的server下的root的值修改為/var/wwwroot
  2. http下的server下添加index index.php index.html index.htm

4.在http下的server區(qū)塊加入以下內(nèi)容

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

5.啟動(dòng)nginxphp-fpm

systemctl start nginx php-fpm
systemctl enable nginx php-fpm

6.關(guān)閉防火墻

setenforce 0
systemctl stop firewalld
systemctl disable firewalld

7.在宿主機(jī)訪問nginx

訪問http://[centos_ip]/info.php

成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比大新網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式大新網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋大新地區(qū)。費(fèi)用合理售后完善,十多年實(shí)體公司更值得信賴。

配置MySQL

1.啟動(dòng)MySQL

systemctl start mariadb
systemctl enable mariadb

2.輸入以下命令,配置MySQL

mysql_secure_installation

3.提示Enter current password for root (enter for none):

敲擊回車

4.提示Set root password? [Y/n]

Y,隨后設(shè)置密碼

5.提示Remove anonymous users?

意思為是否刪除匿名用戶

6.提示Disallow root login remotely?

意思為遠(yuǎn)程禁止root登錄嗎?

7.提示Remove test database and access to it?

意思為刪除測試數(shù)據(jù)庫嗎?

8.提示Reload privilege tables now?

意思為現(xiàn)在重新加載特權(quán)表嗎?

9.登錄mysql數(shù)據(jù)庫

mysql -uroot -p

下載WordPress測試LNMP環(huán)境

1.下載WordPress

cd /var/wwwroot
rm -rf index.html
rm -rf info.php
wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz
tar -zxvf wordpress-4.9.4-zh_CN.tar.gz
cp -rf /var/wwwroot/wordpress/* /var/wwwroot
cd /var/wwwroot
rm -rf wordpress
chmod -R 777 *

2.登錄mysql創(chuàng)建數(shù)據(jù)庫

mysql -uroot -p
CREATE DATABASE wordpress;

3.在宿主機(jī)訪問nginx服務(wù)器

訪問http://[centos_ip]/
按提示安裝即可


本文題目:CentOS上yum方式安裝配置LNMP
瀏覽路徑:http://www.5511xx.com/article/cdchsdo.html