Hey everyone
I just finished an installation with a little bit simpler configuration. I have not tested it beyond the setup and the status page yet, so don’t hate me if it does not work
PhantomJS for PDFs is missing in my installation. I am unsure if I need it and PhantomJS is a project no longer supported. I am sure the current state is great, it is just that I personally don’t like to install abandoned software.
Install what we need:
sudo apt install php-{fpm,bcmath,ctype,fileinfo,json,mbstring,pdo,tokenizer,xml,curl,zip,gmp,gd,mysqli}
apt install php mariadb-server nginx
Remove default NGINX sites:
sudo rm /var/www/html/index.nginx-debian.html
sudo rm /etc/nginx/sites-enabled/default
Configure your site here:
sudo nano /etc/nginx/sites-available/invoiceninja.conf
ls /etc/nginx/sites-available/invoiceninja.conf /etc/nginx/sites-enabled/
I am planning on putting it behind a NGINX Proxy so I have a pretty simple configuration:
#
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# link not allowed
# link not allowed
# link not allowed
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: link not allowed
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: link not allowed
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/invoiceninja/public;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm;
client_max_body_size 50M;
gzip on;
gzip_types application/javascript application/x-javascript text/javascript text/plain application/xml application/json;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q= last;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
Configure Mysql:
sudo mysql_secure_installation
sudo mysql -p
You should be logged in and can create the db and the user:
create database ninjadb;
create user ‘ninja’@‘localhost’ identified by ‘HERE IS YOUR PASSWORD’;
grant all privileges on ninjadb.* to ‘ninja’@‘localhost’;
flush privileges;
exit;
Next time I would use the default db and user name that the setup recommends. Unfortunately I did not write that down. Maybe someone else can help here?
Create the folders and download the files:
sudo mkdir /var/www/invoiceninja
cd /var/www/invoiceninja
sudo wget HERE IS YOUR UP TO DATE LINK
Here you should get the latest zipfile fromhttps://github.com/invoiceninja/invoiceninja/releases. Just right click on it and copy the download path.
Unpack and delete
sudo apt install unzip
sudo unzip invoiceninja.zip
sudo rm invoiceninja.zip
sudo chown -R www-data:www-data /var/www
sudo -u www-data crontab -e
* * * * * cd /var/www/invoiceninja/ && php artisan schedule:run >> /dev/null 2>&1
sudo rm -r /var/www//html/
reboot the machine. Visit http://ip/setup