Zen installation environment under Centos7.5

First, install

Zen into the official website https://www.zentao.net , select the appropriate version for installation, I am here to download the "open source version 11.6"

The official Open Source Edition Manual: https://www.zentao.net/book/zentaopmshelp/40.html

Note: Linux a key installation package must be unpacked directly to the / opt directory.

1, directly extract the installation package to the / opt directory, do not extract to another directory and then copied to the / opt /, because this will cause the owner to read and write and file permissions change, do not unpack the entire directory 777.

Can use the command: tar -zxvf ZenTaoPMS.11.6.stable.zbox_64.tar.gz -C / opt /

2, execute / opt / zbox / zbox start command to turn on Apache and MySQL

Execute / opt / zbox / zbox stop command to stop Apache and MySQL

Execute / opt / zbox / zbox restart command to restart Apache and MySQL

I have been here since the server Apache and MySQL installation to avoid port conflicts, so start with the command / opt / zbox / zbox start -ap 8888 -mp 3307 specifies the Apache and MySQL ports, as shown below:

You can use / opt / zbox / zbox -h command to get help on the command zbox

-Ap parameters which can modify the Apache port, -mp parameters can be modified MySQL port

Incidentally, the Apache port to the firewall

firewall-cmd --zone=public --add-port=8888/tcp --permanent

firewall-cmd --reload

3, the browser visit http: // ip: apache port, click on the "open source version" and enter the Zen login screen, enter the default user name admin, password 123456, change your password after entering.

Home after entering the following figure:

到此处,说明禅道已经搭建完成,可以进行一系列新建产品和项目,包括分配任务。

二、如何访问数据库

1、网页登录数据库。

禅道数据库管理用的是adminer,但是为了安全,访问adminer的时候需要身份验证,需要运行/opt/zbox/auth/adduser.sh来添加用户(先 cd /opt/zbox/auth/ 然后执行 ./adduser.sh)。

1)我设置的Account是root,Password是123456,这里添加的用户名和密码是自定义的。

网页访问 http://禅道服务的ip:apache端口,点击“数据库管理”

输入刚运行 addusers.sh 设置的用户名和密码。

2)连接数据库:

系   统:默认选择MySQL

服务器:127.0.0.1:mysql端口,我在前面开启服务时,mysql端口启用的是3307。那么就填写127.0.0.1:3307(服务器以实际部署的ip为准)

用户名: root

密   码:123456

数据库:zentao

点击“登录”后,进入数据库管理界面,如下图:

2、命令行连接数据库。

登录数据库:/opt/zbox/bin/mysql -u root -P mysql端口 -p  (比如:/opt/zbox/bin/mysql -u root -P 3307 -p)

导入数据库:/opt/zbox/bin/mysql -u root -P mysql端口 -p 要导入的库名 < XXXX.sql (比如:/opt/zbox/bin/mysql -u root -P 3307 -p zentao < zentao.sql)

三、设置开机自动启动,添加自定义系统服务

CentOS7 系统服务脚本目录 /usr/lib/systemd/

有系统(system)和用户(user)之分,如需要开机没有登陆情况下就能运行的程序,存在系统服务(system)里,即 lib/systemd/system/,反之,用户登录后才能运行的程序,存在用户(user)里,服务以.service结尾。

下面以zentao开机运行为例:

1.建立服务文件

vim /lib/systemd/system/zentao.service 

 

[Unit]

Description=zentao

After=network.target

 

[Service]

Type=forking

ExecStart=/opt/zbox/zbox start

ExecReload=/opt/zbox/zbox restart

ExecStop=/opt/zbox/zbox stop

PrivateTmp=true

 

[Install]

WantedBy=multi-user.target

保存退出!

 

[Unit]:服务的说明

Description:描述服务

After:描述服务类别

[Service]服务运行参数的设置

Type=forking是后台运行的形式

ExecStart为服务的具体运行命令

ExecReload为重启命令

ExecStop为停止命令

PrivateTmp=True表示给服务分配独立的临时空间

注意:[Service]的启动、重启、停止命令全部要求使用绝对路径

[Install]服务安装的相关设置,可设置为多用户

 

2.设置开机自启动

systemctl enable zentao

3.其他命令

# 启动zentao服务

systemctl start zentao

# 设置开机自启动

systemctl enable zentao

# 停止开机自启动

systemctl disable zentao

# 查看服务当前状态

systemctl status zentao

# 重新启动服务

systemctl restart zentao

# 查看所有已启动的服务

systemctl list-units --type=service | grep running

 

4.重启服务器测试是否自动启动了“禅道”服务

ps aux | grep zbox

 

参考自其他博客:(1)https://www.jianshu.com/p/7fc2da0fdc4a

(2)https://www.cnblogs.com/yinrw/p/10103748.html

(3)https://blog.csdn.net/q13554515812/article/details/83718583

Guess you like

Origin www.cnblogs.com/shanheyongmu/p/12111391.html