1,安装apache
yum install httpd -y
修改httpd监听端口
vi /etc/httpd/conf/httpd.conf
Listen 80修改为Listen 8080
安装完毕后设置apache系统自启动
systemctl enable httpd
systemctl start httpd
2,安装PHP 5.6
添加yum源
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum安装
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-gd php-ldap php-zip php-fileinfo php-cli php-curl php-mysql
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm --nodeps
yum -y install php56w php56w-mysql php56w-gd libjpeg php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc
yum -y install epel-release
yum groupinstall “development tools”
yum -y install mhash mhash-devel mcrypt
vi /etc/php.ini 找到 /date.timezone date.timezone = PRC 然后重启
3,安装mariadb 10.1
vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.1/centos7-amd64/
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
安装Mariadb之前,你可以先导入GPG key
rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
yum -y install MariaDB-server MariaDB-client
systemctl start mariadb
systemctl enable mariadb
配置IPV4监听
vi /etc/my.cnf添加
[mysqld]
bind-address=0.0.0.0
重启mariadb
systemctl restart mariadb
mysql_secure_installation
命令进行配置(先退出数据库)。
首先是设置密码,会提示先输入密码
Enter current password for root (enter for none):<–初次运行直接回车
设置密码
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
其他配置
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车(后面授权配置)
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车
配置MariaDB的字符集
使用vim /etc/my.cnf.d/server.cnf命令编辑server.cnf文件,在[mysqld]标签下添加:
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
授予外网登陆权限
GRANT ALL PRIVILEGES ON testlink.* TO 'root'@'localhost' IDENTIFIED BY 'JZHL4NewB6^3de' WITH GRANT OPTION;
grant all privileges on *.* to username@'%' identified by 'JZHL4NewB6^3de';
FLUSH PRIVILEGES;
创建数据库
CREATE DATABASE testlink;
4,安装TestLink
4.1 将testlink-1.9.16.tar.gz解压到/var/www/html目录下,将解压后的目录重命名为testlink
4.2 赋予目录访问权限:chown -R apache:apache /var/www/html/testlink
4.3 创建一个自定义的配置文件:
cp /var/www/html/testlink/custom_config.inc.php.example /var/www/html/testlink/custom_config.inc.php
编辑custom_config.inc.php
// $tlCfg->log_path = '/var/testlink-ga-testlink-code/logs/'; /* unix example */
$tlCfg->log_path = '/var/www/html/testlink/logs/';
// $g_repositoryPath = '/var/testlink-ga-testlink-code/upload_area/'; /* unix example */
$g_repositoryPath = '/var/www/html/testlink/upload_area/';
$tlCfg->config_check_warning_mode = 'SILENT';
4.4 将SELINUX 设置为disabled 状态,重启机器
/etc/sysconfig/selinux
4.5 赋予目录写的权限:
chmod 777 -R gui/templates_c
chmod 777 -R logs/
chmod 777 -R upload_area/
重新启动Apache: systemctl restart httpd
4.6 浏览器安装配置Testlink
a)输入IP进行访问testlink默认页面:http://ip:8080/testlink/
b)第一步。点击“安装”
c)点击继续
d)如果没有红色提示,点击’continue’,数据库这里选择mysql,其他不做要求(橙色部分无影响)。红色部分可以提示进行继续定位和解决。
e)通过数据库基本配置后,整个安装过程结束。testlink默认的用户名密码为:admin/admin