码迷,mamicode.com
首页 > 其他好文 > 详细

LNMP搭建

时间:2020-02-12 00:24:02      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:erro   nmp   reg   location   arch   lnmp   lis   regexp   rpm   

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搭建

标签:erro   nmp   reg   location   arch   lnmp   lis   regexp   rpm   

原文地址:https://www.cnblogs.com/centos-kang/p/12297458.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!