LNMP = Linux Nginx Mariadb Php
静态界面:html
解析动态界面 :php
解析静态界面:Nginx
[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum -y install nginx
[root@localhost ~]# yum -y install php php-fpm php-curl php-intl php-mysql
[root@localhost ~]# yum -y install mariadb mariadb-server
[root@~]# systemctl start nginx
[root@ ~]# systemctl start php-fpm
[root@ ~]# systemctl enable nginx //将nginx服务设置为开机自启动
[root@ ~]# systemctl enable mariadb //将mysql服务设置为开机自启动
[root@ ~]# systemctl enable php-fpm //将php-fpm服务设置为开机自启动
[root@localhost ~]# mysqladmin -uroot password 'QianF@123' #设置密码
mariadb 安装默认是没有密码的
[root@localhost ~]# vim /etc/nginx/nginx.conf
修改nginx的访问资源
Modificar los resultados son los siguientes:
location ~ \.php$ { root /farm; //文档根目录
fastcgi_pass 127.0.0.1:9000; //指定访问的地址
fastcgi_index index.php; //指定默认访问的文件
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;//站点根目录,取决于 root配置项的值
include fastcgi_params; //此包包含nginx常量的定义 }
El despliegue del servicio de php
[root@localhost ~]# vim /etc/php.ini
将short_open_tag = Off 改为 On
[root@localhost ~]# systemctl restart nginx
[root@localhost ~]# systemctl restart php-fpm
Cinco: producto en línea
1. Crear un sitio web directorio de distribución
[root@localhost ~]# mkdir /farm 创建默认发布目录
2. Descargar el paquete de proyectos de carga (se puede dame un mensaje que puede enviar su paquete del proyecto)
3. Extracto
[root@localhost ~]# yum -y install unzip 下载解压工具
[root@localhost ~]# unzip farm-ucenter1.5.zip 解压文件
4. Mueva el elemento al sitio web de publicación de directorios
[root@localhost ~]# cp -r upload/* /farm
[root@localhost ~]# chmod 777 /farm -R
Importar base de datos: Seis
[root@localhost ~]# cd /farm/
[root@localhost ~]# mysql -u root -p farm < qqfarm.sql
Desactivar el firewall
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
Siete: el acceso del navegador a nuestra dirección IP, para comprobar si el funcionamiento normal del sitio