LAMP-禅道-环境-部署

在linux虚拟机上搭建zentao禅道环境

在搭建环境前我们需要用到的Apache + PHP7.2 + mariadb + zentao禅道源码软件包

一、安装Apache服务

1、安装Apache服务

[root@localhost bt]# yum -y install httpd

在这里插入图片描述
在这里插入图片描述
2、查看apache服务的状态

[root@localhost bt]# systemctl status httpd

在这里插入图片描述
查看后当前的apache服务状态为未启动

3、启动apache服务

[root@localhost bt]# systemctl start httpd		//重启后apache服务默认为关闭状态
					systemctl enable httpd		//apache服务开机默认为启动状态
					systemctl stop httpd			//关闭apache服务
					systemctl restart httpd		//重启apache服务

在这里插入图片描述
启动后在查看apache服务状态,发现active (running),启动成功

4、查看Linux的地址

[root@localhost bt]# ip addr

在这里插入图片描述
查看后,linux的地址为192.168.0.108

5、使用宿主机的浏览器访问192.168.0.108

在这里插入图片描述
发现无法访问

6、查看linux的防火墙状态

[root@localhost bt]# systemctl status firewalld

在这里插入图片描述
发现防火墙是开启的状态

7、关闭防火墙

[root@localhost bt]# systemctl stop firewalld		//重启linux后防火墙默认开启状态
					setenforce 0
					systemctl disable firewalld	//禁止防火墙开机后启动防火墙

在这里插入图片描述
8、在次用浏览器访问192.168.0.108,如果能看到如下的页面,那么apache服务安装成功

在这里插入图片描述

二、安装php服务(7.2版本)

9、php7.2需要配置yum源

[root@localhost bt]# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
[root@localhost bt]# rpm -Uvh https://mirror.webtatic.com/yum/el7/ webtatic-release.rpm

在这里插入图片描述
10、安装 PHP7.2 所需组件(如果部署其他项目的时候,需要用到的组件可以询问开发或架构)

[root@localhost bt]#yum -y install php72w php72w-pdo php72w-mysql php72w-mbstring php72w-ldap php72w-gd php72w-json php72w-xml php72w-zip

在这里插入图片描述
在这里插入图片描述
11、因为apache服务已经安装成功了,那么会有一个这样的路径/var/www/html/;那么现在在/var/www/html/这个路径下创建一个文本,来测试下apache服务和php服务是不能可以关联起来

[root@localhost bt]# cd /var/www/html

在这里插入图片描述
12、创建一个index.php文件

[root@localhost html]# vi index.php

内容为 <?php phpinfo();?>

在这里插入图片描述
或者直接在命令行中输入如下命令

[root@localhost html]#echo '<?php phpinfo();?>'  >  /var/www/html/index.php

13、通过浏览器访问http://ip/index.php
在这里插入图片描述
发现显示的时index.php文件中的内容,应该显示php的版本信息。
14、重启下apache服务

[root@localhost html]#systemctl restart httpd

15、重启apache服务后在访问http://192.168.0.108/index.php

在这里插入图片描述
出现上图页面代表apache解析php成功

三、安装mariadb数据库服务

16、安装mariadb客户端和mariadb-server

[root@localhost html]# yum -y install mariadb mariadb-server

在这里插入图片描述
17、查看mariadb状态

[root@localhost html]# systemctl status mariadb

在这里插入图片描述
18、启动mariadb服务

[root@localhost html]# systemctl start mariadb
					   systemctl enable mariadb		//开机后mariadb默认为启动状态
					   systemctl restart mariadb		//重启mariadb数据库

在这里插入图片描述
19、数据库安装安全模块, root 账号密码( 默认root密码为空 )

注意:执行下面命令前必须开启 mariadb服务

[root@localhost html]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 	//输入登入密码,为空,直接回车
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y			//是否设置root密码
New password: 		//输入新密码
Re-enter new password: 		//二次确认密码
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y		//是否删除匿名用户
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y		//不允许root远程登入
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y		//删除测试数据库并访问它
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y		//是否重置数据表的权限
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost html]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]>user mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "rootadmin";
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]>

四、安装zentao禅道

20、通过宿主机浏览器下载zentao禅道源码包
https://www.zentao.net/dl/ZenTaoPMS.12.4.2.zip

21、在宿主机上打开SecureFXPortable传输工具,其他传输工具也行,如xshell

在这里插入图片描述
22、将宿主机下载好的ZenTaoPMS.12.4.2.zip进行上传到linux中的/home/bt/路径下

在这里插入图片描述
在这里插入图片描述
23、因为刚传输的是.zip的文件所以要安装unzip解压工具

[root@localhost bt]# yum -y install unzip

在这里插入图片描述
在这里插入图片描述
24、将ZenTaoPMS.12.4.2.zip文件进行解压,并且解压后的路径为apache的根目录

[root@localhost html]# unzip /home/bt/ZenTaoPMS.12.4.2.zip -d /var/www/html/

在这里插入图片描述
在这里插入图片描述
25、解压后进入解压文件夹中,里面是有一个www文件夹的,我们需要将zentao禅道的www路径做为apache服务的访问路径,就是下图的蓝线路径
在这里插入图片描述
26、修改apache服务配置文件(修改zentao禅道访问路径)

[root@localhost www]# pwd
/var/www/html/zentaopms/www
[root@localhost www]# cd /etc/httpd/conf
[root@localhost conf]# ll
总用量 28
-rw-r--r--. 1 root root 11753 9月  19 21:03 httpd.conf
-rw-r--r--. 1 root root 13064 4月   2 21:14 magic
[root@localhost conf]# vi httpd.conf

27、修改httpd.conf中的内容如下3个地方

将DocumentRoot "/var/www/html "改为
DocumentRoot “/var/www/html/zentaopms/www”

将<Directory "/var/www/html ">改为
<Directory “/var/www/html/zentaopms/www”>

将 AllowOverride None改为
AllowOverride ALL

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
28、修改apache服务配置文件后需要重启apache服务

[root@localhost conf]# systemctl restart httpd

在这里插入图片描述
在切换到zentao禅道的www目录里面,看看访问安装文件是哪个(install.php)

29、在通过浏览器访问http://ip/install.php
在这里插入图片描述
如果可以看到上面的图片表示部署成功

30、安装zentao禅道,点击浏览器中的‘开始安装’

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

五、遇到的异常

31、环境部署成功后,进行安装系统检查的时候‘临时文件目录’和‘上传文件目录’检查失败。然后根据后面的修改方法进行修改权限,在进行刷新,好像没用,然后找了些资料,把selinux的配置文件中SELINUX的值改为disabled。然后重启linux系统,在用浏览器访问就好了【vi /etc/selinux/config】

在这里插入图片描述
在这里插入图片描述

六、zentao禅道源码包

链接:https://pan.baidu.com/s/1GMQe6r58-TUXPRhZtiCa6g
提取码:se0s

▩初出茅庐,如果有其他好的方法,欢迎留言 (ง •_•)ง

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值