LAMP项目上线

一.场景

客户需求--->分析需求

二.项目

构架分析

项目源码包(开发提供)

三.LAMP构架

Linux 服务器

Apache 提供外部访问的服务

MySQL 数据库存储业务数据

PHP 后台提供动态数据资源的模块

四.linux软件的安装方式

(一)常见的三种安装方式

rpm安装,需要解决依赖关系

编译安装,需要配置,编译,安装,也需要解决依赖关系

yum安装,安装的是二进制的rpm包,可以自己解决依赖关系

(二)配置yum源(后续章节会讲yum源配置)

(三)常用命令

搜索软件
yum search 关键字
安装软件
yum [-y] install 关键字
卸载软件
yum [-y] remove 关键字

五.部署与配置环境

1.安装Apache

软件安装httpd;httpd-tools

httpd: Apache的web服务端软件包
httpd-tools: 相关工具包,安装httpd会依赖该包,必须安装

yum -y install httpd httpd-tools

# rpm -ql httpd
/etc/rc.d/init.d/httpd 服务的启动脚本
/etc/httpd/conf/httpd.conf 服务的配置文件
/var/www/html 存放资源文件的目录(数据目录)

设置开机自启动

设置开机自启动
chkconfig httpd on

启动httpd服务

/etc/init.d/httpd start

在浏览器访问该服务确认是否启动成功

2.MySQL安装

软件安装

mysql-server mysql

yum -y install mysql-server mysql

设置开机自启动
chkconfig mysqld on

启动mysql

/etc/init.d/mysqld start

设置mysql密码等信息

mysql_secure_installation

3.安装PHP

软件安装

php php-devel

yum [-y] install php php-devel

重启httpd服务

/etc/init.d/httpd restart

六.上传源代码

上传源代码到/var/www/html目录

安装Discuz!

1.将Discuz软件包上传到/var/www/html目录下并解压
2.设置目录权限
# chown -R apache.apache /var/www/html/*
3.安装php扩展
# yum install -y php-mysqli php连接数据库使用
4.重启httpd服务
5.浏览器访问页面,手动设置相关参数安装

原文地址:https://www.cnblogs.com/golinux/p/10809071.html