如何在CentOS 8上安装Invoice Ninja

这是续集。
您可以通过以下链接以PDF格式下载本文,以为我们提供支持。

以PDF格式下载指南


这是续集。

这是续集。
这是续集。

发票忍者是一个免费的开源应用程序,用于生成发票,管理付款,跟踪费用,跟踪时间和任务等。该应用程序是用PHP编写的,并且需要Web服务器(例如Nginx或Apache httpd)来提供Web内容。使用此工具,您可以在安装后几秒钟内生成发票并将其发送给客户。设计具有高度可定制性,它可以轻松地与咨询,服务交付网站或电子商务平台集成。

本文介绍如何在CentOS 8 Linux服务器上安装Invoice Ninja。忍者发票(Invoice Ninja)的一些强大功能包括:

  • 创建定期和自动结算客户
  • 当客户查看和支付账单时发出警报
  • 通过电子邮件发送发票并在线接受付款
  • 接受定金和部分付款
  • 客户端门户密码保护
  • 电子邮件发票; PDF附件
  • 使用公司徽标自定义发票
  • 创建项目任务并在线跟踪时间
  • 创建报价和发票
  • 自动帐单付款通知电子邮件
  • 税项设置或发票总计(按项目)
  • 专业发票模板设计
  • 报价转换为付款发票
  • 等等

某些功能仅可作为商业产品使用。这些包括:

  • 完全可定制的发票设计:将发票的外观与品牌设计相匹配。
  • Zapier集成自动化:使用Zapier的功能将几乎所有应用程序与您的Invoice Ninja帐户集成。
  • 附上发票并将PDF引用到电子邮件:为客户提供共享和提交发票的简便方法。
  • 提案创建工具: 轻松创建漂亮的建议并将其发送给您的客户。
  • 批量发送发票和报价的电子邮件:通过快速选择多张发票并将它们一起通过电子邮件发送来节省时间。
  • 设置未付款发票的自动延迟费用:向客户收取未付款发票的额外费用,并自动收取延期付款费用。
  • 自定义电子邮件主题和正文:调整发票电子邮件文本以提高打开率和品牌知名度。
  • 附上发票并在电子邮件中引用PDF: 为客户提供共享和提交发票的另一种简便方法。

你可以退房 功能比较页面 想要查询更多的信息。

在CentOS 8上安装发票忍者

在具有LAMP(CentOS Linux,Apache Web服务器,MariaDB和PHP)应用程序堆栈的CentOS 8 Linux上安装Invoice Ninja。最低硬件级别要求是 512兆字节 Ram和1 vcpu。

以可以root或sudo身份执行命令的用户身份登录CentOS 8 Linux服务器。

$ ssh [email protected]

访问设备后更新操作系统。

sudo dnf -y update && sudo systemctl reboot

步骤1:安装PHP和所需的扩展

确保您已在CentOS 8 Linux上安装了PHP和所需的扩展。

sudo dnf -y install @php
sudo dnf -y install php-{cli,fpm,gd,mbstring,curl,zip,xml,pdo,mysqlnd,pear,bcmath,json}

检查PHP版本以确保安装成功。

$ php --version
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

启动并启用php-fpm服务。

sudo systemctl enable --now php-fpm

检查状态-必须正在运行。

$ systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2020-07-13 22:39:31 CEST; 10s ago
 Main PID: 2020 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 6 (limit: 12210)
   Memory: 21.3M
   CGroup: /system.slice/php-fpm.service
           ├─2020 php-fpm: master process (/etc/php-fpm.conf)
           ├─2021 php-fpm: pool www
           ├─2022 php-fpm: pool www
           ├─2023 php-fpm: pool www
           ├─2024 php-fpm: pool www
           └─2025 php-fpm: pool www

Jul 13 22:39:31 centos-01.computingforgeeks.com systemd[1]: Starting The PHP FastCGI Process Manager...
Jul 13 22:39:31 centos-01.computingforgeeks.com systemd[1]: Started The PHP FastCGI Process Manager.

步骤2:安装和配置MariaDB数据库

选择MariaDB数据库服务器以运行Invoice Ninja应用程序。您还可以使用其他数据库服务器,例如MySQL和PostgreSQL。

通过在终端上运行以下命令,在CentOS 8 Linux系统上安装MariaDB服务器。

sudo dnf -y install @mariadb

将数据库服务器设置为启动并在系统启动时启动。

sudo systemctl enable --now mariadb

设置root密码以保护数据库服务器并禁用root用户的远程登录。

$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... 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!

为在CentOS 8上运行的Invoice Ninja创建数据库和用户。

$ mysql -u root -p
CREATE DATABASE invoice_ninja;
GRANT ALL ON invoice_ninja.* TO [email protected] IDENTIFIED BY "[email protected]";
FLUSH PRIVILEGES;
QUIT

测试数据库用户连接。

$ mysql -u invoice_ninja -p'[email protected]'
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 17
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| invoice_ninja      |
+--------------------+
2 rows in set (0.003 sec)

MariaDB [(none)]> QUIT
Bye

步骤3:安装和配置Apache httpd服务器

接下来,安装Apache httpd服务器。

sudo dnf -y install @httpd mod_ssl

启动并启用服务。

sudo systemctl enable --now httpd

在防火墙中允许httpd和https服务。

sudo firewall-cmd --add-port={http,https} --permanent
sudo firewall-cmd --reload

安装wget并将其解压缩。

sudo dnf -y install zip wget

下载发票忍者应用程序。

wget  https://download.invoiceninja.com/ -O invoice-ninja.zip

确保文件已下载并本地存储在服务器上。

$ file invoice-ninja.zip
invoice-ninja.zip: Zip archive data, at least v1.0 to extract

解压缩文件。

unzip invoice-ninja.zip

将创建的目录移动到/ var / www / html

sudo mv ninja /var/www/html/invoice-ninja

设置正确的目录权限。

sudo chown -R apache:apache /var/www/html/invoice-ninja
sudo chmod -R 755 /var/www/html/invoice-ninja/storage/

创建一个Apache配置文件。

sudo vi /etc/httpd/conf.d/invoice-ninja.conf

添加以下内容:


    ServerName invoices.computingforgeeks.com
    DocumentRoot /var/www/html/invoice-ninja/public

    
       DirectoryIndex index.php
       Options +FollowSymLinks
       AllowOverride All
       Require all granted
    

    CustomLog /var/log/httpd/invoice_ninja_access.log combined
    ErrorLog /var/log/httpd/invoice_ninja_error.log

检查配置文件的语法。

$ sudo apachectl -t
Syntax OK

步骤4:配置发票忍者域SSL

为了安全起见,您需要获取有效的SSL证书。您可以使用自签名证书,免费的Let’s Encrypt SSL证书或由认可的CA签名的证书。

使用“让我们加密SSL证书”。首先,您需要停止httpd Web服务器。

sudo systemctl stop httpd

下载cerbot工具。

sudo wget https://dl.eff.org/certbot-auto -P /usr/local/bin
sudo chmod a+x /usr/local/bin/certbot-auto

证书申请。

export DOMAIN='invoices.computingforgeeks.com'
export EMAIL="[email protected]"
certbot-auto certonly --standalone -d $DOMAIN --preferred-challenges http --agree-tos -n -m $EMAIL --keep-until-expiring

执行输出:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for invoices.computingforgeeks.com
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/invoices.computingforgeeks.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/invoices.computingforgeeks.com/privkey.pem
   Your cert will expire on 2020-10-11. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again. To non-interactively renew *all* of your certificates, run
   "certbot-auto renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

重新配置Apache以包括HTTPS部分。


    ServerName invoices.computingforgeeks.com
    DocumentRoot /var/www/html/invoice-ninja/public
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/invoices.computingforgeeks.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/invoices.computingforgeeks.com/privkey.pem

    ServerName invoices.computingforgeeks.com
    DocumentRoot /var/www/html/invoice-ninja/public
    
       DirectoryIndex index.php
       Options +FollowSymLinks
       AllowOverride All
       Require all granted
    

    CustomLog /var/log/httpd/invoice_ninja_access.log combined
    ErrorLog /var/log/httpd/invoice_ninja_error.log

重新启动您的Apache Web服务器。

sudo systemctl restart httpd

打开Web浏览器并加载配置的域。必须位于/ etc / hosts或有效的DNS中。

请检查SSL证书信息。

指定URL和数据库连接值。

如何在CentOS 8上安装Invoice Ninja

创建第一个用户成为管理员。

如何在CentOS 8上安装Invoice Ninja

安装完成后,设置您的用户名和密码以登录。

如何在CentOS 8上安装Invoice Ninja

您应该看到一个“发票忍者”仪表板,如下所示:

如何在CentOS 8上安装Invoice Ninja

有关此出色的开票应用程序的更多信息,请参见发票忍者文档页面。

这是续集。
您可以通过以下链接以PDF格式下载本文,以为我们提供支持。

以PDF格式下载指南


这是续集。

这是续集。
这是续集。

Sidebar