centos 7搭建testlink
帮忙搭建了个testlink,说实话,不习惯用这个
系统版本
搭建版本testlink
: 1.9.19MySQL
:5.7.25 (mysql -V)PHP
:5.6 (php -v)Linux
:Centos 7.6.1810 (Core) (cat /etc/redhat-release)
前置操作
升级yum:yum update
关闭防火墙:systemctl stop firewalld.service
防火墙禁止自启动:systemctl disable firewalld.service
关闭selinux:sudo sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
安装MySQL
下载源包:
1 | wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm |
安装MySQL源:
1 | yum localinstall mysql57-community-release-el7-8.noarch.rpm |
检查可选包:
1 | yum repolist enabled | grep "mysql.*-community.*" |
1 | mysql-connectors-community/x86_64 MySQL Connectors Community 51 |
可修改配置:/etc/yum.repos.d/mysql-community.repo
选择想要安装的版本,将对应enable
改为1
安装
1 | yum install mysql-community-server |
启动服务:systemctl start mysqld
查看服务状态:systemctl status mysqld
配置开机启动:
1 | systemctl enable mysqld |
安装后配置
修改root密码
查看原始密码:grep 'temporary password' /var/log/mysqld.log
进入控制台mysql -uroot -p
,修改密码
1 | ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpwd'; |
修改权限:
1 | GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpwd' WITH GRANT OPTION; |
创建testlink库
1 | CREATE DATABASE testlink; |
安装Apache
1 | yum install httpd |
配置:
1 | sed -i ‘s/^/#&/g‘ /etc/httpd/conf.d/welcome.conf |
启动:
1 | systemctl start httpd.service |
安装php
直接用yum install php安装的,默认是5.4版本,然而testlink要求至少是5.5(这点坑的我,zabbix直接不能和它装一台机器)
配置yum源:
1 | yum install epel-release |
安装php5.6
1 | yum install php56 php56-php php56-php-mysqlnd php56-php-gd php56-php-mcrypt php56-php-mbstring php56-php-xml php56-php-cli php56-php-ldap |
修改参数:
1 | sed -i "s/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 2880/" /opt/remi/php56/root/etc/php.ini |
安装testlink
下载完成后传到linux下(rz…),解压缩到/var/www/html
目录下
1 | tar -zxvf testlink-1.9.19.tar.gz -C /var/www/html |
重命名:mv testlink-1.9.19 testlink
创建upload_area:mkdir /var/www/html/upload_area
修改项目属主以及日志文件权限:
1 | chown -R apache:apache /var/www/html/testlink |
编辑配置文件
首先是创建(直接把示例文件备份重命名):
1 | cp /var/www/html/testlink/custom_config.inc.php.example/var/www/html/testlink/custom_config.inc.php |
修改配置(日志路径等)可直接vim进入之后查找?log_path
:
1 | // $tlCfg->log_path = ‘/var/testlink-ga-testlink-code/logs/‘; /* unix example */ |
重启Apache
1 | systemctl restart httpd.service |
启动testlink
浏览器输入http://IP/testlink
进入安装页面,依次new installation
->agree license
->continue
开始一堆校验,继续continue
,进入数据库配置页面,依次填写:
1 | Database name:testlink(testlink库名) |
填写完成,点击Process Testlink Setup
结束!
登录testlink
http://IP/testlink
默认账密:admin/admin
以上,完~