How to install WebERP on FreeBSD

This article was written for webERP 4.05 (Phil Daintree distribution) and FreeBSD 8.2

Pre-Requisites

 * Basic FreeBSD server with configured PHP web application stack. See How to build a FreeBSD server, the following references may also be useful:
 * The FreeBSD Handbook by the FreeBSD Project ("The Handbook"),
 * Bulding a Server with FreeBSD 7 by Bryan Hong ("Hong"),
 * Absolute FreeBSD by Michael Lucas ("Lucas"),

Install Procedure
TODO: WEBERP INSTALLATION PROCEDURE TO BE COMPLETED


 * Verify the following php modules are installed:
 * mb_internal_decoding (appears to be required as of 2011/10/01)


 * Login to the Maestro Server as user maestro


 * Download webERP 4.05 from http://www.web-erp.org/ and extract to /usr/home/maestro/www/weberp-4.05/


 * Review /usr/local/www/weberp-4.05/doc/INSTALL.txt


 * Modify permissions on the install directory hierarchy. webERP must have write permission to its install directory to write report files in the /companies directory.
 * Set the owner:group of /usr/local/www/weberp/... to www:www.
 * Set permissions on the files in the directory hierarchy to read-write for owner and group and no permission for others.
 * Set permissions on the directory hierarchy to read-write-execute for owner and group, and no permission for others.


 * 1) chown -R www:www /usr/local/www/weberp
 * 2) chmod -R 660 /usr/local/www/weberp
 * 3) chmod -R a+X /usr/local/www/weberp


 * Create a webERP Apache configuration file /usr/local/etc/apache22/Includes/weberp.conf (read by Apache during start up)

Alias /weberp /usr/local/www/weberp/ AcceptPathInfo On  AllowOverride None Order Allow,Deny Allow from all 


 * Restart Apache so it reads new or edited config files


 * 1) /usr/local/etc/rc.d/apache22 restart


 * Copy the sample webERP configuration file /usr/local/www/weberp/config.distrib.php to /usr/local/www/weberp/config.php and edit as needed:

$allow_demo_mode = False; // do not show demo login name and password $Version = '3.11.2-abpm-01'; // identify as Maestro webERP variant $dbType = 'mysqli'; // for PHP 5 and MySQL > 4.1 $dbuser = 'weberp'; $dbpassword = 'weberp_mysql_password'; $AllowCompanySelectionBox = False; $DefaultCompany = 'scc';


 * Create the SCC database with appropriate privileges using the MySQL command line tool (note that the database name must be identical to the company directory which will be created below, cannot contain a hyphen or other special character, and for consistency with other Maestro component projects should be in lower-case only).

> mysql -u root -p Enter password: mysql> use mysql; mysql> create database scc; mysql> grant all privileges on scc.* to weberp@localhost identified by 'weberp_mysql_password' with grant option; mysql> flush privileges; mysql> exit; >


 * Configure the database using the provided sql script

> mysql -u weberp -p scc < /usr/local/www/weberp/sql/mysql/weberp-new.sql Enter password: >


 * Create the SCC company sub-directory by renaming the provided template directory, then delete the unnecessary files and copy the SCC logo file into the directory

> cd /usr/local/www/weberp/companies > mv weberp-stable scc > cd scc > rm logo*.jpg > rm part_pics/* > cp /usr/home/maestro/repo/doc/logo-scc/logo-scc-02-name-247x154.jpg logo.jpg >


 * Verify basic functionality and change the default admin password
 * Use a web browser to access the webERP URL (e.g., http://www.scc.com/weberp/).
 * Select company scc and login with username admin and password weberp. The SCC logo should show at the bottom of the main menu.
 * Logout

Updating
TODO: WEBERP UPDATE PROCEDURE TO BE COMPLETED


 * Download a new release of webERP to a convenient location
 * Fetch or use Lynx to download zip archive from project server (e.g. # lynx http://www.weberp.org)
 * Extract new version to /usr/local/www/weberp-x.x.x (e.g. # unzip /usr/home/maestro/distrib/WebERP-3.11.3.zip)
 * Copy companies/scc directory from previous version to new version (e.g. # cp -R ../weberp-3.11.2/companies/scc)
 * Compare new config.distrib.php to previous config.php, and create new config.php
 * Create new webERP Apache config file (e.g. /usr/local/etc/apache22/Includes/weberp-3.11.3.conf) and delete the previous one (or rename it such that Apache will not read it on startup)
 * Re-start Apache (# /usr/local/etc/rc.d/apache22 restart)
 * Using a web browser, execute database upgrade script (e.g. http://www.scc.com/weberpdemo/Z_Upgrade_3.12-3.13.php)

create a backup of the current code tree restore the code tree from the tar file Edit WebERP Apache config file so Apache serves new version (e.g. # vi /usr/local/etc/apache22/Includes/weberp.conf) Re-start Apache (e.g., # /usr/local/etc/rc.d/apache22 restart)
 * 1) cd /usr/local/www
 * 2) tar -czf /Backup_weberp/weberp-3.11.2.tar.gz ./weberp
 * 3) pkg_delete weberp-3.10
 * 1) cd /Backup_weberp
 * 2) cp weberp-3.11.2.tar.gz /usr/local/www
 * 3) cd /usr/local/www
 * 4) tar xvf ./weberp-3.11.2.tar.gz


 * Access Main Menu - Setup - General - Configuration Settings menu
 * Review settings and Update (ALWAYS update even if no edits required, default values may have changed and must be saved to the database)


 * Access Main Menu - Setup - General - Company Preferences menu
 * Review settings and Update (ALWAYS update even if no edits required, default values may have changed and must be saved to the database)