Essetee's Webstek



Apache2 + PHP

sudo apt install build-essential cmake

sudo apt install apache2 libapache2-mod-php

sudo apt install mariadb-server dialog

sudo apt install php php-cli php-xml php-gmp php-gd php-curl php-zip php-mbstring php-mysql

sudo apt install curl git unzip

Invoiceninja

wget https://download.invoiceninja.com/ -O /tmp/invoice-ninja.zip

sudo unzip /tmp/invoice-ninja.zip -d /var/www/html/

sudo chown -R www-data:www-data /var/www/html/ninja/

sudo chmod -R 755 /var/www/html/ninja/

sudo nano /etc/apache2/sites-available/invoice-ninja.conf

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /var/www/html/invoiceninja/public

    <Directory /var/www/html/invoiceninja/public>
       DirectoryIndex index.php
       Options +FollowSymLinks
       AllowOverride All
       Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/invoice-ninja.error.log
    CustomLog ${APACHE_LOG_DIR}/invoice-ninja.access.log combined

</VirtualHost>

sudo a2dissite 000-default

sudo a2ensite invoice-ninja

sudo a2enmod rewrite

sudo systemctl restart apache2

MySQL

sudo apt install mariadb-server

sudo mysql_secure_installation

Set now your root password for the mysql server. You can use another password than the one you use for the system !

Answer Y to all other questions

sudo su (become super user)

mysql

create database invoiceninja;

create user 'ninja'@'%' identified by 'YourStrongPassword';

create user 'ninja'@'localhost' identified by 'YourStrongPassword';

grant all privileges on invoiceninja.* to 'ninja'@'%';

grant all privileges on invoiceninja.* to 'ninja'@'localhost';

create user 'YourUserName'@'%' identified by 'YourStrongPassword';

create user 'YourUserName'@'localhost' identified by 'YourStrongPassword';

grant all privileges on *.* to 'YourUserName'@'%';

grant all privileges on *.* to 'YourUserName'@'localhost';

flush privileges;

exit;

Here we create a database invoiceninja and we give the user ninja complete control on that database. Where you replace YourUserName with yours, we give that user complete control over the database mysql. As we disable root loging you need such a user to be able to control the MySQL database. Needed if you want to use phpmyadmin or adminer.

Back to normal user

exit
cd

Phantomjs

sudo apt install g++ cmake qt5-default libqt5webkit5-dev python
git clone https://github.com/ariya/phantomjs.git

cd phantomjs
./configure && make
sudo make install

Invoiceninja setup

http://localhost to configure Invoiceninja.

Once finished

sudo nano /var/www/html/invoiceninja/.env

search for those 2 lines:

PHANTOMJS_CLOUD_KEY=a-demo-key-with-low-quota-per-ip-address
PHANTOMJS_SECRET=hls3qtucspyyy7a4nlkxjfjlolnzkq0r

Add below those 2 lines:

PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs



Enjoy invoiceninja !