密码管理平台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目录下打开终端 ...
随机推荐
- Docker学习第四天(Dockerfile)
dockerfile Dockerfile是用来构建Docker镜像的构建文件,是由一系列命令和参数构成的脚本 Dockerfile是由一系列命令和参数构成的脚本,这些命令应用于基础镜像并最终创建一个 ...
- [原题复现+审计][网鼎杯 2018] WEB Fakebook(SSRF、反序列化、SQL注入)
简介 原题复现: 考察知识点:SSRF.反序列化.SQL注入 线上平台:https://buuoj.cn(北京联合大学公开的CTF平台) 榆林学院内可使用信安协会内部的CTF训练平台找到此题 过 ...
- day95:flask:SQLAlchemy数据库查询进阶&关联查询
目录 1.数据库查询-进阶 1.常用的SQLAlchemy查询过滤器 2.常用的SQLAlchemy查询结果的方法 3.filter 4.order_by 5.count 6.limit&of ...
- SpringSecurity之授权
SpringSecurity之授权 目录 SpringSecurity之授权 1. 写在前面的话 2. web授权 1. 建库 2. 添加查询权限的接口 3. 前端页面的编写 4. SpringSec ...
- FL Studio带你走进混音的世界
混音,是把多种音源整合到一个立体音轨或单音音轨中,通俗讲就是对多种声音进行调整后叠加在一起,这样可以让音乐听起来非常有层次感,尤其是在电音制作过程中,混音的质量更是起到了决定性的作用.音乐制作软件FL ...
- 详讲FL Studio通道设置菜单
我们在FL Studio"通道设置按钮"上右击鼠标就会弹出一个设置菜单,它包含了通道操作的各种常用命令.下文小编将会为大家详细讲解这些命令的具体作用,一起来学习吧! 1.首先,我们 ...
- C语言讲义——错误处理
errno C语言不提供对错误处理的直接支持. 以返回值的形式表示是否出错. 在发生错误时,大多数的C函数调用返回1或NULL. 同时设置一个错误代码errno(全局变量),表示在函数调用期间发生了错 ...
- 【Go语言绘图】gg 库的基本使用
最近接了个比较大的需求,需要做很多图片处理的事情,比如图片的旋转裁截拼接,各种渐变处理,文字排列,一开始光是想想就头疼.但没有办法,既然已经需求已经到手上了,那就得把它做好才行,于是便开始被迫营业,无 ...
- @RequestParam,@RequestBody,@PathVariable注解还分不清吗?
前言 在使用 SpringMVC 开发时,经常遇到前端传递的各种参数,比如 form 表单,JSON 数据,String[] 数组,再或者是最常见的 String 字符串等等,总之大部分场景都是在标题 ...
- go语言的指针类型
一.指针与引用的相关概念 什么是指针? 指针,全称为指针变量,是用来存储内存地址的一种变量.程序中,一般通过指针来访问其指向的内存地址中的内容(数据). 什么是引用? 引用,是C++中提出来的一种新的 ...