RackTables(一)CMDB 资管系统安装

RackTables称自己为一个“机架空间、IP地址、服务器、交换机、路由器等的管理框架”。说白了,个人感觉就是一个CMDB资管软件。本篇就先从安装开始吧。

一、安装数据库

yum -y install  mariadb  mariadb-server
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
在/etc/my.cnf的配置文件中增加“character-set-server=utf8” ,修改完后,重启mariadb服务生效。

具体详细步骤略,这里只写下大略步骤,毕竟这些都是老生常谈的操作了。

二、创建相应的库并授权

这一部也可以后面做,在web界面安装到第三步的时候会有提示,web界面上会给出相应的sql 语句。

CREATE DATABASE racktables CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER cmdb@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON racktables.* TO cmdb@localhost;
flush privileges;

三、安装web、php,并关闭防火墙

yum install httpd php php-mysql php-pdo php-gd php-mbstring php-bcmath
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
# vim /etc/selinux/config修改如下行配置:
SELINUX=disabled

四、web界面安装

这里以apache下的安装为例,打开RackTables官方网站,下载最安装包。最新版为0.21.1,不过稳定版为0.20.14 ,这里选择稳定版。将其下载放到/opt目录 。

tar zxvf RackTables-0.20.14.tar.gz
mv RackTables-0.20.14 cmdb
ln -s /opt/cmdb/wwwroot/index.php  /var/www/html/cmdb/
systemctl start httpd
systemctl enable httpd

安装过程中会有提示修改属主和权限的操作,如下:

touch '/opt/cmdb/wwwroot/inc/secret.php'
chmod a=rw '/opt/cmdb/wwwroot/inc/secret.php'
chown apache secret.php
chmod 440 secret.php

Racktables

安装过程中,第二步组件检测部分,snmp、ldap、https三项检测不通过,可以直接下一步跳过,可以在安装好后,再安装。强迫症例外。

使用nginx的,也可以使用如下conf 文件配置安装(需安装启用php-fpm)

server
 {
   listen       80;
   server_name  192.168.10.233;;
   index index.html index.htm index.php;
   root  /var/www/html/RackTables/wwwroot;
   location ~ .*\.(php|php5)?$
   {
     fastcgi_pass  127.0.0.1:9000;
     fastcgi_index index.php;
     include fastcgi.conf;
   }
   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
   {
     expires      30d;
   }
   location ~ .*\.(js|css)?$
   {
     expires      1h;
   }
   access_log  /logs/nginx/cmdb_access.log;
 }

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注