How to install Snipe-IT on Ubuntu -2018

how-to-install-snipeit-on-Xammp-2018

1-Update your system

sudo apt-get update -y && sudo apt-get upgrade -y

2-Installing Apache2

sudo apt-get install apache2

3-Installing MySQL

sudo apt-get install mysql-server

Now we are also going to secure our installation:

sudo mysql_secure_installation

Enter the root password you entered before.

Now you get asked a couple of questions, answer as below:

Enter current password for root (enter for none): Enter your root password

Would you like to setup VALIDATE PASSWORD plugin? N

Change the password for root? [Y/n] N

Remove anonymous users? [Y/n] {ENTER}

Disallow root login remotely? [Y/n] {ENTER}

Remove test database and access to it? [Y/n] {ENTER}

Reload privilege tables now? [Y/n] {ENTER}

That’s it. Let’s continue with PHP.

5-Installing PHP

sudo apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-intl php-pear php-imagick php-imap php-mcrypt php-memcache php-pspell php-recode php-sqlite3 php-tidy php-xmlrpc php-xsl php-mbstring php-gettext

Let’s restart apache2:

sudo /etc/init.d/apache2 restart  

Then we are going to login with root by typing:

sudo -i 


Next, we are going to download composer: (if curl not install please install it- apt install curl

curl -sS https://getcomposer.org/installer | php   


Then we are going to move composer to another folder:

mv composer.phar /usr/local/bin/composer

cd /var/www/


Alright, time to download snipe-it:(if git not install please install first –apt install git)

git clone https://github.com/snipe/snipe-it snipeit

cd snipeit/

Finally we replace .env.example with .env:

cp .env.example .env

6-Configuring the MySQL Database

mysql -u root -p


Now you need to run a couple of commands, make sure to use the EXACT commands like in the box below, replace “your username” and “yourpw” with your own username and password:

    mysql> create database snipeit;
    mysql> CREATE USER 'yourusername'@'localhost' IDENTIFIED BY 'yourpw';
    mysql> GRANT ALL PRIVILEGES ON snipeit.* TO 'yourusername'@'localhost';
    mysql> flush privileges;
    mysql> exit

7-Editing the .env file

nano .env
ithelpsupport.com
You need to adjust the values according to your server and the database we created earlier. Remember to enter your username and password that you set in step 3.
Don’t worry about the APP_KEY either, we are going to generate that later

8-Adjusting permissions

chown -R www-data:www-data storage public/uploads

chmod -R 775 storage

chmod -R 755 public/uploads

9-Installing PHP dependencies

apt-get install -y git unzip php php-mcrypt php-curl php-mysql php-gd php-ldap php-zip php-mbstring php-xml

apt-get install php-bcmath

10-Installing Composer & generating our App Key

composer install --no-dev --prefer-source

php artisan key:generate

11-Editing configuration files and wrapping up

sudo nano /etc/apache2/sites-available/snipeit.example.com.conf

And paste the text into the box below:

<VirtualHost *:80>
ServerAdmin [email protected]
<Directory /var/www/snipeit/public>
        Require all granted
        AllowOverride All
   </Directory>
    DocumentRoot /var/www/snipeit/public
    ServerName YOURSERVERIP
   #Redirect permanent / https://snipeit.your-server-fqdn.com/
        ErrorLog /var/log/apache2/snipeIT.error.log
        CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Make sure to replace YOURSERVERIP with, well, your server IP.

Press CTRL+O to save and CTRL+X to exit.

sudo a2ensite snipeit.example.com.conf
sudo a2enmod rewrite
sudo systemctl restart apache2


sudo a2dissite 000-default.conf

sudo service apache2 restart

Change directory

cd /etc/apache2/sites-available


sudo cp 000-default.conf 000-default.confTEMP
sudo rm 000-default.conf

Already and finally wrapping it up with:

sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo a2enmod rewrite
sudo service apache2 restart

12-Setup with the Web Browser

Ignore the File Owner warning, this seems to be a bug and will probably be fixed in an update. Click on Next: Create Database Tables.

You will likely get an error:

Don’t panic, just refresh the page by hitting F5

Click on Next: Create User

Finalize everything to your liking, click F5 if you get the error again.

 

And congratulations

Leave a Reply

Your email address will not be published. Required fields are marked *