mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-11 15:34:21 -04:00
Updated Debian 8 Install (markdown)
parent
677ea141cb
commit
38bde408d2
@ -3,53 +3,53 @@
|
||||
InvoiceNinja Self Hosted on Debain 8
|
||||
Deploy Invoice Ninja On Debian 8 Securely:
|
||||
|
||||
Login as root: Update and install dependencies:
|
||||
Login as root then Update and install dependencies:
|
||||
|
||||
apt-get update && apt-get -y upgrade
|
||||
`apt-get update && apt-get -y upgrade`
|
||||
|
||||
apt-get install python-software-properties git curl openssl mariadb-server
|
||||
`apt-get install python-software-properties git curl openssl mariadb-server`
|
||||
|
||||
Now lets secure the database, read the questions asked and reply Y to all of them in most cases. Remember the password you set.
|
||||
|
||||
mysql_secure_installation
|
||||
`mysql_secure_installation`
|
||||
|
||||
Lets create the database for Invoice Ninja:
|
||||
|
||||
mysql -uroot -p
|
||||
`mysql -uroot -p`
|
||||
|
||||
CREATE DATABASE invoiceNinja;
|
||||
`CREATE DATABASE invoiceNinja;`
|
||||
|
||||
CREATE USER 'ninja'@'localhost' IDENTIFIED BY 'ninja';
|
||||
`CREATE USER 'ninja'@'localhost' IDENTIFIED BY 'ninja';`
|
||||
|
||||
GRANT ALL PRIVILEGES ONinvoiceNinja.* TO 'ninja'@'localhost';
|
||||
`GRANT ALL PRIVILEGES ONinvoiceNinja.* TO 'ninja'@'localhost';`
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
`FLUSH PRIVILEGES;`
|
||||
|
||||
exit
|
||||
`exit`
|
||||
|
||||
Now lets install php and nginx our webserver. I have choosen PHP version 7.1
|
||||
|
||||
apt-get install nginx php7.1 php7.1-fpm php7.1-cli php7.1-mcrypt php7.1-gd php7.1-curl php7.1-common php7.1-gmp php7.1-json php7.1-zip php7.1-xml php7.1-readline php7.1-opcache php7.1-mysql php7.1-mbstring
|
||||
`apt-get install nginx php7.1 php7.1-fpm php7.1-cli php7.1-mcrypt php7.1-gd php7.1-curl php7.1-common php7.1-gmp php7.1-json php7.1-zip php7.1-xml php7.1-readline php7.1-opcache php7.1-mysql php7.1-mbstring`
|
||||
|
||||
Install composer which manages the install of Invoice Ninja :
|
||||
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
`curl -sS https://getcomposer.org/installer | php`
|
||||
|
||||
sudo mv composer.phar /usr/local/bin/composer
|
||||
`sudo mv composer.phar /usr/local/bin/composer`
|
||||
|
||||
Installing Invoice Ninja:
|
||||
|
||||
Choose a location for your invoice ninja install. I choose to install it in my user's home folder.
|
||||
|
||||
cd to your install location
|
||||
cd to your install location then
|
||||
|
||||
git clone https://github.com/hillelcoren/invoice-ninja.git ninja
|
||||
`git clone https://github.com/hillelcoren/invoice-ninja.git ninja`
|
||||
|
||||
composer install --no-dev -o
|
||||
`composer install --no-dev -o`
|
||||
|
||||
Now edit your user file for php-fpm
|
||||
|
||||
nano /etc/php/7.1/fpm/pool.d/
|
||||
`nano /etc/php/7.1/fpm/pool.d/`
|
||||
|
||||
In that file find
|
||||
|
||||
@ -57,17 +57,17 @@ listen = /var/run/php-....
|
||||
|
||||
and change it to this, if it already the same, continue.
|
||||
|
||||
listen = /var/run/php-fpm.sock
|
||||
`listen = /var/run/php-fpm.sock`
|
||||
|
||||
Next edit the Invoice Ninja config of your site.
|
||||
|
||||
cd /etc/nginx/sites-available
|
||||
|
||||
touch **yoursitename**
|
||||
`touch **yoursitename**`
|
||||
|
||||
Example: touch ninja.com or ninja.home
|
||||
|
||||
nano yoursitename
|
||||
`nano yoursitename`
|
||||
|
||||
Copy the contents below. We will make the certificates in the next step just edit the name or path if you want.
|
||||
|
||||
@ -75,7 +75,12 @@ MAKE SURE TO EDIT THE FOLLOWING
|
||||
|
||||
Replace yoursite with yourstie. Example ninja.myface.home
|
||||
|
||||
Replace the root path with your install folder /public
|
||||
Replace the root path with your install folder /public<br />
|
||||
|
||||
Copy the whole thing!!<br /><br />
|
||||
|
||||
|
||||
|
||||
|
||||
server {
|
||||
|
||||
@ -155,43 +160,48 @@ add_header Strict-Transport-Security max-age=2592000;
|
||||
rewrite ^ ? permanent;
|
||||
}
|
||||
|
||||
<br /><br /><br />
|
||||
|
||||
|
||||
If you notice, this file is created in the sites-available folder. But there is a sites-enabled folder, so we will link this file to that folder.
|
||||
|
||||
sudo ln -s /etc/nginx/sites-available/**your_ininja_site** /etc/nginx/sites-enabled/**your_ininja_site**
|
||||
`sudo ln -s /etc/nginx/sites-available/**your_ininja_site** /etc/nginx/sites-enabled/**your_ininja_site**`
|
||||
|
||||
Now Invoice Ninja and the WebServer are configured to only allow https. In the file above under listen 443 we made references to certificates. Let us create those certificates now.
|
||||
|
||||
mkdir -p /etc/nginx/ssl
|
||||
`mkdir -p /etc/nginx/ssl`
|
||||
|
||||
cd /etc/nginx/ssl
|
||||
`cd /etc/nginx/ssl`
|
||||
|
||||
openssl genrsa -des3 -passout pass:x -out ininja.pass.key 2048
|
||||
`openssl genrsa -des3 -passout pass:x -out ininja.pass.key 2048`
|
||||
|
||||
openssl rsa -passin pass:x -in ininja.pass.key -out ininja.key
|
||||
`openssl rsa -passin pass:x -in ininja.pass.key -out ininja.key`
|
||||
|
||||
rm ininja.pass.key
|
||||
`rm ininja.pass.key`
|
||||
|
||||
openssl req -new -key ininja.key -out ininja.csr
|
||||
`openssl req -new -key ininja.key -out ininja.csr`
|
||||
|
||||
openssl x509 -req -days 365 -in ininja.csr -signkey ininja.key -out ininja.crt
|
||||
`openssl x509 -req -days 365 -in ininja.csr -signkey ininja.key -out ininja.crt`
|
||||
|
||||
Set correct permissions:
|
||||
|
||||
cd /path/to/ninja/install
|
||||
`cd /path/to/ninja/install`
|
||||
|
||||
touch .env
|
||||
sudo chown www-data:www-data .env
|
||||
`touch .env`
|
||||
|
||||
sudo chmod -R 755 storage
|
||||
`sudo chown www-data:www-data .env`
|
||||
|
||||
sudo chown -R www-data:www-data storage bootstrap public/logo
|
||||
`sudo chmod -R 755 storage`
|
||||
|
||||
Ok lets see if this all works
|
||||
`sudo chown -R www-data:www-data storage bootstrap public/logo`
|
||||
|
||||
service php7.1-fpm restart
|
||||
Ok lets see if this all works:
|
||||
|
||||
service nginx restart
|
||||
`service php7.1-fpm restart`
|
||||
|
||||
If you can restart those services then you are up and running securely!! Go to your ip or FQDN and hope for the best. If you see the Invoice Ninja setup GUI you are all done :) Follow the on screen instructions to complete the setup.
|
||||
`service nginx restart`
|
||||
|
||||
If you can restart those services then you are up and running securely!! Go to your ip or FQDN and hope for the best. If you see the Invoice Ninja setup GUI you are all done :)
|
||||
Follow the on screen instructions to complete the setup.
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user