{"id":13347,"date":"2019-04-01T21:47:43","date_gmt":"2019-04-01T21:47:43","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13347"},"modified":"2019-04-01T21:47:43","modified_gmt":"2019-04-01T21:47:43","slug":"how-to-install-snipe-it-it-asset-management-on-centos-and-ubuntu","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/how-to-install-snipe-it-it-asset-management-on-centos-and-ubuntu\/","title":{"rendered":"How to Install Snipe-IT (IT Asset Management) on CentOS and Ubuntu"},"content":{"rendered":"<p><strong>Snipe-IT<\/strong>\u00a0is a free and open source, cross-platform, feature-rich IT asset management system built using a PHP framework called\u00a0<strong>Laravel<\/strong>. It is web-based software, which enables IT administrators in medium to large enterprises to track physical assets, software licenses, accessories and consumables in a single place.<\/p>\n<p>Check out a live, up-to-date version of Snipe-IT Asset Management Tool:\u00a0<a href=\"https:\/\/snipeitapp.com\/demo\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/snipeitapp.com\/demo<\/a><\/p>\n<h4>Snipe-IT Features:<\/h4>\n<ol>\n<li>It is a cross-platform \u2013 works on Linux, Windows and Mac OS X.<\/li>\n<li>It is mobile-friendly for easy asset updates.<\/li>\n<li>Easily Integrates with\u00a0<a href=\"https:\/\/www.tecmint.com\/install-samba4-active-directory-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Active Directory and LDAP<\/a>.<\/li>\n<li>Slack notification integration for checkin\/checkout.<\/li>\n<li>Supports one-click (or cron) backups and automated backups.<\/li>\n<li>Supports optional\u00a0<a href=\"https:\/\/www.tecmint.com\/ssh-two-factor-authentication\/\" target=\"_blank\" rel=\"noopener\">two-factor authentication with Google authenticator<\/a>.<\/li>\n<li>Supports generation of custom reports.<\/li>\n<li>Supports custom status labels.<\/li>\n<li>Supports bulk user actions and user role management for different levels of access.<\/li>\n<li>Supports several languages for easy localization and so much more.<\/li>\n<\/ol>\n<p>In this article, I will explain how to install a IT asset management system called\u00a0<strong>Snipe-IT<\/strong>\u00a0using a\u00a0<strong>LAMP<\/strong>\u00a0(Linux, Apache, MySQL &amp; PHP) stack on\u00a0<strong>CentOS<\/strong>\u00a0and\u00a0<strong>Debian<\/strong>\u00a0based systems.<\/p>\n<h3>Step 1: Install LAMP Stack<\/h3>\n<p><strong>1.<\/strong>\u00a0First update the system (meaning update the list of packages that needs to be upgraded and add new packages that have entered in repositories enabled on the system).<\/p>\n<pre>$ sudo apt update        [On <strong>Debian\/Ubuntu<\/strong>]\r\n$ sudo yum update        [On <strong>CentOS\/RHEL<\/strong>] \r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0Once system has been updated, now you can install LAMP (Linux, Apache, MySQL &amp; PHP) stack with all needed PHP modules as shown.<\/p>\n<h4>Install LAMP on Debian\/Ubuntu<\/h4>\n<pre>$ sudo apt install apache2 apache2-utils libapache2-mod-php mariadb-server mariadb-client php php-pdo php-mbstring php-tokenizer php-curl php-mysql php-ldap php-zip php-fileinfo php-gd php-dom php-mcrypt \r\n<\/pre>\n<h4>Install LAMP on CentOS\/RHEL<\/h4>\n<p><strong>3.<\/strong>\u00a0Snipe-IT requires PHP greater than 5.5.9 and PHP 5.5 has reached end of life, so to have PHP 5.6, you need to enable the Remi repository as shown.<\/p>\n<pre>$ sudo rpm -Uvh http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm\r\n$ sudo yum -y install yum-utils\r\n$ sudo yum-config-manager --enable remi-php56\r\n<\/pre>\n<p><strong>4.<\/strong>\u00a0Next, install PHP 5.6 on CentOS 7 with the required modules needed by Snipe-IT.<\/p>\n<pre>$ sudo yum install httpd mariadb mariadb-server php php-openssl php-pdo php-mbstring php-tokenizer php-curl php-mysql php-ldap php-zip php-fileinfo php-gd php-dom php-mcrypt\r\n<\/pre>\n<p><strong>5.<\/strong>\u00a0After the LAMP stack installation completes, start the web server for the mean time, and enable it to start on the next system boot with the following command.<\/p>\n<pre>$ sudo systemctl start enable status apache2       [On <strong>Debian\/Ubuntu<\/strong>]\r\n$ sudo systemctl start enable status httpd         [On <strong>CentOS\/RHEL<\/strong>]\r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0Next verify Apache and PHP installation and all its current configurations from a web browser, let\u2019s create a\u00a0<code>info.php<\/code>\u00a0file in the Apache DocumentRoot (<strong>\/var\/www\/html<\/strong>) using the following command.<\/p>\n<pre>$ sudo echo \"&lt;?php  phpinfo(); ?&gt;\" | sudo tee -a \/var\/www\/html\/info.php\r\n<\/pre>\n<p>Now open a web browser and navigate to following URL\u2019s to verify Apache and PHP configuration.<\/p>\n<pre>http:\/\/SERVER_IP\/\r\nhttp:\/\/SERVER_IP\/info.php \r\n<\/pre>\n<p><strong>7.<\/strong>\u00a0Next, you need to secure and harden your MySQL installation using the following command.<\/p>\n<pre>$ sudo mysql_secure_installation     \r\n<\/pre>\n<p>You will be asked you to set a strong root password for your MariaDB and answer\u00a0<code>Y<\/code>\u00a0to all of the other questions asked (self explanatory).<\/p>\n<p><strong>8.<\/strong>\u00a0Finally start MySQL server and enable it to start at the next system boot.<\/p>\n<pre>$ sudo systemctl start mariadb            \r\nOR\r\n$ sudo systemctl start mysql\r\n<\/pre>\n<h3>Step 2: Create Snipe-IT Database on MySQL<\/h3>\n<p><strong>9.<\/strong>\u00a0Now log in to the MariaDB shell and create a database for Snipe-IT, a database user and set a suitable password for the user as follows.<\/p>\n<pre>$ mysql -u root -p\r\n<\/pre>\n<p>Provide the password for the MariaDB root user.<\/p>\n<pre>MariaDB [(none)]&gt; CREATE DATABASE snipeit_db;\r\nMariaDB [(none)]&gt; CREATE USER 'tecmint'@'localhost' IDENTIFIED BY 't&amp;cmint@190root';\r\nMariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON snipeit_db.* TO 'tecmint'@'localhost';\r\nMariaDB [(none)]&gt; FLUSH PRIVILEGES;\r\nMariaDB [(none)]&gt; exit\r\n<\/pre>\n<h3>Step 3: Install Composer \u2013 PHP Manager<\/h3>\n<p><strong>10.<\/strong>\u00a0Now you need to install\u00a0<strong>Composer<\/strong>\u00a0\u2013 a dependency manager for PHP, with the commands below.<\/p>\n<pre>$ sudo curl -sS https:\/\/getcomposer.org\/installer | php\r\n$ sudo mv composer.phar \/usr\/local\/bin\/composer\r\n<\/pre>\n<h3>Step 4: Install Snipe-IT Asset Management<\/h3>\n<p><strong>11.<\/strong>\u00a0First install Git to fetch and clone the latest version of\u00a0<strong>Snipe-IT<\/strong>\u00a0under Apache web-root directory.<\/p>\n<pre>$ sudo apt -y install git      [On <strong>Debian\/Ubuntu<\/strong>]\r\n$ sudo yum -y install git      [On <strong>CentOS\/RHEL<\/strong>]\r\n\r\n$ cd  \/var\/www\/\r\n$ sudo git clone https:\/\/github.com\/snipe\/snipe-it.git\r\n<\/pre>\n<p><strong>12.<\/strong>\u00a0Now go into the\u00a0<strong>snipe-it<\/strong>\u00a0directory and rename the\u00a0<strong>.env.example<\/strong>\u00a0file to\u00a0<strong>.env<\/strong>.<\/p>\n<pre>$ cd snipe-it\r\n$ ls\r\n$ sudo mv .env.example .env\r\n<\/pre>\n<h3>Step 5: Configure Snipe-IT Asset Management<\/h3>\n<p><strong>13.<\/strong>\u00a0Next, configure the snipe-it environment, here you\u2019ll provide the database connection settings and many more.<\/p>\n<p>First open the\u00a0<strong>.env<\/strong>\u00a0file.<\/p>\n<pre>$ sudo vi .env\r\n<\/pre>\n<p>Then Find and change the following variables according to instructions given.<\/p>\n<pre>APP_TIMEZONE=Africa\/Kampala                                   #Change it according to your country\r\nAPP_URL=http:\/\/10.42.0.1\/setup                                #set your domain name or IP address\r\nAPP_KEY=base64:BrS7khCxSY7282C1uvoqiotUq1e8+TEt\/IQqlh9V+6M=   #set your app key\r\nDB_HOST=localhost                                             #set it to localhost\r\nDB_DATABASE=snipeit_db                                        #set the database name\r\nDB_USERNAME=tecmint                                           #set the database username\r\nDB_PASSWORD=password                                          #set the database user password\r\n<\/pre>\n<p>Save and close the file.<\/p>\n<p><strong>14.<\/strong>\u00a0Now you need to set the appropriate permissions on certain directories as follows.<\/p>\n<pre>$ sudo chmod -R 755 storage \r\n$ sudo chmod -R 755 public\/uploads\r\n$ sudo chown -R www-data:www-data storage public\/uploads   [On <strong>Debian\/Ubuntu<\/strong>]\r\nsudo chown -R apache:apache storage public\/uploads         [On <strong>CentOS\/RHEL<\/strong>]\r\n<\/pre>\n<p><strong>15.<\/strong>\u00a0Next, install all the dependencies required by PHP using Composer dependency manager as follows.<\/p>\n<pre>$ sudo composer install --no-dev \u2013prefer-source\r\n<\/pre>\n<p><strong>16.<\/strong>\u00a0Now you can generate the \u201c<strong>APP_KEY<\/strong>\u201d value with the following command (this will be set automatically in the\u00a0<strong>.env<\/strong>\u00a0file).<\/p>\n<pre>$ sudo php artisan key:generate\r\n<\/pre>\n<p><strong>17.<\/strong>\u00a0Now, you need to create a virtual host file on the web server for Snipe-IT.<\/p>\n<pre>$ sudo vi \/etc\/apache2\/sites-available\/snipeit.example.com.conf     [On <strong>Debian\/Ubuntu<\/strong>]\r\n$ sudo vi \/etc\/httpd\/conf.d\/snipeit.example.com.conf                [On <strong>CentOS\/RHEL<\/strong>]\r\n<\/pre>\n<p>Then add\/modify the line below in your Apache config file (use your server IP address here).<\/p>\n<pre>&lt;VirtualHost 10.42.0.1:80&gt;\r\n    ServerName snipeit.tecmint.lan\r\n    DocumentRoot \/var\/www\/snipe-it\/public\r\n    &lt;Directory \/var\/www\/snipe-it\/public&gt;\r\n        Options Indexes FollowSymLinks MultiViews\r\n        AllowOverride All\r\n        Order allow,deny\r\n        allow from all\r\n    &lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>Save and close the file.<\/p>\n<p><strong>18.<\/strong>\u00a0On Debian\/Ubuntu, you need to enable virtual host, mod_rewrite and mcrypt using the following commands.<\/p>\n<pre>$ sudo a2ensite snipeit.conf\r\n$ sudo a2enmod rewrite\r\n$ sudo php5enmod mcrypt\r\n<\/pre>\n<p><strong>19.<\/strong>\u00a0Lastly, restart Apache web server to take new changes into effect.<\/p>\n<pre>$ sudo systemctl restart apache2       [On <strong>Debian\/Ubuntu<\/strong>]\r\n$ sudo systemctl restart httpd         [On <strong>CentOS\/RHEL<\/strong>]\r\n<\/pre>\n<h3>Step 6: Snipe-IT Web Installation<\/h3>\n<p><strong>20.<\/strong>\u00a0Now open your web browser and enter the URL:\u00a0<strong>http:\/\/SERVER_IP<\/strong>\u00a0to view the Snipe-IT web installation interface.<\/p>\n<p>First you will see the Pre-Flight Check page below, click Next:\u00a0<strong>Create Database Tables<\/strong>.<\/p>\n<div id=\"attachment_26219\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-pre-flight-check.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26219\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-pre-flight-check.png\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-pre-flight-check.png 855w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-pre-flight-check-768x715.png 768w\" alt=\"Snipe-IT Pre Flight Check\" width=\"855\" height=\"796\" aria-describedby=\"caption-attachment-26219\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26219\" class=\"wp-caption-text\">Snipe-IT Pre Flight Check<\/p>\n<\/div>\n<p><strong>21.<\/strong>\u00a0You will now see all the tables created, click\u00a0<strong>Next: Create User<\/strong>.<\/p>\n<div id=\"attachment_26220\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Snipe-IT-User.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26220\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Snipe-IT-User.png\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Snipe-IT-User.png 855w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Snipe-IT-User-768x715.png 768w\" alt=\"Create Snipe-IT User\" width=\"855\" height=\"796\" aria-describedby=\"caption-attachment-26220\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26220\" class=\"wp-caption-text\">Create Snipe-IT User<\/p>\n<\/div>\n<p><strong>22.<\/strong>\u00a0Here, provide all the admin user information and click\u00a0<strong>Next: Save User<\/strong>.<\/p>\n<div id=\"attachment_26221\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-User-Information.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26221\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-User-Information.png\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-User-Information.png 953w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-User-Information-768x619.png 768w\" alt=\"Snipe-IT User Information\" width=\"953\" height=\"768\" aria-describedby=\"caption-attachment-26221\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26221\" class=\"wp-caption-text\">Snipe-IT User Information<\/p>\n<\/div>\n<p><strong>23.<\/strong>\u00a0Finally open the login page using the URL\u00a0<strong>http:\/\/SERVER_IP\/login<\/strong>\u00a0as shown below and login to view the Snipe-IT dashboard.<\/p>\n<div id=\"attachment_26222\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-It-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26222\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-It-Login.png\" sizes=\"auto, (max-width: 869px) 100vw, 869px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-It-Login.png 869w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-It-Login-768x703.png 768w\" alt=\"Snipe-IT Login\" width=\"869\" height=\"796\" aria-describedby=\"caption-attachment-26222\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26222\" class=\"wp-caption-text\">Snipe-IT Login<\/p>\n<\/div>\n<div id=\"attachment_26223\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-Dashboard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26223\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-Dashboard.png\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-Dashboard.png 1440w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Snipe-IT-Dashboard-768x450.png 768w\" alt=\"Snipe-IT Dashboard\" width=\"1440\" height=\"844\" aria-describedby=\"caption-attachment-26223\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26223\" class=\"wp-caption-text\">Snipe-IT Dashboard<\/p>\n<\/div>\n<p><strong>Snipe-IT Homepage<\/strong>:\u00a0<a href=\"https:\/\/snipeitapp.com\/\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/snipeitapp.com\/<\/a><\/p>\n<p>In this article, we discussed how to setup Snipe-IT with LAMP (Linux Apache MySQL PHP) stack on CentOS and Debian based systems. If any issues, do share with us using our comment form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/install-snipe-it-asset-management-on-centos-ubuntu-debian\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Snipe-IT\u00a0is a free and open source, cross-platform, feature-rich IT asset management system built using a PHP framework called\u00a0Laravel. It is web-based software, which enables IT administrators in medium to large enterprises to track physical assets, software licenses, accessories and consumables in a single place. Check out a live, up-to-date version of Snipe-IT Asset Management Tool:\u00a0https:\/\/snipeitapp.com\/demo &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/how-to-install-snipe-it-it-asset-management-on-centos-and-ubuntu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install Snipe-IT (IT Asset Management) on CentOS and Ubuntu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13347","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13347"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13347\/revisions"}],"predecessor-version":[{"id":13348,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13347\/revisions\/13348"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}