0500.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Roll Your Own Asset Management System with Snipe-IT</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Asset Management,Linux,IT Asset Management,Free Software,Self-hosted,Snipe-IT,Ubuntu,Debian,PHP,MySQL,MariaDB,Apache HTTPD,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Roll Your Own Asset Management System with Snipe-IT">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="03/09/2024 04:00:45 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Roll Your Own Asset Management System with Snipe-IT</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is Snipe-IT?</h2>
  26. <p><em>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.</em> - <a href="https://snipe-it.readme.io/docs" target="_blank">https://snipe-it.readme.io/docs</a></p>
  27. <h2>Installation</h2>
  28. <ol>
  29. <li>Log into the Linux device</li>
  30. <li>Run the following commands in a terminal window:
  31. <div class="codeBlock"># update software respositories<br />
  32. sudo apt update<br />
  33. # install available software updates<br />
  34. sudo apt upgrade -y<br />
  35. # install prerequisites<br />
  36. sudo apt install git openssl curl wget zip composer -y<br />
  37. # install Apache HTTPD and MySQL<br />
  38. sudo apt install apache2 mariadb-server mariadb-client -y<br />
  39. # install PHP components<br />
  40. 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<br />
  41. # configure the MySQL database<br />
  42. sudo su<br />
  43. mysql_secure_installation</div>
  44. </li>
  45. <li>Press Enter to login as root</li>
  46. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  47. <li>Type Y and press Enter to remove anonymous users</li>
  48. <li>Type Y and press Enter to disallow root login remotely</li>
  49. <li>Type Y and press Enter to remove the test database</li>
  50. <li>Type Y and press Enter to reload privilege tables</li>
  51. <li>Run the following command to login into MySQL:
  52. <div class="codeBlock">mysql -u root -p</div>
  53. </li>
  54. <li>Authenticate with the root password set earlier</li>
  55. <li>Run the following commands to create the Snipe-IT database and database user
  56. <div class="codeBlock">CREATE DATABASE snipe_it;<br />
  57. GRANT ALL ON snipe_it.* to &#39;snipe_it_rw&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;$nip3-IT!&#39;;<br />
  58. FLUSH PRIVILEGES;<br />
  59. EXIT;<br />
  60. exit</div>
  61. </li>
  62. <li>Continue with the following commands:
  63. <div class="codeBlock"># clone snipe-it from github<br />
  64. sudo git clone https://github.com/snipe/snipe-it /var/www/snipe-it<br />
  65. # create a copy of the sample .env file<br />
  66. sudo cp /var/www/snipe-it/.env.example /var/www/snipe-it/.env<br />
  67. # edit the .env file<br />
  68. sudo nano /var/www/snipe-it/.env</div>
  69. </li>
  70. <li>Edit the following environment variables as needed
  71. <p>APP_ENV=production<br />
  72. APP_DEBUG=false<br />
  73. APP_KEY=SomethingSecure<br />
  74. APP_URL=http://debian/snipe_it<br />
  75. APP_TIMEZONE=&#39;America/New_York&#39;<br />
  76. APP_LOCALE=en<br />
  77. <br />
  78. DB_CONNECTION=mysql<br />
  79. DB_HOST=127.0.0.1<br />
  80. DB_DATABASE=snipe_it<br />
  81. DB_USERNAME=snipe_it_rw<br />
  82. DB_PASSWORD=$nip3-IT!<br />
  83. <br />
  84. MAIL_DRIVER=smtp<br />
  85. MAIL_HOST=smtp.i12bretro.local<br />
  86. MAIL_PORT=25<br />
  87. MAIL_USERNAME=null<br />
  88. MAIL_PASSWORD=null<br />
  89. MAIL_ENCRYPTION=null<br />
  90. MAIL_FROM_ADDR=snipe-it@i12bretro.local<br />
  91. MAIL_FROM_NAME=&#39;Snipe-IT&#39;<br />
  92. MAIL_REPLYTO_ADDR=snipe-it@i12bretro.local<br />
  93. MAIL_REPLYTO_NAME=&#39;Snipe-IT&#39;<br />
  94. MAIL_AUTO_EMBED_METHOD=&#39;attachment&#39;</p>
  95. </li>
  96. <li>Press CTRL+O, Enter, CTRL+X to write the changes to .env</li>
  97. <li>Continue with the following commands:
  98. <div class="codeBlock"># set the owner of the snipe-it directory<br />
  99. sudo chown -R www-data:www-data /var/www/snipe-it<br />
  100. # setup composer working directory<br />
  101. sudo mkdir /var/www/.composer<br />
  102. sudo chown -R www-data:www-data /var/www/.composer<br />
  103. cd /var/www/snipe-it<br />
  104. # install dependencies with composer<br />
  105. sudo -u www-data composer install --no-dev --prefer-source<br />
  106. # generate app key, type yes to confirm generating a new key<br />
  107. sudo php artisan key:generate<br />
  108. # create snipe-it apache configuration<br />
  109. sudo nano /etc/apache2/sites-available/snipe-it.conf</div>
  110. </li>
  111. <li>Paste the following configuration into snipe-it.conf
  112. <p>Alias /snipe-it &quot;/var/www/snipe-it/public&quot;<br />
  113. &lt;Directory /var/www/snipe-it/public&gt;<br />
  114. Allow From All<br />
  115. AllowOverride All<br />
  116. Options -Indexes<br />
  117. &lt;/Directory&gt;</p>
  118. </li>
  119. <li>Press CTRL+O, Enter, CTRL+X to write the changes to snipe-it.conf</li>
  120. <li>Run the following command to enable the snipe-it site
  121. <div class="codeBlock"># enable rewrite module<br />
  122. sudo a2enmod rewrite<br />
  123. # enable the snipe-it site<br />
  124. sudo a2ensite snipe-it<br />
  125. # restart the apache2 service<br />
  126. sudo systemctl restart apache2</div>
  127. </li>
  128. </ol>
  129. <h2>Snipe-IT Web Installer</h2>
  130. <ol>
  131. <li>Open a web browser and navigate to http://DNSorIP/snipe-it</li>
  132. <li>Review the Pre-Flight Checks summary &gt; Click the Next: Create Database Tables button</li>
  133. <li>Once the database tables are created, Click the Next: Create User button</li>
  134. <li>Create a user by inputting a site name, first name, last name, email address, username and password &gt; Click the Next: Save User button</li>
  135. <li>Welcome to Snipe-IT</li>
  136. </ol>
  137. <p>Source: <a href="https://snipe-it.readme.io/docs/installation" target="_blank">https://snipe-it.readme.io/docs/installation</a></p> </div>
  138. </div>
  139. </body>
  140. </html>