web应用托管_自托管的免费发票应用-FusionInvoice

web应用托管

Note that around the exact time of this article’s publication, FusionInvoice 2 was released as commercial software, and is based on Laravel instead of CodeIgniter like previous versions. It is, for all intents and purposes, a completely different application. This article focuses on the older but still fully functional version 1.3.4.

请注意,在本文发布的确切时间附近,FusionInvoice 2作为商业软件发布,并且基于Laravel而非以前版本的CodeIgniter。 出于所有目的和目的,它是一个完全不同的应用程序。 本文重点介绍较旧但仍可正常运行的版本1.3.4。



As a freelancer or a small business your time is better spent creating that next big project or meeting the client’s requirements than keeping track of invoices.

作为自由职业者或小型企业,与跟踪发票相比,最好花时间创建下一个大型项目或满足客户的要求。

FusionInvoice is an open-source, self-hosted invoicing web application built for freelancers and small businesses. Although there are quite a few free online invoicing applications, none of them give you the privacy or the flexibility which FusionInvoice provides. Client management, dashboard and reports, recurring invoicing and invoice history are just few of its features.

FusionInvoice是为自由职业者和小型企业构建的开源,自托管发票网络应用程序。 尽管有很多免费的在线发票应用程序,但它们都没有给您FusionInvoice提供的隐私或灵活性。 客户管理,仪表板和报告,循环发票和发票历史记录只是其中的部分功能。

FusionInvoice being an Open-Source project means that you can always change or add to its functionality as you need it or even install it on a private system, thus limiting the number of users who have access to your sensitive data.

FusionInvoice是一个开源项目,这意味着您可以随时根据需要对其进行更改或添加其功能,甚至可以将其安装在私有系统上,从而限制了可以访问您的敏感数据的用户数量。

Although the application is Open-Source, the developers considered that the community can better help the project by only providing their input and suggestions for features and enhancements they, as a community, would like to see in the project, but development should stay a closed team effort.

尽管该应用程序是开源的,但是开发人员认为,社区可以通过仅提供他们作为社区希望在项目中看到的功能和增强功能的输入和建议来更好地帮助项目,但是开发应保持封闭团队的努力。

This may seem like a strange approach to open source a project, but it looks like it lets the team focus on keeping a constant pace in developing new features and bug fixing.

这对于开源项目来说似乎是一种奇怪的方法,但是看起来它使团队专注于保持开发新功能和错误修复的恒定步伐。

软件需求 (Software requirements)

Since FusionInvoice version 1.3.4 is a CodeIgniter-based project, the basic requirements are quite simple: – PHP 5.3 or newer – MySQL 5.0 or newer – Apache or Nginx server

由于FusionInvoice 1.3.4版是基于CodeIgniter的项目,因此基本要求非常简单:– PHP 5.3或更高版本– MySQL 5.0或更高版本– Apache或Nginx服务器

Let’s check if your system meets these requirements. Run the following command in your terminal to check the PHP version that is installed:

让我们检查您的系统是否满足这些要求。 在终端中运行以下命令以检查已安装PHP版本:

$ php -v

If PHP is properly installed you should receive an output similar to this one:

如果正确安装了PHP,您应该会收到类似于以下内容的输出:

PHP 5.5.3-1ubuntu2.1 (cli) (built: Dec 12 2013 04:24:35) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

Now let’s check the MySQL version by running the command below in your MySQL prompt:

现在,通过在MySQL提示符下运行以下命令来检查MySQL版本:

mysql> SHOW VARIABLES LIKE "%version%";

If the MySQL server is properly installed and running, you should now see an output similar to the one below.

如果MySQL服务器已正确安装并正在运行,那么您现在应该会看到类似下面的输出。

+-------------------------+-------------------------+
| Variable_name           | Value                   |
+-------------------------+-------------------------+
| innodb_version          | 5.5.34                  |
| protocol_version        | 10                      |
| slave_type_conversions  |                         |
| version                 | 5.5.34-0ubuntu0.13.10.1 |
| version_comment         | (Ubuntu)                |
| version_compile_machine | x86_64                  |
| version_compile_os      | debian-linux-gnu        |
+-------------------------+-------------------------+

Depending on your server setup the version numbers might be different but the output should be similar.

根据您的服务器设置,版本号可能会有所不同,但输出应该相似。

Ok, since the requirements on this VM are met let’s proceed to the next section.

好的,因为满足了此VM的要求,所以让我们继续下一节。

下载FusionInvoice应用程序 (Download the FusionInvoice application)

First, let’s create the folder where we would like to install FusionInvoice, by running the command below:

首先,通过运行以下命令,创建要在其中安装FusionInvoice的文件夹:

$ cd /var/www/
$ sudo mkdir -m 755 fusioninvoice

Note: I am assuming that you are on a *nix platform (if on Windows, please use Vagrant to set up a working environment), and are using the default Apache/Nginx configuration and have /var/www as your base document root folder. Otherwise, change the path to the one you’re using.

注意:我假设您使用的是* nix平台(如果在Windows上,请使用Vagrant设置工作环境),并且使用默认的Apache / Nginx配置,并将/var/www作为基本文档根文件夹。 否则,将路径更改为您正在使用的路径。

You can download version 1.3.4 from Github. After you do, unzip it into your websites folder (www as mentioned above).

您可以从Github下载1.3.4版本。 完成后,将其解压缩到您的网站文件夹(如上所述的www)中。

创建数据库 (Create the database)

Now we need to create a database where FusionInvoice would store its data. There are two ways to do this, command line or phpMyAdmin. I personally recommend the command line if you are installing FusionInvoice on a production or world available server.

现在,我们需要创建一个数据库,FusionInvoice将在该数据库中存储其数据。 有两种方法可以执行此操作,即命令行或phpMyAdmin。 如果要在生产服务器或全球可用的服务器上安装FusionInvoice,我个人建议使用命令行。

a) From the mysql prompt execute the following commands:

a)在mysql提示符下执行以下命令:

mysql> CREATE DATABASE `fusion_invoice`;
mysql> CREATE USER 'fusion_invoice'@'localhost' IDENTIFIED BY 'fusion_pass';
mysql> GRANT ALL PRIVILEGES ON `fusion_invoice`.* TO 'fusion_invoice'@'localhost' IDENTIFIED BY 'fusion_pass';

b) Using phpMyAdmin, go to the USERS tab and select Add user. In the new user form fill-in all the fields and make sure you check the Create database with same name and grant all privileges checkbox and phpMyAdmin will create the database for you.

b)使用phpMyAdmin,转到“ USERS选项卡,然后选择“ Add user 。 在新用户表单中,填写所有字段,并确保选中“ Create database with same name and grant all privileges复选框,并且phpMyAdmin将为您创建数据库。

alt

**Note: Please make sure to take ALL necessary security precautions and adjust the new user’s permissions accordingly if you are installing the FusionInvoice application on world available server.

**注意:如果要在全球可用的服务器上安装FusionInvoice应用程序,请确保采取所有必要的安全预防措施并相应地调整新用户的权限。

That’s it! We are now ready to run the FusionInvoice setup module.

而已! 现在,我们准备运行FusionInvoice设置模块。

FusionInvoice的初始配置 (Initial configuration of FusionInvoice)

To start the setup process we need to access the /setup module from your preferred browser:

要开始设置过程,我们需要从您喜欢的浏览器访问/setup模块:

http://[domain-name]/[fusioninvoice]/index.php/setup
alt

**Note: Depending on your server configuration the URL might be a bit different. The idea is that you need to send all your requests that do not map to a physical file to index.php in order to start the FusionInvoice application. If you do not know how to create a virtual host or redirect your requests to index.php you can find an optional step at the end of the article that will guide through this exact process.

**注意:根据您的服务器配置,URL可能有所不同。 这个想法是,您需要将所有未映射到物理文件的请求发送到index.php才能启动FusionInvoice应用程序。 如果您不知道如何创建虚拟主机或将请求重定向到index.php ,则可以在本文结尾处找到一个可选步骤,以指导完成此确切过程。

In step 2, the FusionInvoice setup system is providing us with a list of files and folders which are required to be writable.

在第2步中,FusionInvoice设置系统向我们提供了要求可写的文件和文件夹的列表。

alt

Let’s fix this by running the following commands from the terminal:

让我们通过从终端运行以下命令来解决此问题:

$ cd /var/www/fusioninvoice
$ chmod 777 -R uploads/
$ chmod 777 application/config/database.php 
$ chmod 777 -R application/helpers/mpdf/tmp/

If you refresh the page you should now see all the prerequisites to be properly set up.

如果刷新页面,现在应该看到正确设置的所有先决条件。

alt

In step 3 we have to provide FusionInvoice with the database server connection details.

在第3步中,我们必须为FusionInvoice提供数据库服务器连接详细信息。

alt

If the connection is successful in the next 2 pages FusionInvoice will let you know that the database tables have been properly installed and upgraded.

如果在接下来的2页中连接成功,FusionInvoice将通知您数据库表已正确安装和升级。

alt

Arriving at the last step you will be asked to create a base user, an administrator account.

到达最后一步时,系统将要求您创建一个基本用户,即管理员帐户。

alt

Once this step is finished you will have successfully installed FusionInvoice on your system.

完成此步骤后,您将成功在系统上安装FusionInvoice。

Now, you can log in and start creating those invoices :)

现在,您可以登录并开始创建这些发票:)

在服务器上创建虚拟主机 (Create a virtual-host on your server)

This optional step will guide you through the process of creating a basic virtual host on Apache or Nginx.

此可选步骤将指导您完成在Apache或Nginx上创建基本虚拟主机的过程。

**Important note: Although many of the virtual host settings that are presented in this article are used also in production they are only a starting point and in no way should they be considered sufficient, from a security perspective, for a production server. Please make sure you’ve taken all the necessary precautions to secure your server.

**重要说明:尽管本文中介绍的许多虚拟主机设置也已在生产中使用,但它们只是一个起点,从安全角度来看,对于生产服务器而言,绝不认为它们是足够的。 请确保已采取所有必要的预防措施来保护服务器安全。

a) Setting up an Apache virtual-host

a)设置一个Apache虚拟主机

First, let’s make sure Apache has the mod_rewrite module active. You can check that by running the following command:

首先,让我们确保Apache激活了mod_rewrite模块。 您可以通过运行以下命令进行检查:

$ apache2ctl -t -M

The above command will list all the modules loaded by the Apache2 server. If the mod_rewrite module is loaded you should see an entry like the following: rewrite_module (shared)

上面的命令将列出Apache2服务器加载的所有模块。 如果加载了mod_rewrite模块,您应该看到类似以下的条目: rewrite_module (shared)

If the above line is not present run the next command in your terminal to enable the module:

如果上面的行不存在,请在终端中运行以下命令以启用该模块:

$ sudo a2enmod rewrite

Now that the mod_rewrite module is active we need to create a config file for our new host. You can do that by running the following command in your terminal:

现在,mod_rewrite模块已处于活动状态,我们需要为新主机创建一个配置文件。 您可以通过在终端中运行以下命令来执行此操作:

$ sudo vim /etc/apache2/sites-available/fusion_invoice.dev.conf

Now copy the code below to your config file, and edit the paths to match yours:

现在,将以下代码复制到您的配置文件中,然后编辑与您的路径匹配的路径:

<VirtualHost *:80>
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/fusioninvoice

            ServerName fusion.invoice.dev #change this setting according to your domain name

            DirectoryIndex index.php

            <Directory /var/www/fusioninvoice>
                RewriteEngine On
                RewriteBase /

                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule ^(.*)$ index.php [QSA,L]
            </Directory>

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

Now save and close your editor and run the following command in your terminal:

现在保存并关闭编辑器,并在终端中运行以下命令:

$ sudo a2ensite fusion_invoice.dev.conf
$ sudo service apache2 restart

That is all. You can now use your new URL, fusion.invoice.dev, instead of localhost or the VM’s IP address.

就这些。 现在,您可以使用新的URLfusion.invoice.dev,而不是localhost或VM的IP地址。

b) Setting up a Nginx virtual-host

b)设置一个Nginx虚拟主机

Let’s create the config file for our new virtual-host by running the following command in your terminal:

通过在终端中运行以下命令,为新的虚拟主机创建配置文件:

$ sudo vim /etc/nginx/sites-available/fusion_invoice.dev.conf

Now copy the code below to your config file, and edit the paths to match yours:

现在,将以下代码复制到您的配置文件中,然后编辑与您的路径匹配的路径:

server {
    listen        80;

    server_name   fusion.invoice.dev; #change this setting according to your domain name

    root          /var/www/fusioninvoice; # path to fusioninvoice's install directory

    error_log     /var/log/nginx/fusion.error.log debug;

    access_log    /var/log/nginx/fusion.access.log;

    index         index.php;

    location ~ ^(.+\.php)(.*)$ {
      fastcgi_split_path_info  ^(.+\.php)(.*)$;
      fastcgi_pass       unix:/var/run/php5-fpm.sock;
      include            fastcgi_params;
      fastcgi_param      HTTPS off; #this is required for development mode
      fastcgi_param      PATH_INFO $fastcgi_path_info;
      fastcgi_param      SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    }

    location / {
      try_files          $uri $uri/ /index.php?$args;
    }
}

Now that we created the config, on *nix systems you need to create a symbolic link from the file’s current location into /etc/nginx/sites-enabled folder in order for Nginx to load the new virtual-host.

现在我们已经创建了配置,在* nix系统上,您需要创建一个从文件当前位置到/etc/nginx/sites-enabled文件夹的符号链接,以便Nginx加载新的虚拟主机。

You can create the symlink by running the next command in your terminal:

您可以通过在终端中运行以下命令来创建符号链接:

$ sudo ln -s /etc/nginx/sites-available/fusion_invoice.dev.conf  /etc/nginx/sites-enabled/fusion_invoice.dev.conf

Again, alter all paths to match yours. Now, let’s restart the Nginx server to load our new virtual-host config.

同样,更改所有路径以匹配您的路径。 现在,让我们重新启动Nginx服务器以加载我们的新虚拟主机配置。

$ sudo service nginx restart

If all went well you should now be able to access your new virtual host using the server name instead of the machine’s IP address or localhost.

如果一切顺利,您现在应该可以使用服务器名称而不是计算机的IP地址或本地主机来访问新的虚拟主机。

从网址中删除“ index.php”条目 (Remove the ‘index.php’ entry from the URL)

Now that we have created a virtual host let’s also remove the index.php from the URL and have some nice, easy to remember URLs. For that, we just need to open the config.php file, located at /var/www/fusioninvoice/application/config/, and edit the following line:

现在我们已经创建了虚拟主机,我们还从URL中删除index.php ,并拥有一些易于记忆的URL。 为此,我们只需要打开位于/var/www/fusioninvoice/application/config/config.php文件,然后编辑以下行:

$config['index_page'] = 'index.php';

Now just delete the index.php value and save the file.

现在,只需删除index.php值并保存文件即可。

结论 (Conclusion)

The abundance of features, the relatively low level of technical knowledge required to set up and manage the application along with an active community ready to help, make FusionInvoice a great tool for any freelancer or small-business owner who wants to spend the time on the project rather then on tracking invoices.

丰富的功能,建立和管理应用程序所需的相对较低的技术知识以及活跃的社区随时乐意为您提供帮助,FusionInvoice对于想要在此花费时间的自由职业者或小型企业所有者来说,是一个很好的工具而不是跟踪发票。

翻译自: https://www.sitepoint.com/self-hosted-free-invoicing-app-fusioninvoice/

web应用托管

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值