技术教程 · 2019年12月14日 0

如何在Debian 10上安装Feng Office

Feng Office是一个用PHP编写的免费开放源代码在线项目管理和协作工具。它是一个基于Web的工具,集成了项目管理,客户关系管理,财务和帐单,可帮助您的组织更好地运行。Feng Office提供了丰富的功能集,包括任务管理,时间跟踪,甘特图,知识管理,日历,时间表,自动警报和提醒等等。冯办公室有社区,专业和企业三个版本。

在本教程中,我们将说明如何在Debian 10 VPS上安装Feng Office Community Edition。

先决条件

  • 运行Debian 10且至少具有2 GB RAM的服务器。
  • 有效的域名指向您的服务器IP。在本教程中,我们将使用example.com域。
  • 在您的服务器上配置了root密码。

开始

开始之前,请使用最新版本更新系统。您可以通过运行以下命令来做到这一点:

apt-get update -y
 apt-get upgrade -y

系统更新后,请重新启动以应用更改。

安装Apache和MariaDB

首先,您需要在服务器上安装Apache Web服务器和MariaDB服务器。您可以通过运行以下命令来安装它们:

apt-get install apache2 mariadb-server -y

一旦安装了这两个软件包,请启动Apache和MariaDB服务,并使用以下命令使它们在系统重启后启动:

systemctl start apache2
 systemctl start mariadb
 systemctl enable apache2
 systemctl enable mariadb

完成后,您可以继续下一步。

安装和配置PHP

默认情况下,Debian 10附带PHP 7.3。您将需要安装PHP版本7.1才能正常运行Feng Office。

首先,使用以下命令安装所需的软件包:

apt-get install software-properties-common ca-certificates apt-transport-https -y

接下来,使用以下命令添加SURY存储库:

wget https://packages.sury.org/php/apt.gpg
 apt-key add apt.gpg
 echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php7.list

接下来,使用以下命令更新存储库并使用所有必需的模块安装PHP:

apt-get install php7.1 php7.1-mysql php7.1-curl php7.1-json php7.1-cgi libapache2-mod-php7.1 php7.1-mcrypt php7.1-xmlrpc php7.1-gd php7.1-mbstring php7.1-common php7.1-soap php7.1-xml php7.1-intl php7.1-cli php7.1-ldap unzip php7.1-zip wget php7.1-readline php7.1-imap php7.1-tidy php7.1-recode php7.1-sq -y

安装完所有软件包后,打开php.ini文件并进行一些设置:

nano /etc/php/7.1/cli/php.ini

更改以下行:

max_execution_time = 300
max_input_time = 300
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M
html_errors = Off
display_startup_errors = Off
log_errors = On
output_buffering = Off

保存并关闭文件。

接下来,打开另一个php.ini文件:

nano /etc/php/7.1/apache2/php.ini

更改以下行:

max_execution_time = 300
max_input_time = 300
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M
html_errors = Off
display_startup_errors = Off
log_errors = On
output_buffering = Off

保存并关闭文件。然后,使用以下命令安装Feng Office所需的其他软件包:

apt-get install catdoc xpdf ghostscript imagemagick wkhtmltopdf -y

一旦安装了所有软件包,就可以继续进行下一步。

配置MariaDB for Feng Office

接下来,您将需要为Feng Office创建数据库和用户。

首先,使用以下命令登录MariaDB shell:

mysql -u root -p

在提示时提供您的root密码,然后使用以下命令为Feng Office创建数据库和用户:

MariaDB [(none)]> CREATE DATABASE fengdb;
 MariaDB [(none)]> GRANT ALL PRIVILEGES ON fengdb.* TO 'fenguser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

接下来,刷新特权并使用以下命令从MariaDB shell退出:

MariaDB [(none)]> FLUSH PRIVILEGES;
 MariaDB [(none)]> EXIT;

完成后,您可以继续下一步。

下载Feng Office

首先,使用以下命令下载Feng Office的最新版本:

wget -O fengoffice.zip --no-check-certificate https://www.fengoffice.com/web/reference.php?dest=latest_version

下载后,使用以下命令解压缩下载的文件:

unzip fengoffice.zip

接下来,使用以下命令将提取的目录移动到Apache Web根目录:

mv fengoffice-3.7.0.5 /var/www/html/fengoffice

接下来,给fengoffice目录适当的权限:

chown -R www-data:www-data /var/www/html/fengoffice
 chmod -R 777 /var/www/html/fengoffice

完成后,您可以继续下一步。

为Feng Office配置Apache

接下来,您将需要创建一个Apache虚拟主机配置文件来服务Feng Office应用程序。您可以使用以下命令进行操作:

nano /etc/apache2/sites-available/feng.conf

添加以下行:

<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/fengoffice
     ServerName example.com

     <Directory /var/www/html/fengoffice/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

完成后保存并关闭文件。然后,使用以下命令启用Apache虚拟主机,标头和重写模块:

a2ensite feng.conf
 a2enmod rewrite
 a2enmod headers

接下来,重新启动Apache Web服务以应用更改:

systemctl restart apache2

您可以使用以下命令检查Apache Web服务器的状态:

systemctl status apache2

您应该获得以下输出:

? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-12-02 07:02:28 EST; 1min 3s ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 2329 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 2333 (apache2)
    Tasks: 7 (limit: 1138)
   Memory: 21.8M
   CGroup: /system.slice/apache2.service
           ??2333 /usr/sbin/apache2 -k start
           ??2334 /usr/sbin/apache2 -k start
           ??2335 /usr/sbin/apache2 -k start
           ??2336 /usr/sbin/apache2 -k start
           ??2337 /usr/sbin/apache2 -k start
           ??2338 /usr/sbin/apache2 -k start
           ??2341 /usr/sbin/apache2 -k start

Dec 02 07:02:28 debian systemd[1]: Starting The Apache HTTP Server...
Dec 02 07:02:28 debian apachectl[2329]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.
Dec 02 07:02:28 debian systemd[1]: Started The Apache HTTP Server.

访问Feng Office Web界面

现在,打开您的Web浏览器并浏览URL http://example.com。您将被重定向到以下页面:

冯办公室安装程序

单击下一步按钮。您应该看到以下页面:

环境检查

确保正确安装了所有先决条件。然后,单击下一步按钮。您应该看到以下页面:

数据库连接

现在,提供您的数据库名称,数据库用户名,密码,选择Core_dimensions和Workspaces模块,然后单击“ 下一步”按钮。您应该看到以下页面:

安装完成

现在,单击完成按钮以完成安装。您应该看到以下页面:

登录到冯

提供您的管理员用户名,电子邮件,密码,然后单击“ 提交”按钮。您将被重定向到Feng Office登录页面:

登录表格

现在,提供您的管理员用户名,密码,然后单击“ 登录”按钮。您应该在以下页面中看到Feng Office仪表板:

丰办公仪表板

让我们加密免费SSL来保护Feng Office

现在已安装并配置Feng Office。接下来,建议使用“让我们加密免费的SSL”保护它的安全。为此,您将需要在服务器上安装Certbot客户端。Certbot是一个Let’s Encrypt客户端,可用于为您的域下载并安装SSL证书。

首先,使用以下命令在服务器中添加Certbot存储库:

add-apt-repository ppa:certbot/certbot

添加存储库后,请更新存储库并使用以下命令安装Certbot:

apt-get update -y
 apt-get install certbot python-certbot-apache -y

Certbot现在已安装并可以使用。

运行以下命令以获取并安装您域的SSL证书:

certbot --apache -d example.com

您将被要求提供您的电子邮件地址并同意服务条款。

将调试日志保存到/var/log/letsencrypt/letsencrypt.log
选择的插件:Authenticator apache,Installer apache
输入电子邮件地址(用于紧急续订和安全通知)(输入“ c”
取消):admin@example.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): admin@example.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

接下来,您将需要选择是否将HTTP流量重定向到HTTPS,删除HTTP访问,如下所示:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

选择选项2为您的域下载并安装免费的SSL证书,然后按Enter键完成安装。

现在,您可以使用URL https://example.com安全地访问您的Feng Office 。

结论

恭喜你!您已在Debian 10服务器上成功安装,配置并保护了Feng Office。现在,您可以使用Feng Office Web界面轻松管理项目。

原文:https://www.howtoforge.com/how-to-install-feng-office-on-debian-10/