如何在CentOS 7上配置Passbolt自托管密码管理器

ASP站长网Passbolt是一个免费的开源密码管理器,适用于团队。 它允许团队成员安全地存储和共享凭据/密码。 Passbolt是使用PHP创建的,可以在LEMP堆栈下运行或作为docker容器运行。
 
在本教程中,我们将向您展示逐步安装并在CentOS 7服务器上配置开源密码管理器“Passbolt”。 Passbolt是一个用PHP开发的Web应用程序,我们将在LEMP(Linux,Nginx,MySQL/MariaDB和PHP-FPM)下运行它。
 
必要条件
CentOS 7
Root权限
我们将要做什么?
安装依赖项
安装和配置MariaDB数据库
安装Nginx和PHP-FPM
生成SSL Letsencrypt
配置Nginx和PHP-FPM
下载Passbolt并生成OpenPGP密钥
安装Passbolt
Passbolt安装后
其他安全服务器设置
第1步 - 安装依赖项
我们将为本指南做的第一件事是安装Passbolt安装所需的所有包依赖项,包括安装EPEL和Remi PHP存储库,php composer,gcc等。
 
添加EPEL存储库。
 
sudo yum -y install yum-utils epel-release
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
添加并启用Remi PHP存储库。
 
sudo yum -y install 'http://rpms.remirepo.net/enterprise/remi-release-7.rpm'
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
sudo yum-config-manager --enable 'remi-php72'
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
现在使用下面的yum命令安装包依赖项composer,git gcc等。
 
sudo yum -y install unzip wget composer policycoreutils-Python git gcc
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
等待所有软件包安装。
 
第2步 - 安装和配置MySQL / MariaDB
在此步骤中,我们将安装MariaDB数据库,然后为Passbolt安装创建新的数据库和用户。
 
使用下面的yum命令安装MariaDB服务器。
 
sudo yum -y install mariadb-server
 
安装完成后,启动MariaDB服务并使其在系统引导时每次启动。
 
sudo systemctl start mariadb
sudo systemctl enable mariadb
 
现在我们需要为MariaDB配置“root”密码。 运行下面的'mysql_secure_installation'命令。
 
mysql_secure_installation
 
输入新的root密码。
 
并且已配置MariaDB root密码。
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
Remove anonymous users? [Y/n]  这里生产环境建议输入y
 
Disallow root login remotely? [Y/n] 远程登陆
 
Remove test database and access to it? [Y/n]  删除测试数据库并访问它?[Y/ N]
 
Reload privilege tables now? [Y/n]  Y
 
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
 
Thanks for using MariaDB!
 
接下来,使用“root”用户登录MySQL shell。
 
mysql -u root -p
 
使用密码'password-linuxidc'创建一个名为'linuxidccom'的新数据库和用户,在下面运行MySQL查询。
 
create database passbolt;
grant all on passbolt.* to 'linuxidccom'@'localhost' identified by 'password-linuxidc';
flush privileges;
quit;
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
MariaDB服务器已安装在CentOS 7服务器上,并且已创建用于“Passbolt”安装的数据库。
 
第3步 - 安装Nginx和PHP-FPM
安装MariaDB服务器后,我们将使用Remi存储库从EPEL存储库和PHP-FPM软件包安装Nginx。
 
安装Nginx Web服务器。
 
sudo yum -y install nginx
 
安装完成后,启动Nginx服务并使其在系统引导时每次启动。
 
sudo systemctl start nginx
sudo systemctl enable nginx
 
现在使用下面的yum命令安装PHP-FPM以及所需的所有扩展。
 
sudo yum -y install php-fpm php-intl php-gd php-mysql php-mcrypt php-pear php-devel php-mbstring php-fpm gpgme-devel
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
如果安装完成,请启动PHP-FPM服务并在系统引导时每次启动它。
 
sudo systemctl start php-fpm
sudo systemctl enable php-fpm
 
如何在CentOS 7上安装Passbolt自托管密码管理器
 
已安装Nginx Web服务器和PHP-FPM。
 
第4步 - 生成SSL Letsencrypt
在系统上安装certbot工具。
 
sudo yum -y install certbot
 
现在停止nginx服务。
 
sudo systemctl stop nginx
 
并为passbolt域名'linux.linuxidc.com'生成SSL Letsencrypt。
 
运行下面的certbot命令。
 
sudo certbot certonly --standalone --agree-tos --no-eff-email --email linuxidc@linuxidc.com -d linux.linuxidc.com
 
certbot工具将运行临时Web服务器进行验证。
 
完成后,您将在'/etc/letsencrypt/live/'目录中获取证书。

dawei

【声明】:九江站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。