Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

COMPLETE GUIDE: - Installing Akaunting on FreeBSD 11.1-U5

Erez Zabusky   ( User )

Commented 5 years ago

COMPLETE GUIDE: - Installing Akaunting on FreeBSD 11.1-U5


For this purpose we are creating an iocage jail using FreeNAS 11.1-U5 with BSD Jail Release 11.1.


Using shell, you can type below command:


iocage create -n "yourjailname" -r 11.1-RELEASE ip4_addr="igb0|192.XXX.X.X/XX" defaultrouter="192.XXX.X.X" vnet="on" allow_raw_sockets="1" boot="on"


Alternatively through the GUI,


Make sure you bond your physical port to the IP address. For example if your IP is 192.XXX.X.X/XX and tied to physical port igb0 then under IPV4 Address insert


igb0|192.XXX.X.X/XX


In Jail properties select


exec_clean, mount_devfs, mount_fdescfs, allow_set_hostname, allow_raw_sockets, allow_mount, allow_mount_zfs


and select SAVE.


Now that your jail is setup, console into it. From an ssh console, type jls to see all registered jails followed by jexec and your jail number. You should now see the prompt below.


root@Akaunting:/ #


Step 1 – Upgrade packages and install Apache Web Server.


If your jail does not have package management installed then type “y” to install it, then when finished install apache24.


root@Akaunting:/ # pkg update
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y


root@Akaunting:/ # pkg install apache24


Step 2 - Installing MySQL


Once Apache Web Server is installed, we'll go further on installing MySQL database server


root@Akaunting:/ # pkg install mysql57-server


Step 3 - Enabling and starting Apache and MySQL services


root@Akaunting:/ # sysrc apache24_enable=yes mysql_enable=yes


root@Akaunting:/ # service apache24 start && service mysql-server start


When starting apache, you may get an error message “AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message” If this is the case edit the httpd.conf file


root@Akaunting:/ # ee /usr/local/etc/apache24/httpd.conf


replace the row #ServerName www.example.com:80 with your actual server name or IP address


ServerName 192.XXX.X.X


Then “Esc” option “c” to file operations and option “c” again to save file, then “Esc” option “a” to exit back to console. Once you restart your service the error should disappear and you will see something like this.


root@Akaunting:/ # service apache24 restart
Performing sanity check on apache24 configuration:
Syntax OK
Stopping apache24.
Waiting for PIDS: 77710.
Performing sanity check on apache24 configuration:
Syntax OK
Starting apache24.
root@Akaunting:/ #


Step 4 - Configuring MySQL


mysql_secure_installation


When prompted to activate the password plugin, press any key. DO NOT ACTIVATE it as Akaunting does not like that. **perhaps a feature update in next Akaunting package?


VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?


Press y|Y for Yes, any other key for No:


Then change the new password for root, remove anonymous users, disallow root login remotely, remove test database and access to it, and finally reload privileges by selecting “y” for each of the questions above.


Step 5 – Creating an Akaunting Database


root@Akaunting:/ # mysql -u root -p
Enter password:


in MySQL version 5.7 you must reset your password using ALTER USER statement before creating databases. This can be done by typing


root@localhost [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_password';


You can now create your Akaunting database and user


root@localhost [(none)]> CREATE DATABASE akauntingdb;


root@localhost [(none)]> CREATE USER ‘akauntinguser’@’localhost’ IDENTIFIED BY 'your_password';


root@localhost [(none)]> GRANT ALL PRIVILEGES ON akauntingdb.* TO 'akauntinguser'@'localhost';


root@localhost [(none)]> FLUSH PRIVILEGES;


root@localhost [(none)]> EXIT;


Step 6 - Installing PHP 7.0 Modules


The following packages are required for Akaunting to work properly on the latest FreeBSD 11.1 jail.


root@Akaunting:/ # pkg install php70 php70-mysqli php70-xml php70-gd php70-curl php70-zlib php70-zip php70-hash php70-tokenizer mod_php70 php70-pdo php70-openssl php70-mbstring php70-session php70-json php70-filter php70-pdo_mysql


Then copy the production php configuration ie /usr/local/etc/php.ini-production to /usr/local/etc/php.ini by executing the following command, and finally rehash.


root@Akaunting:/ # /usr/local/etc/php.ini-production /usr/local/etc/php.ini


root@Akaunting:/ # rehash


Step 7 - Configuring Apache


Once PHP is installed on our FreeBSD 11, we'll now need to configure Apache so that it can handle and execute PHP files.


root@Akaunting:/ # ee /usr/local/etc/apache24/Includes/php.conf


then copy below into the file and save


<IfModule dir_module>


    DirectoryIndex index.php index.html


    <FilesMatch "\.php$">


        SetHandler application/x-httpd-php


    </FilesMatch>


    <FilesMatch "\.phps$">


        SetHandler application/x-httpd-php-source


    </FilesMatch>


</IfModule>


Once done restart apache service


root@Akaunting:/ # service apache24 restart


Step 7 - Downloading and Extracting Akaunting


nce our FAMP stack is up and ready, download the latest Akaunting package (zip) file into your /usr/local/www/apache24/data/ directory. Make sure you are in the right directory when decompressing the file (similar to below depending on your version)


root@Akaunting:/ # unzip /usr/local/www/apache24/data/Akaunting_1.2.7-Stable.zip.zip


Finally change ownership to www.


root@Akaunting:/ # chown -R www:www /usr/local/www/apache24/data/


You are now ready to install accounting. Simply navigate to your URL and follow the installation instructions in the Akaunting document section.


 

Erez Zabusky   ( User )

Commented 5 years ago

Additional Package Required for Printing Invoices, etc..


root@Akaunting:/ # pkg install php70-fileinfo 

Please login or register to leave a response.

Showing 1 to 2 of 2 discussions