如何在CentOS 7上基于Apache安装Cerb

一、软件介绍

Cerb是一个用PHP编写使用MySQL或MariaDB作为数据库的工作流和电子邮件自动化系统,非常适合大型团队。

他的主要特性包括:

1.大容量邮件管理。

2.共享邮箱。

3.用于实时监控和目标跟踪的仪表板。

4.实时通知。

5.任务管理器。

6.适配移动设备。

7.基于REST的API。

Cerb是在社区15年的反馈基础上发展起来的,尽管源代码可以在Github上获取,但该软件是在一个名为Devblocks Public license(DPL)的商业开源许可证下分发的,值得注意的是,许可证的发放是基于同时登陆的最大员工数量。

 

二、服务器配置

接下来的步骤里,我们将了解如何安装和配置Cerb所需的工具:Apache、MariaDB和PHP

首先,安装EPEL:

# yum -y install epel-release
 

安装Apache

现在我们将用yum安装网页服务器Apache

# yum install -y httpd
 

开启Apache并用systemd设置开启开机启动

# systemctl start httpd

# systemctl enable httpd
 

检车状态:

# systemctl status httpd




httpd.service - The Apache HTTP Server

 Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)

 Active: active (running)
 

 

三、安装PHP

如介绍所述,Cerb是用PHP语言编写的,更具体地说,我们需要具有以下扩展的PHP5.5或更高版本:

· curl

· dom

· gd

· imap

· pcre

· session

· simplexml

· spl

· xml

· json

· mailparse

· mbstring

· mysqli

· openssl

在本次教程中,我们将使用PHP7,为了安装这个版本,是要使用以下代码添加Remi仓库:

# rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
 

 

打开仓库

# yum-config-manager --enable remi-php71
 

 

现在我们可以安装上面提到的PHP以及他的扩展工具了。

# yum install -y php php-curl php-mysqli php-openssl php-dom 
php-gd php-json php-pcre php-imap php-mbstring php-session 
php-simplexml php-xml php-spl php-mailparse
 

 

我们将需要为Cerb修改一下php.ini文件一下参数file_uploads,memory_limit,upload_max_filesize和post_max_size如下:

file_uploads = On

upload_max_filesize = 64M

memory_limit = 256M

post_max_size = 64M

upload_tmp_dir = /tmp
 

保存设置退出并重启服务:

# systemctl restart httpd
 

 

四、安装MariaDB

现在我们将使用yum安装MariaDB:

# yum install -y mariadb mariadb-server
 

 

开启MariaDB并设置root账户:

# systemctl start mariadb

# mysql_secure_installation
 

在这个过程当中,你会被问到以下几个问题:

New password: 

Re-enter new password: 

Password updated successfully!

Reloading privilege tables..

 ... Success!




Remove anonymous users? [Y/n] 

 ... Success!




Disallow root login remotely? [Y/n] 

 ... Success!







Remove test database and access to it? [Y/n] 

 - Dropping test database...

 ... Success!

 - Removing privileges on test database...

 ... Success!




Reload privilege tables now? [Y/n] 

 ... Success!




Cleaning up...




All done! If you've completed all of the above steps, your MariaDB

installation should now be secure.




Thanks for using MariaDB!
 

 

五、创建新的数据库

下一步,我们将为Cerb创建一个数据库。首先,命令行登录到MariaDB:

# mysql -u root -p
 

 

创建一个新用户和新的数据库:

MariaDB [(none)]> CREATE DATABASE cerbdb;

MariaDB [(none)]> CREATE USER 'cerbusr'@'localhost' IDENTIFIED BY 'usr_strong_password';

MariaDB [(none)]> GRANT ALL PRIVILEGES ON cerbdb.* TO 'cerb'@'localhost' IDENTIFIED BY 'usr_strong_password';

MariaDB [(none)]> FLUSH PRIVILEGES;

MariaDB [(none)]> EXIT;
 

 

六、安装Cerb

下一步下载并且安装Cerb,你需要切换进入Web的根目录:

# cd /var/www/html
 

 

使用git命令克隆Cerb仓库代码:

# git clone git://github.com/wgm/cerb.git cerb
 

 

确保Cerb的文件切换到web服务器群组和用户,Apache的都是www-data

# cd cerb

# chown -R www-data:www-data 

# chmod -R u+w framework.config.php storage
 

framework.config.php是配置文件,storage目录主要存放第三方插件、附件、临时文件

和缓存。

现在打开系统防火墙HTTP的80端口:

# firewall-cmd --zone=public --permanent --add-service=http

# firewall-cmd --reload
 

最后一步,浏览器访问http://localhost/cerb完成Cerb的安装。一旦完成安装,Cerb就可以使用了。

 

七、总结

在本教程中,我们了解到在基于CentOS7和Apache的服务器上,使用MariaDB安装和配置Cerb是多么容易,只要按照指南一步一步操作就可以使用Cerb了,在如今快节奏以及动态的工作环境中,像Cerb这样的工作流和电子邮件自动化系统,可以工作起来让你得心应手。

原文地址:https://www.cnblogs.com/eflypro/p/14848629.html