{"id":4059,"date":"2019-08-24T08:54:25","date_gmt":"2019-08-24T05:54:25","guid":{"rendered":"https:\/\/kifarunix.com\/?p=4059"},"modified":"2019-08-24T08:58:55","modified_gmt":"2019-08-24T05:58:55","slug":"install-snipe-it-on-debian-10-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-snipe-it-on-debian-10-ubuntu-18-04\/","title":{"rendered":"Install Snipe-IT on Debian 10\/Ubuntu 18.04"},"content":{"rendered":"\n
Welcome to our guide on how to install Snipe-IT on Debian 10\/Ubuntu 18.04. Snipe-IT<\/a> is a free and opensource IT asset\/license management system that enables IT departments to track who has which device, when it was purchased, which software licenses and accessories are available,…<\/p>\n\n\n\n Read more about Snipe-IT features on the features and overview page<\/a>.<\/p>\n\n\n\n Snipe-IT can be run as a hosted service or self-hosted<\/a>. This guide focuses on self-hosted Snipe-IT.<\/p>\n\n\n\n Snipe-IT requires LAMP stack set in order to run. Hence, follow the guides below to setup LAMP Stack on Debian 10 or Ubuntu 18.04.<\/p>\n\n\n\n Install LAMP Stack with MariaDB 10 on Debian 10 Buster<\/a><\/p>\n\n\n\n Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\n Install Extra PHP Extensions and other requirements.<\/p>\n\n\n\n Next, login to MariaDB\/MySQL and create Snipe-IT database and database user with all the privileges granted on Snipe-IT database.<\/p>\n\n\n\n Clone the Snipe-IT github directory to your web server root directory.<\/p>\n\n\n\n Rename the Snipe-IT variables file Open the environment configuration file.<\/p>\n\n\n\n Set the URL you will use to access your Snipe-IT, the Application language, Timezone. The URL should not have a trailing slash.<\/p>\n\n\n\n Set the database host, database name, user and password created above,<\/p>\n\n\n\n If you are gonna need your Snipe-IT to send emails, configure Email Server settings.<\/p>\n\n\n\n To install other required Snipe-IT PHP libraries, you need to install PHP Composer. Note that these are not the same as the PHP extensions installed on our prerequisites page. Hence, navigate to Snipe-IT install directory and install the libraries as follows.<\/p>\n\n\n\n Set the user and group Ownership of Snipe-IT web root directory to Web server www-data<\/strong>.<\/p>\n\n\n\n App key is a randomly generated key that Snipe-IT uses to encrypt data. The value generated will be assigned automatically to APP_KEY<\/strong> variable in the Snipe-IT configuration file.<\/p>\n\n\n\n This command has to be run from the Snipe-IT directory.<\/p>\n\n\n\n The key generated is automatically set as the value of the APP_KEY<\/strong> variable in the .env<\/strong> file.<\/p>\n\n\n\n Create Snipe-IT Apache configuration file wth the content below;<\/p>\n\n\n\n Save the configuration file and run a file syntax test.<\/p>\n\n\n\n If the command return, Syntax Ok<\/strong>, proceed. Otherwise fix the would errors.<\/p>\n\n\n\n Enable Snipe-IT site configuration.<\/p>\n\n\n\n Enable Rewrite module.<\/p>\n\n\n\n Restart Apache<\/p>\n\n\n\n Run the pre-flight setup to verify that all configurations are okay. You can access Snipe-IT pre-flight page via the URL; http:\/\/<Snipe-Hostname or Address><\/strong>.<\/p>\n\n\n\n The first page will do a system check to make sure your configuration is correct.<\/p>\n\n\n\n If all is fine, proceed to database configuration page. Since we already set up the database, you will be told that it is already setup.<\/p>\n\n\n\n Create Snipe-IT admin user and fill in their details.<\/p>\n\n\n\n Click Next to save the user and go to Snipe-IT dashboard.<\/p>\n\n\n\n There you go. You have successfully installed Snipe-IT Asset management tool on Debian 10 Buster\/Ubuntu 18.04.<\/p>\n\n\n\n The Snipe-IT dashboard has so many functionalities. Read throughbthe user manual to learn about them.<\/p>\n\n\n\n Snipe-IT Overview<\/a><\/p>\n\n\n\n In our next tutorial, we are going to learn how to add assets to Snipe-IT for management.<\/p>\n\n\n\n Snipe-IT has also some command line utilities. Read more about them on Snipe-IT Command Line Utilities page<\/a>.<\/p>\n\n\n\n Other Tutorials;<\/p>\n\n\n\n Install WonderCMS on Debian 10 Buster<\/a><\/p>\n\n\n\n Install WonderCMS with Nginx on Debian 10<\/a><\/p>\n\n\n\n Install GoAccess on Ubuntu 18.04\/Debian 10 Buster<\/a><\/p>\n\n\n\nInstall Snipe-IT on Debian 10\/Ubuntu 18.04<\/h2>\n\n\n\n
Prerequisites<\/h3>\n\n\n\n
apt install php-{bcmath,cli,xml,mbstring,tokenizer,curl,zip,ldap,gd} openssl curl git wget zip<\/code><\/pre>\n\n\n\n
Create Snipe-IT Database<\/h3>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\n
create database snipeitdb;<\/code><\/pre>\n\n\n\n
grant all on snipeitdb.* to snipeadmin@localhost identified by 'P@SSWORD';<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
Install Snipe-IT on Debian 10\/Ubuntu 18.04<\/h3>\n\n\n\n
Download Snipe-IT <\/h4>\n\n\n\n
git clone https:\/\/github.com\/snipe\/snipe-it.git \/var\/www\/html\/snipeit<\/code><\/pre>\n\n\n\n
Configure Snipe-IT<\/h4>\n\n\n\n
.env.example<\/code> to
.env<\/code> file.<\/p>\n\n\n\n
cp \/var\/www\/html\/snipeit\/.env.example \/var\/www\/html\/snipeit\/.env<\/code><\/pre>\n\n\n\n
vim \/var\/www\/html\/snipeit\/.env<\/code><\/pre>\n\n\n\n
Snipe-IT Basic Application Settings<\/h4>\n\n\n\n
# --------------------------------------------\n# REQUIRED: BASIC APP SETTINGS\n# --------------------------------------------\nAPP_ENV=production\nAPP_DEBUG=false\nAPP_KEY=ChangeMe\nAPP_URL=http:\/\/snipeit.example.com\nAPP_TIMEZONE='Europe\/London'\nAPP_LOCALE=en<\/code><\/pre>\n\n\n\n
Snipe-IT Database Settings<\/h4>\n\n\n\n
# --------------------------------------------\n# REQUIRED: DATABASE SETTINGS\n# --------------------------------------------\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_DATABASE=snipeitdb\nDB_USERNAME=snipeadmin\nDB_PASSWORD=P@SSWORD\nDB_PREFIX=null\nDB_DUMP_PATH='\/usr\/bin'\nDB_CHARSET=utf8mb4\nDB_COLLATION=utf8mb4_unicode_ci<\/code><\/pre>\n\n\n\n
Install Required PHP Libraries<\/h4>\n\n\n\n
cd \/var\/www\/html\/snipeit\ncurl -sS https:\/\/getcomposer.org\/installer | php\n
php composer.phar install --no-dev --prefer-source<\/code><\/pre>\n\n\n\n
Set Snipe-IT Directory Ownership and Permissions<\/h4>\n\n\n\n
chown -R www-data:www-data \/var\/www\/html\/snipeit<\/code><\/pre>\n\n\n\n
Generate Snipe-IT App Key<\/h4>\n\n\n\n
php artisan key:generate<\/code><\/pre>\n\n\n\n
**************************************\n* Application In Production! *\n**************************************\n\n Do you really wish to run this command? (yes\/no) [no]:\n > yes\n\nApplication key [base64:7xHLDhywQyccOYN9IIOVpkqsdpv34F5RjgtC+Lf+iW8=] set successfully.<\/code><\/pre>\n\n\n\n
Configure Apache Web Server for Snipe-IT<\/h3>\n\n\n\n
vim \/etc\/apache2\/sites-available\/snipeit.conf<\/code><\/pre>\n\n\n\n
<VirtualHost 192.168.56.105:80>\n\tDocumentRoot \/var\/www\/html\/snipeit\/public\n\tServerName snipeit.example.com\n\n\t<Directory \/var\/www\/html\/snipeit\/public>\n\t\tAllow From All\n\t\tAllowOverride None\n\t\tOptions None\n\t<\/Directory>\n\n\tRewriteEngine On\n\tRewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d\n\tRewriteCond %{REQUEST_URI} (.+)\/$\n\tRewriteRule ^ %1 [L,R=301]\n\tRewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d\n\tRewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f\n\tRewriteRule ^ \/index.php [L]\n\n\tErrorLog ${APACHE_LOG_DIR}\/snipeit-error.log\n\tCustomLog ${APACHE_LOG_DIR}\/snipeit-access.log combined\n<\/VirtualHost><\/code><\/pre>\n\n\n\n
apachectl configtest<\/code><\/pre>\n\n\n\n
a2ensite snipeit.conf<\/code><\/pre>\n\n\n\n
a2enmod rewrite<\/code><\/pre>\n\n\n\n
systemctl restart apache2<\/code><\/pre>\n\n\n\n
Snipe-IT Pre-Flight & Setup<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n