Production Install

Caution: sysadmin and programming skills required.

Wealthbot.io is a sophisticated financial framework, therefore initial set-up requires some system administration skills and a good idea of how frameworks and database-driven web applications behave and work in general. You should be aimed with some preliminary knowledge of how to properly setup a fully-functional LAMMP stack (and what that “really” means and entails).

  • Linux
  • Apache
  • MySQL and MongoDB
  • PHP (Symfony 2)

Linux

Nowadays it’s easy and inexpensive to get your own dedicated linux server. There are many cloud providers, such as Amazon Web Services, Linode, PagodaBox or Digital Ocean to name a few.
Webo team recommends using AWS as they are very robust, offer a multitude of services (besides just a basic web server) and overall when you need to scale your application to service thousands of clients, you won’t have to move wealthbot.io to a new hosting provider.

Do NOT install Webo on a shared host or a cheap hosting provider. Wealthbot.io can probably work on such platforms, but you may run into issues with security and inability to configure certain apache or PHP modules.

If you simply wish to play around with the features, please use the provided vagrant box, which will serve as your own fully-functional development server. If so, and you simply want to demo the vagrant box sandbox… you may run wealthbo.io perfectly well on any modern laptop. This guide is for those, who really want to install webo as a production-ready instance.

We recommend using Ubuntu or Debian, however wealthbot.io can run on any OS (including windows). As long as your OS can run PHP and allow connections to databases, you should be fine.

The LAMP stack installation is quite easy on Ubuntu:
https://help.ubuntu.com/community/ApacheMySQLPHP

However we’ll got into some details below to make sure your system has all the necessary tools and prerequisites.

Apache

You’ll need to know how to install apache and setup a virtual host.

On most ubuntu systems all you’d need to do is run:
sudo apt-get install apache2

And point your virtual host to the webroot directory of the project.

As an example, if you cloned your wealthbot.io installation into
/srv/www/wealthbot

You would point your apache virtual host to:
/sr/www/wealthbot/web

Here’s an example file:

<VirtualHost *:80>
 ServerName test.wealthbot.io
  DocumentRoot /srv/www/wealthbot/web
    <Directory /srv/www/wealthbot/web>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ /app_dev.php [QSA,L]
        </IfModule>
    </Directory>
</VirtualHost>

If you are just trying things out locally you may edit your /etc/hosts file, or similar one on your system, to someting like 120.0.0.1 local.weathbot.io.
You should take care to make sure your ServerName matches the name you provide in your hosts file (or DNS in production).

Note the line:

RewriteRule ^(.*)$ /app_dev.php [QSA,L]

This is a Symfony 2 setup to run in “development” mode, hence the app_dev.php. In production you’d use app.php.For more details on symfony setup, see here:
http://symfony.com/doc/current/quick_tour/the_big_picture.html
(This is for reference only, you do not need to follow the steps provided at the above link).

Please ensure that you have “mod_rewrite” enabled in your apache2 modules
sudo as2enmod rewrite

You may also use Nginx as your server, the setup should be similar to the virtual host above. You need to ensure that webroot is pointed to the right directly and your nginx can serve PHP files and properly forward requests from app.php or app_dev.php

Databases (MySQL / MongoDB)

Setting up databases for webo is easy. The only thing you need to take care of is to make sure you have both databases installed. And you MUST install the php-mongo driver:
https://github.com/mongodb/mongo-php-driver

In most cases to install the MySQL DB is as easy as to run the following commands:

sudo apt-get install mysql-client-core-5.5 
sudo apt-get install mysql-server-core-5.5

Mongo installation is a little more involved:
https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

And for this reason we recommend going with a provider like mongolabs who take care of the all hard work for you. They have some reasonably priced and free starter plans.

PHP

We recommend using the latest PHP 5.6.x version (at the time of writing).

A few PHP modules will need to be installed for wealthbot to be fully functional.

  • PHP mongo driver v1.6 or higher
  • ImageMagick library
  • PHP-apc

Note, if you are encountering strange errors after installation, we recommend that you create an info.php file with simple (or use php -i and grep).
This way you can easily see which modules are available and enabled as well as their corresponding settings.

Symfony 2 and Wealthbot.io

Wealthbot.io is written on top of a very flexible and sophistacted PHP MVC frmework -- Symfony 2.

After setting up your LAMMP stack and cloning the wealthbot.io repository you will need to run a few commands to finalize the setup of the Webo application. At this point we will leverage a toolset from Symfony2 as well as composer to perform final installation tasks.

Composer is a popular dependency and package manager for PHP projects, it’s very easy to setup and install. Just follow the two-command example here:

https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx

At this point your web server, databases, necessary php modules and composer are all installed and functional. You have cloned the wealthbot.io repository to your server and now we are ready to populate our databases with some seed data (to login and play around wtih features).

To get started with the actual wealthbot application, let’s run the following commands

cd /srv/wealthbot
composer clear-cache
composer install --prefer-source

This will use composer to pull down the necessary set of packages and PHP libraries to bring the application to life.

app/console doctrine:database:create
app/console doctrine:schema:create
app/console doctrine:fixtures:load

The above commands will setup database structure, create the schema and load the necessary seed data to start playing with some features of the wealthbo.io platfom.

The end.

Now you should have a fully functional wealthbot.io installation running on top of LAMMP stack.

Next steps.

We recommend that you ensure the following security protocols.

  • Make sure all systems tests are passing
  • Ensure SSL encryption in your web site testing
  • If possible, secure backend portion of the welathbot.io behind a VPC/VPN
  • Enlist a 3rd party verification service anyone from mcafee to fair isaaks to kpmg to do a security audit of your system. As any ethical and financially responsible business, this is common practice. It also very common place in healthcare and ecommerce industries. Although wealthbo.io does not perform any financial transactions, a lot of sensitive personal data, such as social security numers are stored in the webo database, therefore extra caution is urged when protecting this data
  • Use a Load Balancer. Although you can comfortoably run wealthbo.io on a single server, when in production it is always a good idea to have at least two web servers for failover purposes. It is worth $100/month (based on average pricing nowadays) to ensure your systems do not go down if one server fails for whatever reason.
  • Likewise when using databases it is highly recommended not only to take extra steps in securing them, but also to use failover and replica capabilities of both MySQL and MongoDB to to ensure system stability