LNMP搭建

偶尔善良 提交于 2020-02-12 00:12:34

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

 

  

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!