烘焙坊面包项目通过集成的IT系统实现了从原料采购到成品销售的全流程管理。我们使用先进的生产管理系统(PMS)来监控烘焙过程,确保质量和一致性,通过客户关系管理(CRM)软件,我们收集和分析客户数据,以提供个性化推荐和改进服务,使企业未来过度到全面信息化。本文就烘焙坊前期项目的搭建做一介绍,未来还会扩容到线订购平台和移动应用,使客户能够轻松下单,同时支持移动支付和忠诚度计划,增强了顾客的购买体验。整体而言,此次项目在烘焙坊信息化项目中扮演着核心角色,推动业务创新和增长。

配置过程如下

1.基础环境准备

systemctl stop firewalld.service --nowsetenforce 0yum -y install zipunzip hongbei-cabin.zip

2.MySQL数据库准备

全mysql数据库软件包并启动服务yum -y install mysql mysql-serversystemctl enable mysqld --now配置项目用户[root@hongbei ~]# sed -ri '/http:\/\/dev.img.p.yufeiworld.com\/hongbei\//s#http://dev.img.p.yufeiworld.com#http://192.168.10.110#g' hongbei.sql #其中192.168.10.110为nginx服务器的地址用于共享项目图片[root@hongbei ~]# Mysql -uroot mysql> create user prouser@localhost identified by ‘123456’;mysql> grant all privileges on *.* to prouser@localhost ;mysql>exit导入项目数据库[root@hongbei ~]#mysql -uprouser -p’123456’ < hongbei.sql

3.配置maven服务进行后端代码编译

修改后端yml配置文件数据库参数,如下: [root@hongbei ~]# vim hongbei-cabin/src/main/resources/application-local.yaml..........................................数据源配置 datasource: url: jdbc:mysql://192.168.10.110:3306/hongbei?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimeznotallow=Asia/Shanghai&allowMultiQueries=true&allowPublicKeyRetrieval=true username: prouser password: 123456...........................................安装配置maven服务安装JDKyum -y install java-1.8.0-openjdk-devel配置maven环境变量[root@hongbei ~]# yum -y install maven[root@hongbei ~]# tail -2 /etc/bashrcexport MAVEN_HOME="/usr/local/maven"export PATH=${MAVEN_HOME}/bin/:$PATH[root@hongbei ~]# source /etc/bashrc[root@hongbei ~]# mvn -v配置maven仓库[root@hongbei ~]# mkdir -p /usr/local/maven/repo[root@hongbei ~]# vim /etc/maven/settings.xml......<localRepository>/usr/local/maven/repo</localRepository>...... <mirror> <id>alimaven</id>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>.......编译后端代码,生成可执行的jar包[root@hongbei hongbei-cabin]# mvn clean package -Dmaven.test.skip=true[root@hongbei hongbei-cabin]# ls target/hongbei-web-1.0-SNAPSHOT.jar[root@hongbei hongbei]# cp ./target/hongbei-web-1.0-SNAPSHOT.jar /usr/loca/project/hongbei

4.烘培坊项目后端服务部署

配置项目服务管理脚本[root@hongbei ~]# cd /usr/local/project/hongbei/[root@zhcl ~]chmod +x /usr/local/project/hongbei/run.sh

启动项目服务

[root@hongbei hongbei]# ./run.sh start

[root@hongbei hongbei]# ss -anputl | grep 8080

编写项目service服务文件

[root@hongbei ~]# vim /usr/lib/systemd/system/hongbei.service

[root@hongbei ~]# cat /usr/lib/systemd/system/hongbei.service

[Unit]

Descriptinotallow=HongBeiProject Jar

After=sshd.service

[Service]

ExecStart=/usr/local/project/hongbei/run.sh start

ExecStop=/usr/local/project/hongbei/run.sh stop

Type=forking

[Install]

WantedBy=multi-user.target

[root@hongbei ~]# systemctl daemon-reload重新加载service文件

启动服务、测试接口

[root@hongbei ~]# systemctl enable hongbei.service --now

[root@hongbei ~]# ss -anptul | grep 8080

tcp LISTEN 0 100 *:8080 *:* users:(("java",pid=956,fd=19))

打开浏览器访问:http://ip地址:8080

烘焙坊项目部署流程_nginx

项目前端资源部署安装nginx服务[root@hongbei ~]# yum -y install nginx 上传前端资源[root@hongbei ~]# mkdir hongbei[root@hongbei ~]# tar -xf hongbeiimgs.tar.gz -C hongbei/[root@hongbei ~]# cp -r hongbei/ /usr/share/nginx/html/配置nginx服务[root@hongbei ~]# vim /etc/nginx/nginx.conf#注释掉默认配置文件监听端口[root@hongbei ~]# sed -rn '38,40p' /etc/nginx/nginx.confserver {#listen 80 default_server;#listen [::]:80 default_server;配置nginx发布资源,并启动服务[root@hongbei ~]# vim /etc/nginx/conf.d/hongbei.conf[root@hongbei ~]# cat /etc/nginx/conf.d/hongbei.confserver { listen 80; server_name __; location /hongbei/ { root /usr/share/nginx/html; } location / { proxy_pass http://127.0.0.1:8080/; }[root@hongbei ~]# systemctl enable nginx.service --nowCreated symlink /etc/systemd/system/multi-user.target.wants/nginx.service →/usr/lib/systemd/system/nginx.service.[root@hongbei ~]# ss -anptul | grep nginxtcp LISTEN 0 128 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=1785,fd=8),("nginx",pid=1751,fd=8))

测试验证

登录地址:

烘焙坊项目部署流程_nginx_02

登录用户名ttt,登录密码12345

烘焙坊项目部署流程_nginx_03

烘焙坊项目部署流程_maven_04