Skip to content

Instantly share code, notes, and snippets.

@afahitech
Created August 10, 2021 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save afahitech/11eaa1053c7e2c77366e5b0b95c48aca to your computer and use it in GitHub Desktop.
Save afahitech/11eaa1053c7e2c77366e5b0b95c48aca to your computer and use it in GitHub Desktop.
How to install Akaunting on Ubuntu 20.04 LTS
#!/bin/sh
#Install Apache2
sudo apt update
sudo apt install apache2
sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/apache2/apache2.conf
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
#Install MariaDB
sudo apt-get install mariadb-server mariadb-client
sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
sudo mysql_secure_installation
Enter current password for root (enter for none): Just press the Enter
Set root password? [Y/n]: Y
New password: Enter password
Re-enter new password: Repeat password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y
sudo systemctl restart mysql.service
#Install PHP 7.2 and Related Modules
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install libapache2-mod-php php7.4-mysql php7.4-gd php7.4-cli php7.4-imagick php7.4-common php7.4-mysql php7.4-gd php7.4-bcmath php7.4-json php7.4-curl php7.4-zip php7.4-xml php7.4-mbstring php7.4-bz2 php7.4-intl php7.4-imap php7.4-ldap php7.4-xmlrpc php7.4-soap
sudo nano /etc/php/7.4/apache2/php.ini
file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 30
zend.assertions = 0
display_errors = Off
max_input_vars = 1500
date.timezone = America/Chicago
#Create Akaunting Database
sudo mysql -u root -p
CREATE USER 'akaunt'@'localhost' IDENTIFIED BY 'Falaq4123#';
CREATE DATABASE akaunting;
GRANT ALL ON akaunting.* TO 'akaunt'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
USE akaunting;
Exit
#Download Akaunting Latest Release
sudo apt install curl
cd /tmp && curl -O -J -L https://akaunting.com/download.php?version=latest
sudo mkdir -p /var/www/html/akaunting
sudo unzip Akaunting_2.1.22-Stable.zip -d /var/www/html/akaunting/
sudo chown -R www-data:www-data /var/www/html/akaunting/
sudo chmod -R 755 /var/www/html/akaunting/
#Configure Apache2
sudo nano /etc/apache2/sites-available/akaunting.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/akaunting/
ServerName example.com
ServerAlias www.example.com
<Directory /var/www/html/akaunting/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
#Enable the Akaunting and Rewrite Module
sudo a2ensite akaunting.conf
sudo a2enmod rewrite
#Restart Apache2
sudo systemctl restart apache2.service
#Visit
http://localhost/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment