1、官网教程
http://www.lepus.cc/
http://suifu.blog.51cto.com/9167728/1770493
2、安装教程
[root@localhost ~]# yum install python-devel mysql-devel zlib-devel openssl openssl-devel
[root@localhost ~]# yum install php.x86_64 -y
[root@localhost /]# yum install python.x86_64 -y
[root@localhost lepus]# yum install php.x86_64
[root@localhost /]# python -V
Python 2.7.1
[root@localhost /]# php -v
PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
3、安装Mysql
请参考:
http://blog.csdn.net/xfg0218/article/details/51244068
[root@localhost /]# mysql -V
mysql Ver 14.14 Distrib 5.6.34, for Linux (x86_64) using EditLine wrapper
4、软件下载
链接:http://pan.baidu.com/s/1sldCOnN 密码:wy41
MySQL 模块下载:
[root@localhost local]# mkdir newlepus
[root@localhost newlepus]# wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip
[root@localhost newlepus]# unzip MySQLdb-python.zip
[root@localhost newlepus]# cd MySQLdb1-master/
[root@localhost MySQLdb1-master]# yum install mysql-devel
[root@localhost MySQLdb1-master]# which mysql_config
/usr/bin/mysql_config
[root@localhost MySQLdb1-master]# vi site.cfg
修改下面的配置:
mysql_config =/usr/bin/mysql_config
[root@localhost MySQLdb1-master]# yum install gcc libffi-devel python-devel openssl-devel
[root@localhost MySQLdb1-master]# python setup.py install
Redis模块下载:
[root@localhost newlepus]# wget http://cdn.lepus.cc/cdncache/software/redis-py-2.10.3.tar.gz
[root@localhost newlepus]# tar zxvf redis-py-2.10.3.tar.gz
[root@localhost redis-2.10.3]# python setup.py install
Mongodb 模块下载:
[root@localhost newlepus]# wget http://cdn.lepus.cc/cdncache/software/pymongo-2.7.tar.gz
[root@localhost newlepus]# tar zxvf pymongo-2.7.tar.gz
[root@localhost newlepus]# cd pymongo-2.7
[root@localhost pymongo-2.7]# python setup.py install
5、安装lepus
软件请去百度链接地址下载,往上爬。
[root@localhost newlepus]# unzip lepus.zip
[root@localhost newlepus]# cd lepus_v3.7/
[root@localhost python]# chmod a+x *.py *.sh
[root@localhost python]# python test_driver_redis.py
Redis python drivier is ok!
[root@localhost python]# python test_driver_mongodb.py
MongoDB python drivier is ok!
[root@localhost python]# python test_driver_mysql.py
MySQL python drivier is ok!
6、在mysql中创建数据库
[root@localhost python]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.34 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> insert into mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values('localhost','lepus',password('lepus'),'BLOB','BLOB','BLOB');
Query OK, 1 row affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql >grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'localhost' identified by 'lepus';
mysql> flush privileges;
[root@localhost lepus_v3.7]# mysql -ulepus -p lepus < sql/lepus_table.sql
[root@localhost lepus_v3.7]# mysql -ulepus -p lepus < sql/lepus_data.sql
7、安装lepus的主程序
[root@localhost python]# ./install.sh
[note] lepus will be install on basedir: /usr/local/lepus
[note] /usr/local/lepus directory does not exist,will be created.
[note] /usr/local/lepus directory created success.
[note] wait copy files.......
[note] change script permission.
[note] create links.
[note] install complete.
8、修改配置文件
[root@localhost python]# cd etc/
[root@localhost etc]# vi config.ini
###监控机MySQL数据库连接地址###
[monitor_server]
host="localhost"
port=3306
user="lepus"
passwd="lepus"
dbname="lepus"
9、开启lepus
[root@localhost etc]# lepus start
10、设置web界面
[root@localhost lepus_v3.7]# cp -rf php/* /var/www/html/
[root@localhost lepus_v3.7]# cd /var/www/html/application/
[root@localhost application]# cd config/
[root@localhost config]# vi database.php
修改一下配置:
$db['default']['hostname'] = 'localhost';
$db['default']['port'] = '3306';
$db['default']['username'] = 'lepus';
$db['default']['password'] = 'lepus';
$db['default']['database'] = 'lepus';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
11、开启服务
[root@localhost config]# service httpd start
[root@localhost config]# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 8582/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1838/cupsd
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 9217/sshd
tcp 0 0 :::3306 :::* LISTEN 8909/mysqld
tcp 0 0 :::80 :::* LISTEN 9555/httpd
tcp 0 0 :::22 :::* LISTEN 8582/sshd
tcp 0 0 ::1:631 :::* LISTEN 1838/cupsd
tcp 0 0 ::1:6010 :::* LISTEN 9217/sshd
12、web界面操作
用户名:admin
密码:Lepusadmin
可参考:
http://www.bubuko.com/infodetail-1098872.html