itop安装
1、下载itop软件包
[root@itop ~]# hostnamectl set-hostname itop //设置主机名
[root@itop ~]# wget http://downloads.sourceforge.net/project/itop/itop/2.1.0/iTop-2.1.0-2127.zip
[root@itop ~]# yum -y install httpd
[root@itop ~]# unzip iTop-2.1.0-2127.zip -d /var/www/html/itop/
[root@itop ~]# ls -lh /var/www/html/itop/
total 68K
-rw-r--r--. 1 root root 1.4K Dec 17 2014 INSTALL
-rw-r--r--. 1 root root 35K Dec 17 2014 LICENSE
-rw-r--r--. 1 root root 23K Dec 17 2014 README
drwxr-xr-x. 19 root root 4.0K Sep 2 23:39 web
[root@itop 2.x]# ls /var/www/html/itop/web/extensions/
readme.txt
[root@itop 2.x]# cp -r itop-request-mgmt itop-service-mgmt itop-config itop-change-mgmt /var/www/html/itop/web/extensions/
[root@itop 2.x]# ls /var/www/html/itop/web/extensions/itop-change-mgmt itop-config itop-request-mgmt itop-service-mgmt readme.txt
2、安装lamp环境
[root@itop 2.x]# yum -y install epel-release
[root@itop 2.x]# yum -y install php
[root@itop 2.x]# yum -y install mariadb-server
[root@itop 2.x]# yum -y install graphviz
[root@itop 2.x]# yum -y install php-gd
[root@itop 2.x]# yum -y install php-mysqlnd
[root@itop 2.x]# yum -y install php-imap
[root@itop 2.x]# yum -y install php-soap
[root@itop 2.x]# yum -y install php-ldap
[root@itop 2.x]# yum -y install php-mbstring
[root@itop 2.x]# yum -y install php-mcrypt
[root@itop 2.x]# yum -y install php-pecl-zendopcache
3、启动http和数据库服务
[root@itop 2.x]# systemctl start httpd
[root@itop 2.x]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@itop 2.x]# systemctl start mariadb
[root@itop 2.x]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service
[root@itop 2.x]# ss -tunlp | grep 80
tcp LISTEN 0 128 :::80 :::* users:(("httpd",pid=6681,fd=4),("httpd",pid=6680,fd=4),("httpd",pid=6679,fd=4),("httpd",pid=6678,fd=4),("httpd",pid=6677,fd=4),("httpd",pid=6676,fd=4))
[root@itop 2.x]# ss -tunlp | grep 3306
tcp LISTEN 0 50 *:3306 *:* users:(("mysqld",pid=7184,fd=13))
4、设置selinux策略
[root@itop 2.x]# vim /etc/selinux/config
SELINUX=permissive
[root@itop 2.x]# getenforce
Enforcing
[root@itop 2.x]# setenforce 0
[root@itop 2.x]# getenforce //临时设置selinux为允许,重启后生效
Permissive
5、初始化itop
[root@itop 2.x]# yum -y install firefox //下载火狐浏览器安装包
[root@itop 2.x]# ifconfig | head -3
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.211.55.5 netmask 255.255.255.0 broadcast 10.211.55.255
inet6 fe80::21c:42ff:fed8:9762 prefixlen 64 scopeid 0x20<link>
[root@itop 2.x]# firefox http://10.211.55.5/itop/web/
//此时需要新建安装目录,并递归设置属主和属组为apache
[root@itop 2.x]# chown -R apache:apache /var/www/html/itop/web/{conf,data,log,env-production}
[root@itop 2.x]# ls -ld /var/www/html/itop/web/{conf,data,log,env-production}
drwxr-xr-x. 2 apache apache 4096 Sep 3 00:11 /var/www/html/itop/web/conf
drwxr-xr-x. 2 apache apache 4096 Sep 3 00:11 /var/www/html/itop/web/data
drwxr-xr-x. 2 apache apache 4096 Sep 3 00:11 /var/www/html/itop/web/env-production
drwxr-xr-x. 2 apache apache 4096 Sep 3 00:11 /var/www/html/itop/web/log
//刷新浏览器
6、设置数据库参数
[root@itop 2.x]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database itop22 DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.01 sec)
MariaDB [(none)]> grant all on itop22.* to 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.02 sec)
MariaDB [(none)]> flush privileges ;
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> \q
Bye
[root@itop 2.x]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> set max_allowed_packet = 2*1024*1024*10;
ERROR 1621 (HY000): SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
MariaDB [(none)]> set global max_allowed_packet = 2*1024*1024*10;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges ;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> show VARIABLES like '%max_allowed_packet%';
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 1048576 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
2 rows in set (0.00 sec)
MariaDB [(none)]> flush privileges ;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> show VARIABLES like '%max_allowed_packet%';
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 1048576 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
2 rows in set (0.00 sec)
MariaDB [(none)]> \q
Bye
[root@itop 2.x]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show VARIABLES like '%max_allowed_packet%';
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 20971520 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
2 rows in set (0.00 sec)
MariaDB [(none)]> \q
7、登录成功