项目上线

网友投稿 308 2022-11-11

项目上线

先部署LNMP网站服务器架构

LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构。Linux是目前最流行的免费操作系统。Nginx是一个高性能的HTTP和反向代理服务器。Mysql是一个小型关系型数据库管理系统。PHP是一种在服务器端执行的嵌入HTML文档的脚本语言。这四种软件均为免费开源软件,组合到一起,成为一个免费、高效、扩展性强的网站服务系统。

部署前:

systemctl stop firewalld 关闭防火墙

systemctl disable firewalld 关闭防火墙的开启启动

vim /etc/selinux/config

使SELINUX=disabled

reboot

1.部署Nginx:

安装epel 去阿里镜像站下载

然后# yum -y install nginx

systemctl start nginx

systemctl enable nginx

cd /etc/nginx/

rm -rf nginx.conf

mv nginx.conf.default nginx.conf

2.部署php服务

yum -y install php php-cli php-curl php-fpm php-intl php-mcrypt phpmysql php-gd php-mbstring php-xml php-dom

3.安装数据库服务

yum -y install mariadb-server mariadb

systemctl start php-fpm

systemctl start mariadb

4.配置nginx服务

vim /etc/nginx/nginx.confserver {listen 80;server_name localhost;location / {root /usr/share/nginx/html;index index.php index.html index.htm;}去掉以下行的注释:location ~ .php$ {root /usr/share/nginx/html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root $fastcgi_script_name;include fastcgi_params;}}

systemctl restart nginx

5.配置数据库

mysqladmin -u root password '123'

登录:mysql -uroot -p123

MariaDB [(none)]> grant all on . to root@'%' identified by '123';

flush priviledges 刷新授权表

MariaDB [(none)]> create database 名字;

MariaDB [(none)]> exit

6.php程序测试

1). 测试php文件能否执行

cd /usr/share/nginx/html/

ls

rm -rf ./*

vim index.php

2). 测试php连接MySQL是否正常

vim index.php

删除index.php

7.产品上线下载解压缩复制到网站发布目录

edusoho在线视频学习系统上线:

修改配置文件我们的edusoho 的app.php在web下修改nginx配置文件改为root /usr/share/nginx/html/web在index.html前加一个app.php

qqfarm农场上线

浏览器访问 出现提示需要修改php的配置文件才可以安装

修改php配置文件vim /etc/php.inishort_open_tag=on

source /etc/php.ini 让文件生效再次刷新页面

如果出现mysql error 1316数据库错误:是因为数据库没有导入:mysql -u root -p‘123’ qqnong < /usr/share/nginx/html/qqfarm.sql

重新启动数据库服务:systemctl restart mariadb

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:docker集群
下一篇:基于SpringBoot多线程@Async的使用体验
相关文章

 发表评论

暂时没有评论,来抢沙发吧~