Install Invoice Ninja v5 on Ubuntu 20.04

@SecureCPU

This looks like an issue with the migration. Can you check the dateformat table in the database to see if it populated?

You may need to run


php artisan migrate:fresh --seed

So I was running as docker on UnRAID for v4. Got v5 up, but creator didnā€™t test email, and said he doesnt use email on his. So I think his is broke. Anyways, trying to get v5 working with Ubunutu.

I already have a Nginx docker setup on UnRAID, am I able to pass from that install to the ninja installs nginx server, or do i need to route it to a separate public IP address?

This will be the 4th or 5th time trying to get it working. Not sure what I am doing wrong.

@smartkid808

There is a thread here that may help

Thanks @david ,

I will try that after I try to get it working on Ubuntu if it doesnt work. Since its the recommended way, I rather try get v5 working there. I got it up, looks like I have permission errors as I am getting. really appreciate your help

image

It is hard to make out the console error, but it looks like a connection refused error?

Hi @david, thanks, yes it is. I am thinking its permission issue or some sort of security setting somewhere (Iā€™m not a Linux guy, so just been googleing around).

There is a problem most likely in the configuration of your vhost for this domain. Your server is refusing all connections.

youā€™ll want to inspect the nginx logs to see why it is not happy.

Thanks. Thats one thing I was thinking about as well. Let me check the logs, I am running apache. if I cant figure it out ill try nginix.

And then once the prerequisites are ready, you need to go to http://your.domain.com/setup for the initial setup wizard (if you just try to access http://your.domain.com without initial setup you will get error 500 and if you turn on debug youā€™ll see itā€™s due to all the tables missing).

iij24

trying to setup/install invoiceninja from github.
strong text
my test url
http://161.35.5.174/invoiceninja/

this gets a default login form.

Iā€™ve seen something of a register/setup form, but I cant figure out what Iā€™ve screwed up.
http://161.35.5.174/invoiceninja/setup
gets the same default page

so, since Iā€™m using Apache/ubuntu, does anyone have any pointers?

thanks

cat /etc/apache2/sites-available/invoiceninja.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName temp22
ServerAlias temp
DocumentRoot /var/www/html/invoiceninja/public
#DocumentRoot /var/www/html/

<Directory    /var/www/html/invoiceninja/public>

        DirectoryIndex index.html index.php

        # test Options -Indexes +FollowSymLinks +MultiViews 
        #Options -Indexes +FollowSymLinks +MultiViews
        Options +FollowSymLinks
        AllowOverride All 
        Require all granted 
        ##Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted


        ##Options Indexes FollowSymLinks MultiViews
        ##Options -Indexes FollowSymlinks
        #Options FollowSymlinks
        #AllowOverride All
        ##Order allow,deny
        ##allow from all
        #Require all granted
</Directory>

#Alias "/invoiceninja" "/var/www/html/invoiceninja/public/"




LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

root@ubuntu-s-1vcpu-2gb-nyc1-01-base-174:/var/www/html/invoiceninja#
cat ninja/.htaccess

#sendportal

<IfModule mod_negotiation.c>
    Options -MultiViews  -Indexes
</IfModule>

#Options -MultiViews -Indexes
RewriteEngine On
RewriteBase '/invoiceninja/'

# Redirect everything to the 'laravel' subfolder

##RewriteCond %{REQUEST_URI} ^/$
##RewriteRule ^(.*)$ /invoiceninja/$1 [L]
##RewriteRule ^invoiceninja/(.*)$ public/$1 [L]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]


# Handle front controller (index.php) rewriting
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

#sendportal

RewriteRule ā€œ^.envā€ - [F,L]

RewriteRule ā€œ^storageā€ - [F,L]

RewriteRule ^(.well-known)($|/) - [L]

#sendportal
# Make sure .env files not not browseable if in a sub-directory.
<FilesMatch ā€œ.env$ā€>
# Apache 2.2
<IfModule !authz_core_module>
Deny from all

   # Apache 2.4+
   <IfModule authz_core_module>
      Require all denied
   </IfModule>
</FilesMatch>

#sendportal

testing for the above sendportal change ā€“ RewriteRule ^(.*)$ public/$1 [L]

server-configs-apache/dist/.htaccess at main Ā· h5bp/server-configs-apache Ā· GitHub

# INTERNET EXPLORER

----------------------------------------------------------------------

| Iframes cookies |

----------------------------------------------------------------------

Allow cookies to be set from iframes in Internet Explorer.

Content Removed (Windows) | Microsoft Learn

The Platform for Privacy Preferences 1.0 (P3P1.0) Specification

Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""

# MEDIA TYPES AND CHARACTER ENCODINGS

----------------------------------------------------------------------

| Character encodings |

----------------------------------------------------------------------

Serve all resources labeled as text/html or text/plain

with the media type charset parameter set to UTF-8.

core - Apache HTTP Server Version 2.4

AddDefaultCharset utf-8

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Serve the following file types with the media type charset

parameter set to UTF-8.

mod_mime - Apache HTTP Server Version 2.4

AddCharset utf-8 .atom \ .bbaw \ .css \ .geojson \ .js \ .json \ .jsonld \ .manifest \ .rdf \ .rss \ .topojson \ .vtt \ .webapp \ .webmanifest \ .xloc \ .xml

# WEB PERFORMANCE

----------------------------------------------------------------------

| Compression |

----------------------------------------------------------------------

# Force compression for mangled headers.
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html

<IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
        SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
        RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    </IfModule>
</IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Map certain file types to the specified encoding type in order to
# make Apache serve them with the appropriate `Content-Encoding` HTTP
# response header (this will NOT make Apache compress them!).

# If the following file types wouldn't be served without the appropriate
# `Content-Enable` HTTP response header, client applications (e.g.:
# browsers) wouldn't know that they first need to uncompress the response,
# and thus, wouldn't be able to understand the content.

# http://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding

<IfModule mod_mime.c>
    AddEncoding gzip              svgz
</IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Compress all output labeled with one of the following media types.

# IMPORTANT: For Apache versions below 2.3.7 you don't need to enable
# `mod_filter` and can remove the `<IfModule mod_filter.c>` & `</IfModule>`
# lines as `AddOutputFilterByType` is still in the core directives.

<IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE "application/atom+xml" \
                                  "application/javascript" \
                                  "application/json" \
                                  "application/ld+json" \
                                  "application/manifest+json" \
                                  "application/rdf+xml" \
                                  "application/rss+xml" \
                                  "application/schema+json" \
                                  "application/vnd.geo+json" \
                                  "application/vnd.ms-fontobject" \
                                  "application/x-font-ttf" \
                                  "application/x-web-app-manifest+json" \
                                  "application/xhtml+xml" \
                                  "application/xml" \
                                  "font/opentype" \
                                  "image/svg+xml" \
                                  "image/x-icon" \
                                  "text/cache-manifest" \
                                  "text/css" \
                                  "text/html" \
                                  "text/javascript" \
                                  "text/plain" \
                                  "text/vtt" \
                                  "text/x-component" \
                                  "text/xml"
</IfModule>

root@ubuntu-s-1vcpu-2gb-nyc1-01-base-174:/var/www/html/invoiceninja#
cat public/.htaccess

Options -MultiViews
RewriteEngine On

RewriteBase /invoiceninja

# Redirect Trailing Slashes If Not A Folder...

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} (.+)/$

RewriteRule ^(.*)/$  /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

#ā€“snipe
Options -Indexes

DENY ACCESS TO IIS CONFIG FILE

Apache 2.2+

<IfModule !authz_core_module>
<Files ā€œweb.configā€>
Order allow,deny
Deny from all

Apache 2.4+

Require all denied #--snipe # Blocks Search Engine Indexing Header set X-Robots-Tag "noindex, nofollow"