【CentOS7】安装【iTop 2.6.0】
一:安装Linux操作系统,本测试使用的是CentOS 7
二:安装mysql数据库
本测试使用的是mysql5.7,安装步骤:http://www.xixuefeng.top/archives/643
注意:mysql的端口需要使用默认的3306。(在iTop配置的时候,我没有发现哪里能改端口,所以还是用默认的3306吧)
可以创建一个新的用户用于iTop的配置,也可以用root用户做后续的配置
启动MySQL、确认端口
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
[root@node2 ~]# service mysql start Starting MySQL. SUCCESS! [root@node2 ~]# [root@node2 ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 54 Server version: 5.7.23 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show global variables like 'port'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | port | 3306 | +---------------+-------+ 1 row in set (0.01 sec) mysql> exit Bye [root@node2 ~]# |
三:安装apache
1 2 3 4 5 |
# 确认是否已存在httpd,默认已安装,无需安装 [root@node2 ~]# yum list installed | grep httpd httpd.x86_64 2.4.6-88.el7.centos @base httpd-tools.x86_64 2.4.6-88.el7.centos @base [root@node2 ~]# |
如果未安装,可通过如下命令安装
1 |
[root@node2 ~]# yum install -y httpd |
四:安装php
1)检查当前系统是否已安装了PHP
1 2 3 4 5 6 7 8 9 10 11 |
[root@node2 ~]# yum list installed | grep php php.x86_64 5.4.16-46.el7 @base php-cli.x86_64 5.4.16-46.el7 @base php-common.x86_64 5.4.16-46.el7 @base php-gd.x86_64 5.4.16-46.el7 @base php-ldap.x86_64 5.4.16-46.el7 @base php-mysql.x86_64 5.4.16-46.el7 @base php-pdo.x86_64 5.4.16-46.el7 @base php-soap.x86_64 5.4.16-46.el7 @base php-xml.x86_64 5.4.16-46.el7 @base [root@node2 ~]# |
2)由于最新版本iTop要求php版本是否为5.6(或者以上),所以先删除自带的php
1 |
[root@node2 ~]# yum remove php* |
3)安装php56
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# 添加yum源 [root@node2 ~]# yum install -y epel-release [root@node2 ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm Retrieving http://rpms.famillecollet.com/enterprise/remi-release-7.rpm warning: /var/tmp/rpm-tmp.uWChbA: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY Preparing... ################################# [100%] Updating / installing... 1:remi-release-7.6-1.el7.remi ################################# [100%] [root@node2 ~]# # 安装php5.6 [root@node2 ~]# yum -y install graphviz php56-php php56-php-gd php56-php-mysqlnd php56-php-imap php56-php-soap php56-php-ldap php56-php-mbstring php56-php-mcrypt php56-php-pecl-zendopcache php56-php-xml …… [root@node2 ~]# |
五:上传iTop至/var/www/html目录,并解压缩
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# iTop安装包上传至该目录下 [root@node2 html]# pwd /var/www/html [root@node2 html]# ls iTop-2.6.0.zip [root@node2 html]# # 解压缩 [root@node2 html]# unzip iTop-2.6.0.zip [root@node2 html]# ls iTop-2.6.0 iTop-2.6.0.zip [root@node2 html]# # 修改目录名称,便于后续使用 [root@node2 html]# mv iTop-2.6.0 itop [root@node2 html]# ls itop iTop-2.6.0.zip [root@node2 html]# # 修改itop目录的属主和属组 [root@node2 html]# chown -R apache:apache itop/ [root@node2 html]# [root@node2 html]# ll total 13220 drwxr-xr-x. 24 apache apache 4096 Jan 9 16:53 itop -rw-r--r--. 1 root root 13532606 Feb 28 09:42 iTop-2.6.0.zip [root@node2 html]# |
六:启动httpd服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@node2 html]# systemctl start httpd.service # 验证 [root@node2 html]# systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2019-02-28 16:35:34 CST; 30s ago Docs: man:httpd(8) man:apachectl(8) Main PID: 10349 (httpd) Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service ├─10349 /usr/sbin/httpd -DFOREGROUND ├─10350 /usr/sbin/httpd -DFOREGROUND ├─10351 /usr/sbin/httpd -DFOREGROUND ├─10352 /usr/sbin/httpd -DFOREGROUND ├─10353 /usr/sbin/httpd -DFOREGROUND └─10354 /usr/sbin/httpd -DFOREGROUND Feb 28 16:35:34 node2 systemd[1]: Starting The Apache HTTP Server... Feb 28 16:35:34 node2 httpd[10349]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::1192:848c:5337:8736...his message Feb 28 16:35:34 node2 systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full. [root@node2 html]# |
七:通过地址访问iTop
http://192.168.31.12/itop/
八:配置iTop(略)