![]() ![]() In for NGINX to use the vhost file you just created, you must setup a symlink to the sites-enabled folder, note that you must also use a full, explicit directory path and not a relative path for this command, or you will encounter an error: # ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/ server Īccess_log /var/log/nginx/ Įrror_log /var/log/nginx/ Īdd_header Strict-Transport-Security max-age=2592000 I will try to “”“indicate”“” when specific strings of text need your attention. You cannot copy paste this entire document, you will need to edit appropriate sections to accomodate your own environment. Review it line by line, and edit the server name, root path, ssl path, php-fpm socket path, etc, as necessary. Press ‘i’ to enter insert mode, and paste this server configuration. # rm /etc/nginx/sites-enabled/defaultĬreate the text configuration file for a new vhost in the sites-available folder, best practice if you host multiple websites or webapps from a single server. When left unconfigured, this page presents some security loopholes. The default NGINX install on Ubuntu has a pesky default website located at /etc/nginx/sites-enabled/default - and for our cases, we do not want this default website hosted by nginx. # openssl req -new -x509 -days 365 -nodes -out /etc/nginx/cert/ninja.crt -keyout /etc/nginx/cert/ninja.key ![]() So for the purposes of this guide, the NGINX configuration will use an instant OpenSSL certificate that is not particularly trusted on the Internet. I am not going to provide a guide to setup letsencrypt. Most of you would be using letsencrypt, or some other CA. I am about to show you NGINX configuration file that points to an example based openssl cert. Third: Configure NGINX FOR TESTING - NOT for Production use - OpenSSL certification The database name will be used by InvoiceNinja during the server setup after installation is complete, as well as the username and password you specify here, in order for InvoiceNinja to login to the SQL database with read/write permission. We will create a database with any arbitrary name ‘ninjadb’ in this example, and create arbitrary username and password combination ‘ninja’ and ‘ninjapass’. These commands will directly access the SQL database through the services provided by mariadb. # mysql_secure_installationĮnter current password for root (enter for none): This command will take you through a guided wizard to initialize the SQL database. Start, and enable services for mariadb, the program/service that manages your SQL database and the incoming and outgoing communication it has with other applications like Invoice Ninja. Other distros based on Debian or Ubuntu should pay attention to php-fpm.sock mentions in the nginx config example below, and change them to match the php-fpm path on your distro.Ĭheck where php-fpm runs its socket with: # systemctl status php8.1-fpm This guide assumes you spawn /run/php/php-fpm.sock for a socket, but you do not. You have different paths for php-fpm’s unix socket than Ubuntu users. # apt install mariadb-server mariadb-client curl git nginx vim -yĭone installing things. Invoice Ninja on Ubuntu production servers depends on PHP 8.1 and multiple PHP 8.1 extensions. This guide and the commands below assume you are running a root user shell with sudo bash. ![]() Most if not all of the commands below must be executed as sudo user, so you can enter a root user shell to make it easier, with sudo bash or you can just preface every command with sudo.Because this package is used for the auto updates as well, auto updates only work on Ubuntu. The ‘invoiceninja.zip’ package that is compiled by the Invoice NInja team every release has many dependency packages bundled into it, but it is only compatible with Ubuntu, and maybe other distros more similar to Ubuntu. Running Ubuntu as a host allows you to install with the least amount of effort, fewer dependencies, and auto-update the application through the admin portal user interface. If you are self-hosting, installing on Ubuntu is the best possible method, and highly suggested. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |