关闭防火墙和selinux。
lepus安装ip地址:192.168.1.17
下载解压httpd:
# tar xf httpd-2.2.31.tar.gz
进入httpd-2.2.31
编译命令如下:
# ./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so
如果报错看看是不是没有安装gcc之类的基础环境
# yum install gcc
然后再继续编译安装
# make && make install
# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
# etc/init.d/httpd start
打开网页192.168.1.17 查看 it works显示成功
# rpm -ivh MySQL-client-5.5.45-1.linux2.6.x86_64.rpm MySQL-devel-5.5.45-1.linux2.6.x86_64.rpm MySQL-server-5.5.45-1.linux2.6.x86_64.rpm MySQL-shared-5.5.45-1.linux2.6.x86_64.rpm
# service mysql start
设置mysql密码:
# /usr/bin/mysqladmin -u root password '123456'
# tar -xvf php-5.6.11.tar.gz
# ./configure --with-mysql --with-mysqli --with-mysql-sock --enable-pdo --with-pdo-mysql --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib-dir=/usr/include/zlib.h --with-gd
# make && make install
编译过程中可能会遇到一些错误可能是某些包没有安装可以参考一下CentOS编译PHP5过程中常见错误信息的解决方法
php安装好:
# cat /usr/local/apache/conf/httpd.conf
.........................
DirectoryIndex index.html index.php
application/x-httpd-php .php
.........................
在htdocs文件夹下新建:
# vim index.php
phpinfo();
?>
保存,重启apache服务器,打开网页192.168.1.17查看。
安装 MySQLdb for python
# wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip
# unzip MySQLdb-python.zip
# cd MySQLdb1-master/
# which mysql_config
# /usr/bin/mysql_config
修改文件site.cfg:
# cat site.cfg
mysql_config = /usr/bin/mysql_config
# python setup.py build
# python setup.py install
然后进入python目录下,执行:
#python test_driver_mysql.py
测试有没有安装成功!
解压Lepus软件:
# unzip Lepus数据库企业监控系统3.7_vx.x.x.zip
进入MySQL新建数据库及用户:
mysql> create database lepus default character set utf8;
mysql> grant select,insert,super,update,delete,create on *.* to 'lepus_user'@'192.168.1.17' identified by '123456';
mysql> flush privileges;
mysql> \q
导入SQL文件夹里的SQL文件(表结构和数据文件):
# cd lepus_v3.7
# mysql -uroot –p lepus < sql/lepus_table.sql
# mysql -uroot –p lepus < sql/lepus_data.sql
安装Lpeus程序
进入到软件包的python文件夹
# cd python/
授予install.sh可执行权限,并执行:
# chmod +x install.sh
# ./install.sh
修改配置文件
进入到安装目录,默认为/usr/local/lepus:
# cd /usr/local/lepus/
# cat etc/config.ini
[monitor_server]
host="192.168.1.17"
port=3306
user=" lepus_user "
passwd="123456"
dbname="lepus"
然后启动
# ./lepus start
# cp -rf /root/lepus_3.7/php/* /usr/local/apache2/htdocs/
修改PHP连接监控服务器的数据库信息:
# cat application\config\database.php
$db['default']['hostname'] = '192.168.1.17';
$db['default']['username'] = 'lepus_user';
$db['default']['password'] = '123456';
$db['default']['database'] = lepus;
$db['default']['dbdriver'] = 'mysql';
打开浏览器登录admin/Lepusadmin,添加监控。
如在其他服务器上添加MySQL监控只需要
mysql> grant select,super,process,reload,show databases,replication client on *.* to 'lepus_user'@'192.168.1.17' identified by '123456';
mysql> flush privileges;
然后在监控端的web界面添加即可。