Skip to content

Instantly share code, notes, and snippets.

@jhillix
Last active May 22, 2016 04:58
Show Gist options
  • Save jhillix/67125d12351b035e58e260ce6cff2ab3 to your computer and use it in GitHub Desktop.
Save jhillix/67125d12351b035e58e260ce6cff2ab3 to your computer and use it in GitHub Desktop.

Background

Snipe-IT is the best free and open asset/inventory management web application I've seen yet. Unfortunately, when it came to installing it, it became a little tricky. For me at least. I tried the Docker image, the self-installer script and the Vagrant option but to no avail. So, I was left with the self-installation option. I don't mind doing this manually but was hoping it was going to be faster with one of the other methods.

The manual route also had a few hiccups along the way but ended up working for me. I do have to say that some of the Snipe-IT documentation can be a little confusing. My hope is that someone else out there that really wants to use this nice tool but is banging their head against the wall can find some peace of mind with this How To. Although, not in itslef free from flaws :o)

NOTE: The following is not meant for a production environment. I used these steps for getting a POC up and running.

Let's take a look. A book-look.

I ran this setup in a Virtual Box VM with the following image: Ubuntu 14.04.4 LTS, Trusty Tahr and architecture: x86_64. The version of Snipe-IT is v2.1.0-55 with MySQL Ver 14.14 Distrib 5.5.49 (from Ubuntu repo). The version of ApacheI installed: 2.4.7 (from Ubuntu repo).

Step 1 - Cut a hole in the box...

git clone https://github.com/snipe/snipe-it - I ran this in myhome directory.

Step 2 - Install MySQL and Apache

As mentioned earlier, I used the ones from the Ubuntu repo. I followed this guide for installation and user setup of MySQL. As for Apache, just install it for now. We'll configure it later.

Step 3 - Configuration

NOTE: From this step on my working directory is the snipe-it directory. (that you cloned earlier)

This step went smoothly for me as-is. Just be sure you do a double check on the Edit Database Settings bit. In the VM I did NOT configure email settings. I also did NOT setup SSL.

Step 4 - Dependencies and Composer

This step also went smoothly for me.

Step 5 - CLI Installer

Here is where I started to have some minor issues.

First I needed to install php (duh!): sudo apt-get install php5 You also need cURL for php: sudo apt-get install php5-curl (thanks DRAKUN).

I then got an error about mcrypt. mppfiles's answer helped me on this. Then when the CLI installer script was setting up my database I ran into a PDOException. This was resolved for me by running sudo apt-get install php5-mysql (thanks ghbarratt).

I did NOT seed my database and I did update the key at this time. Hopefully with the information above you have success when invoking php artisan app:install --env=production.

Step 6 - Apache configuration

Before doing this step I mv'd the snipe-it directory to /var/www/html/snipeit (notice the new name) and followed the following guide to mainly disable the default site and enable the one for Snipe-IT. It's important to read this Snipe-IT step carefully (voice of experience ;P). Here is what my config looks like:

$ cat /etc/apache2/sites-enabled/snipe-it.conf
<VirtualHost *:80>
<Directory /var/www/html/snipeit/public>
    Allow From All
    AllowOverride All
    Options +Indexes
</Directory>

DocumentRoot /var/www/html/snipeit/public
ServerName localhost
</VirtualHost>

Fin

That should be it! Restart Apache for good measure and try to go your site.

(I hope I didn't forget something)

References

And thanks for the ones that already asked these questions ahead of me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment