Project

General

Profile

Support #883

Updated by Daniel Curtis almost 8 years ago

This is a guide for setting up the Open-Source-Billing web app on FreeBSD 10. 

 h2. Prepare the Environment 

 * Make sure the system is up to date: 
 <pre> 
 pkg update && pkg upgrade 
 </pre> 

 * Install a few dependencies: 
 <pre> 
 pkg install git sudo ruby rubygem-bundler 
 </pre> 

 * Add the osb user 
 <pre> 
 pw add user -n osb -s /sbin/nologin -c "Open Source Billing" 
 </pre>  

 h2. Install MariaDB server 

 * Start by installing the mariadb100-server and mariadb100-client packages: 
 <pre> 
 pkg install mariadb100-{server,client} 
 </pre> 

 * Copy a base MariaDB configuration to use: 
 <pre> 
 cp /usr/local/share/mysql/my-small.cnf /var/db/mysql/my.cnf 
 </pre> 

 * Edit the mariadb config to change the max packet size: 
 <pre> 
 vi /var/db/mysql/my.cnf 
 </pre> 
 #* and modify @max_allowed_packet@ to 32M 
 <pre> 
 max_allowed_packet = 32M 
 </pre> 

 * Enable and start MariaDB 
 <pre> 
 echo 'mysql_enable="YES"' >> /etc/rc.conf 
 service mysql-server start 
 </pre> 

 * Prepare the database for use by running the secure installation: 
 <pre> 
 mysql_secure_installation 
 </pre> 
 #* *NOTE*: +Choose a strong root password+ and answer +yes+ to all questions. 

 h3. Create MariaDB Databases and Users 

 * Login to MariaDB and create appropriate databases and users. 
 <pre> 
 mysql -u root -p 
 </pre> 
 #* and run the following SQL queries to create the *osbdb* database and *osbuser* user: 
 <pre> 
 CREATE DATABASE osbdb somedb CHARACTER SET utf8; 

 CREATE USER 'osbuser'@'localhost' IDENTIFIED BY 'SuperSecretPassword'; 

 GRANT ALL PRIVILEGES ON osbdb.* TO 'osbuser'@'localhost'; 

 FLUSH PRIVILEGES; 

 quit 
 </pre> 

 h2. Install Open-Source-Billing 

 * Make the web directory: 
 <pre> 
 mkdir -p /usr/local/www 
 cd /usr/local/www 
 </pre> 

 * Clone the open-source-billing repo from GitHub: 
 <pre> 
 git clone https://github.com/vteams/open-source-billing osb 
 cd osb 
 </pre> 

 * Change the permissions to osb: 
 <pre> 
 chown -R osb /usr/local/www/osb 
 </pre> 

 * Install the required gems: 
 <pre> 
 sudo -u osb bundle install 
 </pre> 

 * Copy config/database.yml.sample to config/database.yml and set your mysql username/password 

 * Create the database tables needed to run: 
 <pre> 
 rake db:create 
 rake db:migrate 
 </pre> 

 h2. Resources 

 * https://github.com/vteams/open-source-billing

Back