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

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

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
CentOS7配置LNMP開發(fā)環(huán)境及配置文件管理

安裝并配置mysql 5.6

從centos從7.x開始默認(rèn)使用MariaDB。MariaDB完全兼容MySQL,包括API和命令行。但是很多時(shí)候我們還是會(huì)想要安裝MySQL,所以不能直接通過(guò)yum命令安裝。

下載源安裝文件

wget http://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm

本地安裝rpm包(配置MySQL安裝源)

yum -y localinstall mysql57-community-release-el7-8.noarch.rpm

查看所有MySQL安裝源(默認(rèn)MySQL安裝版本5.7)

yum repolist all | grep mysql

關(guān)閉MySQL 5.7安裝源

sudo yum-config-manager --disable mysql57-community

開啟MySQL 5.6安裝源

sudo yum-config-manager --enable mysql56-community

沒(méi)有yum-config-manager命令可以安裝yum install yum-utils.noarch工具
或者編輯/etc/yum.repos.d/mysql-community.repo文件enable項(xiàng)為1表示開啟,為0表示關(guān)閉

安裝MySQL

yum -y install mysql-devel mysql-community-server

啟動(dòng)MySQL

systemctl start mysqld.service

安全配置MySQL

mysql_secure_installation

安裝并配置PHP 5.6

CentOS 7.1版本中,默認(rèn)安裝PHP為PHP5.4版本,其中php-mysqlnd是PHP源碼提供的MYSQL驅(qū)動(dòng)數(shù)據(jù)庫(kù)。

很多時(shí)候會(huì)對(duì)PHP環(huán)境要求校新的版本,例如PHP5.6環(huán)境,記錄一種通過(guò)yum工具安裝最新PHP版本的方法。首先,需要在系統(tǒng)上安裝一個(gè)擴(kuò)展yum源,即epel源??蓮?code>http://Fedoraproject.org/wiki/EPEL網(wǎng)站下載并安裝。(注意:如果文章時(shí)間久,就可能需要去重新找新的下載鏈接。)

下載源安裝文件

wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm

本地安裝(和上面MySQL安裝源命令類似)

rpm -ivh epel-release-7-8.noarch.rpm

接著,還需要一個(gè)REMI源,這個(gè)yum源提供了最新的PHP版本的下載和安裝,它的官網(wǎng)http://rpms.famillecollet.com/。安裝REMI源的過(guò)程如下。

導(dǎo)入gpg校驗(yàn)文件

rpm --import http://rpms.remirepo.net/RPM-GPG-KEY-remi

下載源安裝文件

wget https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm

本地安裝

rpm -Uvh remi-release-7.rpm

默認(rèn)情況下,REMI是禁用的,防止多個(gè)yum源發(fā)生沖突??梢酝ㄟ^(guò)命令查看REMI源是否成功安裝

yum repolist disabled | grep remi

通過(guò)REMI源安裝需要的PHP版本,安裝PHP5.6版本。

yum --enablerepo=remi-php56 install php

安裝php-fpm

yum --enablerepo=remi-php56 install php-fpm

開啟php-fpm

systemctl start php-fpm

安裝并配置Nginx

導(dǎo)入gpg校驗(yàn)文件

rpm --import http://rpms.remirepo.net/RPM-GPG-KEY-remi

下載源安裝文件(配置Nginx安裝源)??蓮?code>http://nginx.org/packages/centos/網(wǎng)站下載安裝源。(注意:如果文章時(shí)間久,就可能需要去重新找新的下載鏈接。)

wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.0-1.el7.ngx.x86_64.rpm

本地安裝

rpm -Uvh nginx-1.10.0-1.el7.ngx.x86_64.rpm

安裝Nginx

yum install nginx

開啟Nginx

systemctl start nginx

Nginx主機(jī)配置(設(shè)置php-fpm)

編輯/etc/nginx/conf.d/default.conf配置文件,并重啟。

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log /var/log/nginx/log/host.access.log main;

    root   /usr/share/nginx/html;
    index  index.html index.htm index.php;

    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}
}

 

 

 

 

 

 

 


網(wǎng)站名稱:CentOS7配置LNMP開發(fā)環(huán)境及配置文件管理
網(wǎng)站鏈接:http://m.5511xx.com/article/dhedohp.html