密码管理平台ratticdb的部署,在centos7上的部署
一,前言
一直想用ratticdb这个有web界面的密码管理工具,百度了一下居然没有找到中文的部署文档,访问官网也是notfound。找到了官方的部署指南:https://github.com/tildaslash/RatticWeb/wiki/Development,感觉写的太简略了,部署中出了很多问题无法解决。
然后我又找了一篇印度小哥写的部署指南:https://linoxide.com/tools/setup-ratticdb-ubuntu-16-04/ ,写的很详细,但是我的系统是centos7的,还是有些差别,于是一路摸索终于部署成功,在此记录下部署步骤,也算是对印度小哥文章的汉化和centos版。可惜的是ratticdb已于2015年8月停止更新,本文使用ratticdb最后一个版本进行安装。
二,部署准备
机器配置:2核4G
磁盘:50G
操作系统:centos7.3
数据库版本:5.5.56-MariaDB
三,部署以及配置
1,安装apache,mysql和相关依赖包
yum install httpd php git gcc mariadb mariadb-client python-setuptools gcc openssl libxml2 python-dev libxml2-dev libxslt1-dev zlib1g-dev libldap2-dev python-ldap python-mysqldb gettext apache2-dev libmysqlclient-dev libsasl2-dev python-dev libldap2-dev libssl-dev pyflakes python-pip libevent-devel libxml2 libxslt libxslt-devel
2,安装pip工具
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
3,添加主机名解析
vim /etc/hosts
172.16.1.1 test.mima.com
此处ip和域名仅作为示例,请根据实际情况做调整,下文出现的域名和ip配置同理。
4,创建程序目录并下载安装ratticweb
cd /opt
mkdir apps
cd apps
git clone https://github.com/tildaslash/RatticWeb.git
cd RatticWeb/
/usr/local/bin/pip install -r requirements-mysql.txt -r requirements-dev.txt
5,在mysql里创建数据库和用户
mysql -u root -p
mysql> create database rattic CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql> SET GLOBAL innodb_file_per_table = ON, innodb_file_format = Barracuda, innodb_large_prefix = ON;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON rattic.* TO 'rattic'@'localhost' identified by 'somepassword';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
6, 配置RatticWeb
vim /opt/apps/RatticWeb/conf/defaults.cfg 进行如下配置没有的就新增
[ratticweb]
secretkey = 123456
timezone = Asia/Shanghai
hostname = test.mima.com #此处填写你自己的域名
static = /opt/apps/RatticWeb/static
[database]
engine = django.db.backends.mysql
# The name of the database (or its filename for sqllite)
name = rattic
user = rattic
password = somepasswd
host = localhost
port = 3306
7,修改Python配置并进行rattic初始化
cd /usr/lib/python2.7/site-packages/
rm -rf kombu/transport/django/migrations djcelery/migrations
mv kombu/transport/django/south_migrations kombu/transport/django/migrations
mv djcelery/south_migrations djcelery/migrations
cd /opt/apps/RatticWeb/
root@demohost:/opt/apps/RatticWeb# ./manage.py syncdb
root@demohost:/opt/apps/RatticWeb# ./manage.py migrate 【创建和配置数据库】
root@demohost:/opt/apps/RatticWeb# mkdir static 【创建静态目录】
root@demohost:/opt/apps/RatticWeb# ./manage.py collectstatic -c --noinput 【填充静态文件目录】
root@demohost:/opt/apps/RatticWeb# ./manage.py demosetup【创建初始用户accoun】
8,安装配置mod_wsgi
yum install mod_wsgi
yum install mod_ssl
安装完成之后,mod_wsgi.so会在Apache的modules目录中
在/etc/httpd/conf/httpd.conf文件中添加以下内容
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule ssl_module modules/mod_ssl.so
9,生成证书并配置apache的ssl服务
这里生成的是自签名证书,如果对于安全性有更高的要求请使用权威CA机构颁发的证书文件
mkdir /etc/ssl/private/
mkdir /etc/ssl/certs
root@demohost:~# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/demohost.com.key -out /etc/ssl/certs/demohost.com.crt
Generating a 2048 bit RSA private key
........................................+++
.......+++
writing new private key to 'demohost.com.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:xiaoxun
Common Name (eg, your name or your server's hostname) []:test.mima.com 【这一项写自己需要配置的域名】
Email Address []:
vim /etc/httpd/conf/httpd.conf
新增
ServerAdmin root@localhost
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
vim /etc/httpd/conf.d/ssl.conf
Listen 443 https
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
# Inter-Process Session Cache:
# Configure the SSL Session Cache: First the mechanism
# to use and second the expiring timeout (in seconds).
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
# Pseudo Random Number Generator (PRNG):
# Configure one or more sources to seed the PRNG of the
# SSL library. The seed data should be of good random quality.
# WARNING! On some platforms /dev/random blocks if not enough entropy
# is available. This means you then cannot use the /dev/random device
# because it would lead to very long connection times (as long as
# it requires to make more entropy available). But usually those
# platforms additionally provide a /dev/urandom device which doesn't
# block. So, if available, use this one instead. Read the mod_ssl User
# Manual for more details.
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
#SSLRandomSeed startup file:/dev/random 512
#SSLRandomSeed connect file:/dev/random 512
#SSLRandomSeed connect file:/dev/urandom 512
#
# Use "SSLCryptoDevice" to enable any supported hardware
# accelerators. Use "openssl engine -v" to list supported
# engine names. NOTE: If you enable an accelerator and the
# server does not start, consult the error logs and ensure
# your accelerator is functioning properly.
#
SSLCryptoDevice builtin
<IfModule mod_ssl.c>
<VirtualHost *:443>
#ServerAdmin webmaster@demohost.com
SSLEngine on
SSLCertificateFile /etc/ssl/certs/demohost.com.crt
SSLCertificateKeyFile /etc/ssl/private/demohost.com.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
Alias /robots.txt /opt/apps/RatticWeb/static/robots.txt
Alias /favicon.ico /opt/apps/RatticWeb/static/favicon.ico
AliasMatch ^/([^/]*\.css) /opt/apps/RatticWeb/static/styles/$1
Alias /media/ /opt/apps/RatticWeb/media/
Alias /static/ /opt/apps/RatticWeb/static/
<Directory /opt/apps/RatticWeb/static>
Require all granted
</Directory>
<Directory /opt/apps/RatticWeb/media>
Require all granted
</Directory>
WSGIScriptAlias / /opt/apps/RatticWeb/ratticweb/wsgi.py
WSGIPassAuthorization On
WSGIDaemonProcess rattic processes=2 threads=25 home=/opt/apps/RatticWeb/ python-path=/opt/apps/RatticWeb display-name=%{GROUP}
WSGIProcessGroup rattic
<Directory /opt/apps/RatticWeb/ratticweb>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
</IfModule>
10,重启Apache
systemctl restart httpd.service
11,用浏览器访问网页
访问https://test.mima.com
必须域名访问,不然会报400错误
没有做公网解析的域名可以通过给自己电脑配置hosts访问。
Windows下hosts文件的地址是:C:\Windows\System32\drivers\etc\hosts
密码管理平台ratticdb的部署,在centos7上的部署的更多相关文章
- Redis介绍及部署在CentOS7上(一)
0.Redis目录结构 1)Redis介绍及部署在CentOS7上(一) 2)Redis指令与数据结构(二) 3)Redis客户端连接以及持久化数据(三) 4)Redis高可用之主从复制实践(四) 5 ...
- Docker(2)--Centos7 上安装部署
Centos7 上安装docker Docker从1.13版本之后采用时间线的方式作为版本号,分为社区版CE和企业版EE. 社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务,比 ...
- kvm+webvirtmgr在centos7上的部署
#!/bin/bash #+++++++++++++++++++++++++++++++++++++++++++++++++++++++安装配置kvm并创建虚拟机+++++++++++++++++++ ...
- docker 在 centos7.* 上的部署及问题解决
最近尝试搭建docker 环境,其实个人是比较喜欢“菜鸟学习系列”的知识的,怎奈它的讲解是以Ubuntu为主的,最后找到一个搭建学习系列,感觉写的很好,主要是页面风格清晰明了,遂决定按照此教程学习搭建 ...
- CentOS7上手动部署入门级kubernetes
前言 翻看了很多的kubernetes的安装教程,也反复做了一些实验,深感教程之复杂,所以决定写一个极简版本的安装教程,目标在于用尽可能少的参数启动服务,并且剖析各组件关系,然后再在此基础上逐步添加参 ...
- 在centos7上安装部署hadoop2.7.3和spark2.0.0
一.安装装备 下载安装包: vmware workstations pro 12 三台centos7.1 mini 虚拟机 网络配置NAT网络如下: 二.创建hadoop用户和hadoop用户组 1. ...
- asp.net Core 部署到CentOs7上,使用Nginx做代理
一.CentOs7部署Nginx 1.准备工作 Nginx的安装依赖于以下三个包,意思就是在安装Nginx之前首先必须安装一下的三个包,注意安装顺序如下: 1 SSL功能需要openssl库,直接通过 ...
- Spring Boot框架开发的Java项目在CentOS7上的部署
需求:上级拿来一份Spring Boot框架开发的Java项目代码让我在服务器上运行起来,只说了一句该框架是自带了Tomcat(不用重新安装Tomcat),一份代码下有两个项目(一个管理端项目,一个用 ...
- vs2017创建dotnetcore web项目,并部署到centos7上
一.打开vs2017创建web项目 二.简单的创建项目后,发布项目 三. 在centos上创建webroot目录,将发布的项目文件复制到该目录下(本人用虚拟机测试) 四.在webroot目录下打开终端 ...
随机推荐
- Centos快速安装Docke
预备 删除旧docker # 删除旧docker $ sudo yum remove docker \ docker-client \ docker-client-latest \ docker-co ...
- Docker学习第一天(Docker入门&&Docker镜像管理)
简介 今天小区的超市买零食老板给我说再过几天可能就卖完了我有点诧异,老板又说厂家不生产了emmm 今天总算开始docker了! 1.Docker? 1.什么是Docker Docker 是一个开源的应 ...
- 为什么 @Value 可以获取配置中心的值?
hello,大家好,我是小黑,好久不见~~ 这是关于配置中心的系列文章,应该会分多篇发布,内容大致包括: 1.Spring 是如何实现 @Value 注入的 2.一个简易版配置中心的关键技术 3.开源 ...
- 如何使用会声会影制作动态logo字幕
日常生活中大家在参加一些婚礼.聚会的时候,LED屏幕上播放的视频里面常常会有一行字,它随着视频的播放自己也在不断地改变颜色,非常醒目.想必大家也想把这种动态文字用在自己的视频中,为视频增添亮点.那么今 ...
- ABBYY FineReader 12/14版本功能对比及14产品优势
FineReader 是一款一体化的 OCR 和PDF编辑转换器,随着版本的更新,功能的增加,FineReader 14的推出继续为用户在处理文档时提高业务生产力,该版本包含若干新特性和功能增强,包括 ...
- MathType单边大括号的编辑技巧你知道吗?
大家都知道,一般情况下,数学里面的括号都是成对出现的,但是也有些情况下可以只用到单边的括号,就比如分段函数,在编写的时候只需用到左半边的括号.MathType作为专业的公式编辑器,用它来编写公式再方便 ...
- 在CorelDRAW2019创建对称绘图模式
对称绘图模式是CorelDRAW 2018推出的全新功能,在2019的版本中又得到了极大的完善,通过对称绘图模式可以创建平衡.和谐.独一无二的效果,对称在大自然中随处可见,因此设计元素很可能将依靠于它 ...
- CorelDRAW多个文件如何批量导出JPG
好多同学对于CorelDRAW 2018批量导出图片格式的操作不太了解.这种情况比较常见,比如设计了一本画册,在同一个文档中页面比较多,如果一页一页导出那将是一项巨大的工程,这时候我们就会想到CDR的 ...
- 思维导图软件iMindMap的使用方法
从手绘的思维导图再到各种各样的思维导图的软件,思维导图的高效性大家都体会到了.思维导图软件iMindMap在众多导图软件中是最受欢迎的之一,下面就给大家分享一下思维导图怎么画: 首先我要教给大家的是如 ...
- 学习netty遇到的关于 LineBasedFrameDecoder 的问题
最近在看<Netty权威指南>这本书,关于TCP粘包/拆包,书中使用的是 LineBasedFrameDecoder 来解决的,但是我在实践的过程中出现了问题,上代码吧. 这个是 serv ...