SnipeIT, Part Two

SnipeIT, Part Two
Photo by Petrebels / Unsplash

Install SnipeIT

Coming back to this today, I imagine I'll have everything finished up quickly.
Steps performed on SNIPE-01

  • nano /home/david/snipe-it/.env
  • cd /home/david/snipe-it
  • curl -sS https://getcomposer.org/installer | php
  • php composer.phar update
    • Errors out on me
  • php composer.phar update --ignore-platform-req=ext-gd
    • Success!
  • php composer.phar install --no-dev --prefer-source
    • Errors out on me
    • ext-gd is missing from your system.
  • sudo apt install php-gd
  • php composer.phar install --no-dev --prefer-source
    • Publishing complete.
  • php artisan key:generate
  • Documented the generated key

So now it says I just need to go to the domain name and follow through with the wizard/walkthrough. The wizard does remind me to configure my proxy to point towards SnipeIT. Good reminder, I better do that now.

Steps performed on NGINX-01

  • sudo nano /etc/nginx/sites-available/proxy.conf
# Configuration for snipe.domain.com
server {
    listen 443;
    server_name snipe.domain.com;
    client_max_body_size 100M;
    location / {
        proxy_set_header Host $host;
        proxy_pass http://snipe.domain.local;
        proxy_redirect off;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Connection "upgrade";
    }

    ssl_certificate /etc/letsencrypt/live/domain.com-0001/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.com-0001/privkey.pem; # managed by Certbot
}
  • I saved the file
  • sudo systemctl restart nginx

Going to the server's address I get the Apache2 default page. The documentation is fantastic but never actually lists a web server outside of "You need a LAMP" but specifically lists out everything else. Let's get this fixed.

Steps performed on SNIPE-01

  • sudo nano /etc/apache2/sites-available/000-default.conf
  • I point DocumentRoot to the appropriate location for SnipeIT
  • sudo systemctl restart nginx

I get a forbidden error. It took me some teeth gnashing I found I had to chmod +x the home/david/snipe-it directory and all of it's subdirectories. I completed SnipeIT's preflight checklist but I notice that the address keeps reverting back to the domain.local. I try to fix this but my fix breaks CSS and JavaScript.

I decide the best way to fix this is by having Apache serve SnipeIT via HTTPS instead of HTTP.

I follow this walkthrough to enable HTTPS
But it isn't working after following the walkthrough. After some fiddling around I can get it to serve individual files like https://snipe.domain.com/img/sad-panda.png but the main page fails to load anything at all. After some more fiddling around I catch that I had forgotten a directory entry in the default-ssl.conf file. After adding this directory things are working correctly now. And just in the nick of time, because I need to leave soon!