ITOP-2 分模块安装部署itop
一、安装PHP组件
1、查看当前Linux服务器安装的PHP版本
php -v
#关闭 php-fpm
#service php-fpm stop
#卸载yum安装的php
#yum remove php-common
2、安装源epel,安装源remi,安装yum-config-manager
yum install epel-release
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
3、用yum-config-manager指定remi的php7.2仓库
yum-config-manager --enable remi-php72
4、安装升级php
yum install php php-mysql php-xml php-cli php-soap php-ldap php-gd php-zip php-json php-mbstring graphviz
5、验证当前PHP的版本
注:如果要安装其它版本,可以把步骤七中的remi-php74改为remi-php72、remi-php71、remi-php70等。
yum -y install httpd unzip
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
二、部署 MySQL 服务
1、设置 Repo
先装阿里的yum源
yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm
2、安装 MySQL
yum install -y mysql-community-server
报错解决:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
3、配置 MySQL
if [ ! "$(cat /usr/bin/mysqld_pre_systemd | grep -v ^\# | grep initialize-insecure )" ]; then
sed -i "s@--initialize @--initialize-insecure @g" /usr/bin/mysqld_pre_systemd
fi
4、启动 MySQL
systemctl enable mysqld
systemctl start mysqld
vim /etc/my.cnf
5、创建数据库、创建库用户、用户授权、修改数据配置
#skip-grant-tables
systemctl restart mysqld
6、修改密码
create database itop DEFAULT CHARACTER SET utf8;
set global validate_password_policy=LOW;
create user 'itop'@'%' identified by 'KXOeyNgDeTdpeu9q';
alter user 'root'@'localhost' identified by 'Admin@123456';
7、允许远程访问
grant all privileges on *.* to root@'%' identified by "Admin@123456";
flush privileges;
8、关闭防火墙和SELinux
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --reload
vim /etc/selinux/config #修改为SELINUX=disabled,重启后生效
SELINUX=disabled
9、启动组件
systemctl start httpd
systemctl start mysqld
systemctl enable httpd
systemctl enable mysqld
10、上传iTop网站程序 /var/www/iTop目录
mkdir -p /var/www/html/itop/
cd /var/www/html/itop
wget https://jaist.dl.sourceforge.net/project/itop/itop/3.2.0/iTop-3.2.0-14524.zip
unzip iTop-3.2.0-14524.zip -d /var/www/html/itop/
wget https://jaist.dl.sourceforge.net/project/itop/itop/2.6.3/iTop-2.6.3-5092.zip
unzip iTop-2.6.3-5092.zip -d /var/www/html/itop/
chown -R apache:apache /var/www/html/itop/
chmod 777 /var/www/html/itop/web/
11、WEB安装过程
浏览器打开 http://IP/itop/web/
#切记打开80端口