What is Snipe-IT?
Snipe-IT is a Free Open Source (FOSS) project built on Laravel. Snipe-IT was made for IT asset management, to enable IT departments to track who has which laptop, when it was purchased, which software licenses and accessories are available, and so on. - https://snipe-it.readme.io/docs
Installation
- Log into the Linux device
- Run the following commands in a terminal window:
# update software respositories
sudo apt update
# install available software updates
sudo apt upgrade -y
# install prerequisites
sudo apt install git openssl curl wget zip composer -y
# install Apache HTTPD and MySQL
sudo apt install apache2 mariadb-server mariadb-client -y
# install PHP components
sudo apt install php7.3 libapache2-mod-php7.3 php7.3-curl php7.3-tokenizer php7.3-ldap php7.3-cli php7.3-json php7.3-gd php7.3-mbstring php7.3-mysql php7.3-xml php7.3-zip php7.3-bcmath -y
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the Snipe-IT database and database user
CREATE DATABASE snipe_it;
GRANT ALL ON snipe_it.* to 'snipe_it_rw'@'localhost' IDENTIFIED BY '$nip3-IT!';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands:
# clone snipe-it from github
sudo git clone https://github.com/snipe/snipe-it /var/www/snipe-it
# create a copy of the sample .env file
sudo cp /var/www/snipe-it/.env.example /var/www/snipe-it/.env
# edit the .env file
sudo nano /var/www/snipe-it/.env - Edit the following environment variables as needed
APP_ENV=production
APP_DEBUG=false
APP_KEY=SomethingSecure
APP_URL=http://debian/snipe_it
APP_TIMEZONE='America/New_York'
APP_LOCALE=en
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=snipe_it
DB_USERNAME=snipe_it_rw
DB_PASSWORD=$nip3-IT!
MAIL_DRIVER=smtp
MAIL_HOST=smtp.i12bretro.local
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDR=snipe-it@i12bretro.local
MAIL_FROM_NAME='Snipe-IT'
MAIL_REPLYTO_ADDR=snipe-it@i12bretro.local
MAIL_REPLYTO_NAME='Snipe-IT'
MAIL_AUTO_EMBED_METHOD='attachment' - Press CTRL+O, Enter, CTRL+X to write the changes to .env
- Continue with the following commands:
# set the owner of the snipe-it directory
sudo chown -R www-data:www-data /var/www/snipe-it
# setup composer working directory
sudo mkdir /var/www/.composer
sudo chown -R www-data:www-data /var/www/.composer
cd /var/www/snipe-it
# install dependencies with composer
sudo -u www-data composer install --no-dev --prefer-source
# generate app key, type yes to confirm generating a new key
sudo php artisan key:generate
# create snipe-it apache configuration
sudo nano /etc/apache2/sites-available/snipe-it.conf - Paste the following configuration into snipe-it.conf
Alias /snipe-it "/var/www/snipe-it/public"
<Directory /var/www/snipe-it/public>
Allow From All
AllowOverride All
Options -Indexes
</Directory> - Press CTRL+O, Enter, CTRL+X to write the changes to snipe-it.conf
- Run the following command to enable the snipe-it site
# enable rewrite module
sudo a2enmod rewrite
# enable the snipe-it site
sudo a2ensite snipe-it
# restart the apache2 service
sudo systemctl restart apache2
Snipe-IT Web Installer
- Open a web browser and navigate to http://DNSorIP/snipe-it
- Review the Pre-Flight Checks summary > Click the Next: Create Database Tables button
- Once the database tables are created, Click the Next: Create User button
- Create a user by inputting a site name, first name, last name, email address, username and password > Click the Next: Save User button
- Welcome to Snipe-IT