LNMP搭建

Posted centos-kang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LNMP搭建相关的知识,希望对你有一定的参考价值。

nginx:

1.安装nginx yum源

  rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2.yum install nginx -y

3.mv /etc/nginx/conf.d/default   /etc/nginx/conf.d/vhost.conf

vim vhost.conf

server {
listen 80;
server_name www.lh.com;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /php/nginx/web/$fastcgi_script_name;
include fastcgi_params;
}

}

4.mkdir  /php/nginx/web -pv  

  vim index.php 

<?php

  phpinfo();

?>

用于测试php是否部署成功

 

5.yum install php-fpm -y

vim /etc/php-fpm-d/www.conf

 user=nginx

group=ngnx

 

6.yum install mariadb-server mariadb -y

  略

7.systemctl start nginx mariadb php-fpm

 

  

 

以上是关于LNMP搭建的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7 LNMP+phpmyadmin环境搭建(LNMP环境搭建)

LNMP架构的搭建

LNMP环境搭建

centos怎么搭建lnmp环境

LNMP环境搭建以及配置

LNMP环境搭建