Snipe-IT è un’applicazione web gratuita e open source per la gestione degli asset IT: licenze, accessori, consumabili e componenti. È scritta in PHP, usa MySQL/MariaDB e supporta Active Directory, LDAP e autenticazione a due fattori.
Questa guida mostra come installare Snipe-IT su Debian 9 e configurarlo dall’interfaccia web.
Requisiti
- Server Debian 9.
- Utente non root con privilegi sudo.
Aggiornare il sistema
sudo apt-get update -y sudo apt-get upgrade -y
Riavvia e installa i pacchetti di supporto:
sudo apt-get install git curl unzip wget -y
Installare LAMP
sudo apt-get install apache2 libapache2-mod-php php php-pdo php-mbstring php-tokenizer php-curl php-mysql php-ldap php-zip php-fileinfo php-gd php-dom php-mcrypt php-bcmath -y sudo systemctl start apache2 sudo systemctl enable apache2
Installare MariaDB
sudo apt-get install software-properties-common dirmngr -y sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] https://ftp.hosteurope.de/mirror/mariadb.org/repo/10.1/debian stretch main' sudo apt-get update -y sudo apt-get install mariadb-server mariadb-client -y sudo systemctl start mysql sudo systemctl enable mysql sudo mysql_secure_installation
Crea il database:
mysql -u root -p MariaDB [(none)]> create database snipeitdb character set utf8; MariaDB [(none)]> GRANT ALL PRIVILEGES ON snipeitdb.* TO 'snipeit'@'localhost' IDENTIFIED BY 'password'; MariaDB [(none)]> flush privileges; MariaDB [(none)]> quit
Installare Snipe-IT
git clone https://github.com/snipe/snipe-it snipe-it sudo mv snipe-it /var/www/ curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer cd /var/www/snipe-it sudo composer install --no-dev --prefer-source sudo php artisan key:generate sudo php artisan migrate sudo cp .env.example .env sudo nano .env
Modifica .env:
APP_URL=https://example.com APP_TIMEZONE=US/Eastern APP_LOCALE=en DB_CONNECTION=mysql DB_HOST=localhost DB_DATABASE=snipeitdb DB_USERNAME=snipeit DB_PASSWORD=password DB_PREFIX=null DB_DUMP_PATH='/usr/bin'
sudo chown -R www-data:www-data storage public/uploads sudo chmod -R 755 storage public/uploads
Configurare Apache
Crea /etc/apache2/sites-available/snipeit.conf:
<VirtualHost *:80> ServerAdmin [email protected] <Directory /var/www/snipe-it/public> Require all granted AllowOverride All </Directory> DocumentRoot /var/www/snipe-it/public ServerName example.com ErrorLog /var/log/apache2/snipeIT.error.log CustomLog /var/log/apache2/access.log combined </VirtualHost>
sudo a2ensite snipeit.conf sudo phpenmod mcrypt sudo phpenmod mbstring sudo a2enmod rewrite sudo systemctl restart apache2
Configurare il firewall
sudo apt-get install ufw -y sudo ufw enable sudo ufw allow 80 sudo ufw reload
Accedere a Snipe-IT
Apri https://example.com. Il sistema esegue un controllo di configurazione. Clicca Create Database Table, poi Create User e inserisci nome sito, dominio, utente e password amministratore. Dopo il salvataggio accederai alla dashboard di Snipe-IT.