![]() Server_name add_header Strict-Transport-Security max-age=2592000 Ĭhange ‘’ with your own domain. We’ll need to add all the necessary Nginx rules for our SSL, redirects, root directories, domain etc.Ĭreate and open an nginx configuration file: nano /etc/nginx/conf.d/nfĪdd the following lines to the file and save it: server Īccess_log /var/log/nginx/ Įrror_log /var/log/nginx/ įastcgi_split_path_info ^(.+\.php)(/.+)$ įastcgi_pass unix:/var/run/php71-fpm-ninja.sock įastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name If you’re using Invoice Ninja for your production site, then you are free to use a different SSL. Let’s create that directory and navigate to it: mkdir -p /etc/nginx/ssl & cd /etc/nginx/sslĪnd run the following commands to generate the SSL cert with openssl: openssl genrsa -des3 -passout pass:x -out 2048 openssl rsa -passin pass:x -in -out ininja.key rm openssl req -new -key ininja.key -out ininja.csr openssl x509 -req -days 365 -in ininja.csr -signkey ininja.key -out ininja.crt We’ll create the SSL certificate under /etc/nginx/ssl. You’re dealing with invoices, so it’s expected that you use an SSL certificate. To do that, create a new file ‘nf’ using nano: nano /etc/opt/remi/php71/php-fpm.d/nfĪdd the following lines to the file and save it: Ĭhdir = / Installing and configuring an SSL We’ll configure the php-fpm module to run as the user ‘ninja’. Next, we need to create a user account that will be associated with our Invoice Ninja install: useradd ninja ![]() So, since we won’t use both PHP 5 and PHP 7, we’ll create a symbolic link: ln -s /usr/bin/php71 /usr/bin/php Since Invoice Ninja is built with PHP/Laravel, we’ll need to install PHP 7 and all other necessary modules: yum install php71 php71-php-fpm php71-php-gd php71-php-curl php71-php-mcrypt php71-php-cli php71-php-gmp php71-php-mbstring php71-php-zip php71-php-xml php71-php-pdo php71-php-memcached php71-php-mysqliīy default PHP version in CentOS 7 is version 5. ![]() MariaDB isn’t properly configured and secured yet, so run this script: mysql_secure_installationįollow the steps on the interactive CLI interface to properly configure MariaDB.Īfter you are done, move on to creating an actual database and user for your Invoice Ninja install.Įnter your password and then enter the following commands (update them according to your needs – change username, password etc.): CREATE DATABASE thrninja GRANT ALL ON thrninja.* to identified by 'YourStrongPassword' FLUSH PRIVILEGES exit Next, enable MariaDB to start automatically on startup: systemctl enable mariadbĪnd now start MariaDB: systemctl start mariadb The instructions are pretty much the same.įirst, install mariadb: yum install mariadb mariadb-server We’re going to use MariaDB, but you might want to use MySQL. We obviously need a database for Invoice Ninja. To install Nginx on CentOS, just run the following command: yum install nginx Now, we’re going to install some tools that we’ll soon need: yum install wget nano unzip openssl We’ll also need the remi and webtatic repositories, to add them, run these 2 commands: rpm -Uvh rpm -Uvh Īfter all the repositories are installed, we need to update the package cache again: yum update Next, install the epel-release for CentOS 7: yum repo-pkgs extras install epel-release Update your system and install necessary packagesĪlways start by updating your system. If you don’t use a root user, append ‘sudo’ on each command. All the commands in our tutorial will be executed by a root user. PHP 5.5.9 or higher (we’ll use PHP 7 in this tutorial).Our recommendation is A2 Hosting, they have Softaculous and an amazing support team. Alternatively, you can host it on a Shared hosting account, in which case you can just use Softaculous and install it with a single click.If you get a Managed server then you can contact your support team and they will most likely install Invoice Ninja for you. You can use a cheap unmanaged one or a cheap managed one. ![]() We’ll install Invoice Ninja on a simple LEMP (Linux, Nginx, MariaDB, PHP 7) stack on a CentOS 7 VPS. And we have the perfect tutorial for you – how to install and self-host Invoice Ninja on CentOS 7. The best part: it’s all free and open source! Although they do have a hosted version, it’s understandable that you’d want to self-host this app. We’ll quote Invoice Ninja themselves with their list of features: In this tutorial, we’ll show you how to install and use Invoice Ninja on a CentOS server. Invoice Ninja is a popular open source application for invoicing, tracking time and accepting payments.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |