Snipe-IT is a free and open-source asset management system that allows organizations to track and manage their hardware and software assets. In this tutorial, we will show you how to install and configure Snipe-IT on Rocky Linux.
Before we begin, make sure you have a working LAMP (Linux, Apache, MySQL, PHP) stack on your system. If not, you can refer to the appropriate documentation for installation instructions.
- Install Dependencies
Snipe-IT has a few dependencies that need to be installed before you can proceed with the installation. These dependencies include the PHP extensions mcrypt
, mbstring
, and gd
, as well as the composer
package manager.
To install these dependencies on Rocky Linux, use the following dnf
command:
dnf install php-mcrypt php-mbstring php-gd composer
Once the dependencies are installed, you can proceed to the next step.
- Download and Install Snipe-IT
The next step is to download and install Snipe-IT on your system. You can download the latest version of Snipe-IT from the official website (https://snipe-it.com/download) or from the GitHub repository (https://github.com/snipe/snipe-it).
To download and install Snipe-IT from the GitHub repository, use the following steps:
Clone the Snipe-IT repository to your local system using the git
command:
git clone <https://github.com/snipe/snipe-it.git>
Navigate to the snipe-it
directory and install the required PHP dependencies using composer
:
cd snipe-it
composer install --no-dev --prefer-source
Generate an application key using the php artisan
command:
php artisan key:generate
Copy the .env.example
file to .env
and edit the file to set the appropriate values for your environment:
cp .env.example .env
In the .env
file, you will need to set the following values:
APP_URL
: the base URL of your Snipe-IT installation (e.g.http://localhost
)DB_HOST
: the hostname of your MySQL serverDB_DATABASE
: the name of the database you will use for Snipe-ITDB_USERNAME
: the username for accessing the databaseDB_PASSWORD
: the password for accessing the database
Once you have set these values, save the .env
file and exit the text editor.
- Configure Apache2
To serve Snipe-IT from Apache2, you will need to create a new virtual host configuration file. This file should be located in the /etc/httpd/conf.d
directory, and should have a .conf
extension. For example, you could name the file snipe-it.conf
.
In the virtual host configuration file, add the following contents:
<VirtualHost *:80>
ServerName snipe-it.example.com
DocumentRoot /var/www/html/snipe-it/public
<Directory /var
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
These lines configure Apache2 to serve the Snipe-IT application from the /var/www/html/snipe-it/public
directory, and to allow .htaccess files to be used for overriding the default settings.
Once you have created the virtual host configuration file, save it and restart Apache2 to apply the changes:
systemctl restart httpd
- Create the Database
Next, you will need to create the database that will be used by Snipe-IT. To do this, log in to your MySQL server using the mysql
command-line client and run the following commands:
mysql> CREATE DATABASE snipeit;
mysql> GRANT ALL PRIVILEGES ON snipeit.* TO 'snipeit'@'localhost' IDENTIFIED BY 'snipeit';
mysql> FLUSH PRIVILEGES;
These commands create a new database named snipeit
and grant all privileges on the database to the snipeit
user. You can use a different database name and username/password if you prefer.
Once the database is created, you can exit the mysql
client and proceed to the next step.
- Run the Installer
Snipe-IT comes with an interactive installer that will guide you through the process of configuring the application and populating the database with initial data. To run the installer, open a web browser and navigate to the URL of your Snipe-IT installation (e.g. http://snipe-it.example.com
).
The installer will first check if your system meets the minimum requirements for running Snipe-IT. If all the requirements are met, you will be asked to enter the database credentials that you created in the previous step.
After entering the database credentials, the installer will create the required tables and populate the database with initial data. This may take a few minutes to complete.
Once the installation is complete, you will be asked to create an admin account for the Snipe-IT application. This account will be used to log in to the Snipe-IT dashboard and manage the assets and users in your organization.
After creating the admin account, the installer will complete the installation and redirect you to the Snipe-IT login page. You can now log in to the Snipe-IT dashboard using the admin account you created and start using the application.
Conclusion
In this tutorial, we have shown you how to install and configure Snipe-IT on Rocky Linux. Snipe-IT is a powerful asset management system that allows organizations to track and manage their hardware and software assets. By following the steps in this tutorial, you can easily install and configure Snipe-IT on your own system and start using it to manage your assets.