ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Installing Snipe-IT on CentOS 7 and MariaDB

    IT Discussion
    how to snipe-it centos linux centos 7 centos 7.1
    37
    290
    2.9m
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RomoR
      Romo @tiagom
      last edited by

      @tiagom Taken from here https://snipe-it.readme.io/docs/how-to-upgrade:

      Upgrading
      Updating Snipe-IT should be pretty straightforward. Simply pull down the newest release, copy the files over, and run whatever commands the release notes specify. Your configuration won’t be overwritten, since the .env file isn't checked into version control.

      Always backup your database and configuration files before upgrading. We try very hard to make sure that all database changes are non-destructive, but you should always backup beforehand anyway. You will never regret backing up your database. You may regret not doing so, so it’s just better to get into the habit.

      Whenever you pull down a new version from master or develop, or when you grab the latest official release, make sure to run the following commands via command line:

      php composer.phar install --no-dev --prefer-source
      php composer.phar dump-autoload
      php artisan migrate
      php artisan config:clear
      php artisan config:cache
      (Developers should remove the --no-dev flag, so they have unit test frameworks and debugging tools.)

      Forgetting to run these commands can mean your DB might end up out of sync with the new files you just pulled, or you may have some funky cached autoloader values.

      It’s a good idea to get into the habit of running these every time you pull anything new down. If there are no database changes to migrate, it won't hurt anything to run migrations anyway, you’ll just see "Nothing to migrate".

      If you have any issues upgrading, check the Common Issues page for a fix. If you don’t see your issue listed there, open an issue on Github and we’ll try to get you sorted out. Be sure to provide the information outlined in the Getting Help section of this site so that we have the info we need to assist you.

      hobbit666H 1 Reply Last reply Reply Quote 0
      • hobbit666H
        hobbit666 @Romo
        last edited by hobbit666

        @Romo said in Installing Snipe-IT on CentOS 7 and MariaDB:

        Upgrading
        Updating Snipe-IT should be pretty straightforward. Simply pull down the newest release, copy the files over, and run whatever commands the release notes specify. Your configuration won’t be overwritten, since the .env file isn't checked into version control.

        That's the first issue I have. I used the install.sh method so how do we download the latest?

        Do I GIT the latest into the var/www/snipeit folder?
        Do I download a zip/tar and unpack into the folder etc etc. 🙂

        RomoR 1 Reply Last reply Reply Quote 0
        • RomoR
          Romo @hobbit666
          last edited by

          @hobbit666 You can use either way, they both accomplish the same thing that is downloading the newest source files.

          Step 1: Backup your database
          While logged in, go to Admin > Backups and generate a new backup. Download that file and keep it somewhere safe, in case you need to restore back to that version if something goes wrong with your upgrade.

          Step 2: Backup your old version
          The easiest way to do this will be to just rename your old Snipe-IT install directory and create a new, empty directory that uses the old directory name, but you can handle this any way that works for you.

          For example, if your Snipe-IT was installed in /var/www/snipe-it, you could rename that directory to /var/www/snipe-it-backup and then create a new directory /var/www/snipe-it.

          Step 3: Download/clone the new release
          Download the zip from: https://github.com/snipe/snipe-it/archive/master.zip
          or
          git clone https://github.com/snipe/snipe-it.git

          Step 4: Update dependencies
          Whenever you pull down a new version, you should update the dependencies via Composer and dump the autoloader.

          NOTE: Never run composer as a super-user or Administrator. Always run it as the user that owns the Snipe-IT files. Running composer as a super-user will break things in ways that will be difficult to debug later. Just don't do it.

          1st you'll need to install composer into the directory if you don't have it installed globally:

          cd <install-dir>
          curl -sS https://getcomposer.org/installer | php 
          

          Noq update dependencies and dump the auto-loader.

          php composer.phar install --no-dev --prefer-source
          php composer.phar dump-autoload
          

          Step 5: Copy over your configuration settings

          IMPORTANT:
          This step will only need to be done once, while upgrading to v3.0. Once you've upgraded to v3.0, you won't ever have to do this part again.

          Open up your .env file in your new Snipe-IT install directory, and update the configuration placeholders you see there with the values you were previously using in your individual config files.

          If you don't have a .env file, just copy the existing .env.example over to .env and use that:

          cp .env.example .env
          

          The files you'll be copying from are:

          • app/config/app.php
          • app/config/production/app.php
          • app/config/production/database.php
          • app/config/production/mail.php
          • app/config/production/session.php
          New .env Setting Old Config File Old Config File Key Notes
          APP_ENV N/A N/A Set to production
          APP_DEBUG /app/config/production/app.php debug
          APP_KEY /app/config/production/app.php key Make SURE you keep this app key the same from your old version.
          APP_URL /app/config/production/app.php url
          APP_TIMEZONE /app/config/app.php timezone
          APP_LOCALE /app/config/app.php locale
          DB_CONNECTION /app/config/production/database.php default This should be mysql
          DB_HOST /app/config/production/database.php connections-> mysql-> host
          DB_DATABASE /app/config/production/database.php connections-> mysql-> database
          DB_USERNAME /app/config/production/database.php connections-> mysql-> username
          DB_PASSWORD /app/config/production/database.php connections-> mysql-> password
          DB_PREFIX /app/config/production/database.php connections-> mysql-> prefix
          DB_DUMP_PATH N/A N/A Path to your dabase dump binary (such as mysqldump)e.g. '/usr/local/bin'
          MAIL_DRIVER /app/config/production/mail.php driver
          MAIL_HOST /app/config/production/mail.php host
          MAIL_PORT /app/config/production/mail.php port
          MAIL_USERNAME /app/config/production/mail.php username
          MAIL_PASSWORD /app/config/production/mail.php password
          MAIL_ENCRYPTION /app/config/production/mail.php encryption
          MAIL_FROM_ADDR /app/config/production/mail.php from->address
          MAIL_FROM_NAME /app/config/production/mail.php from->name
          IMAGE_LIB N/A N/A Should be set to gd or imagick, depending on which library you have on your server.
          SESSION_LIFETIME /app/config/production/session.php lifetime
          EXPIRE_ON_CLOSE /app/config/production/session.php expire_on_close
          ENCRYPT N/A N/A Should be set to true if you wish to encrypt your cookies.
          COOKIE_NAME /app/config/production/session.php cookie
          COOKIE_DOMAIN /app/config/production/session.php domain
          SECURE_COOKIES /app/config/production/session.php secure

          Everything else in your .env can be left alone, as they are more advanced settings that are not commonly used.

          Step 6: Move uploaded files and check permissions
          Since Laravel's file structure has changed, you're going to need to move a few files around to make sure your uploaded files (logo, uploaded asset files, asset model files, etc) are in their new location.

          cp ../snipe-it-backup/app/storage/dumps/* snipe-it/storage/app/backups/
          cp ../snipe-it-backup/app/private_uploads/* snipe-it/storage/private_uploads/
          cp ../snipe-it-backup/public/uploads/* snipe-it/public/uploads/
          

          Also confirm that your entire storage directory (and subdirectories) is writable by the web server.

          Step 7: Migrate the database
          Always run your database migrations on any upgrade, as this will make sure your database schema is up to date with what the new code expected.

          php artisan migrate
          

          Forgetting to run these commands can mean your DB might end up out of sync with the new files you just pulled, or you may have some funky cached autoloader values.

          It’s a good idea to get into the habit of running these every time you pull anything new down. If there are no database changes to migrate, it won't hurt anything to run migrations anyway, you’ll just see "Nothing to migrate".

          Step 8: Launch Snipe-IT in a browser
          You should be all set now, so just go to your old Snipe-IT URL and make sure everything is working.

          hobbit666H 1 Reply Last reply Reply Quote 1
          • hobbit666H
            hobbit666 @Romo
            last edited by

            @Romo said in Installing Snipe-IT on CentOS 7 and MariaDB:

            @hobbit666 You can use either way, they both accomplish the same thing that is downloading the newest source files.

            Step 1: Backup your database
            While logged in, go to Admin > Backups and generate a new backup. Download that file and keep it somewhere safe, in case you need to restore back to that version if something goes wrong with your upgrade.

            Thanks Romo will give it a try Monday/Tuesday

            1 Reply Last reply Reply Quote 0
            • C
              Chatigo @NashBrydges
              last edited by

              @NashBrydges Thanks a lot! its the first step by step for amateurs i had see, 😃

              1 Reply Last reply Reply Quote 2
              • rejivincentcR
                rejivincentc @scottalanmiller
                last edited by

                @scottalanmiller @brandon.hay I am getting the below error message... Please assist...
                0_1475333103577_Capture.PNG

                scottalanmillerS 1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @rejivincentc
                  last edited by

                  @rejivincentc welcome to the community.

                  rejivincentcR 1 Reply Last reply Reply Quote 0
                  • rejivincentcR
                    rejivincentc @scottalanmiller
                    last edited by

                    @scottalanmiller Thanks...

                    I managed to login the snipe-it after that the webpage is blank...

                    Please assist asap...

                    1 Reply Last reply Reply Quote 0
                    • thwrT
                      thwr
                      last edited by

                      Thx for mentioning Snipe-IT, @scottalanmiller. Didn't follow your instructions, because the install script provided by Snipe worked like a charm.

                      The tool is great, I'm just missing a few things. For example

                      • Licenses should be treated the same way as assets (Create a "template", create instances of that template).
                      • Assets can't be checked out to other assets (Notebook docking station -> Notebook).
                      • Components (or Accessories?) can't have vendors, which is a bit odd.
                      • Components must have a minimum of 1 unused item or they will generate an alert otherwise. No I don't want to have 1 spare part of every little gadget 🙂
                      • Does not handle floating licenses.
                      • Licenses can't be upgraded (but you can assign two versions of the same software to the same machine / user which works just fine)
                      • You can't modify software checkout dates via the GUI

                      But all in all, it's great. Simplifies tracking of assets and licenses.

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @thwr
                        last edited by

                        @thwr said in Installing Snipe-IT on CentOS 7 and MariaDB:

                        Thx for mentioning Snipe-IT, @scottalanmiller. Didn't follow your instructions, because the install script provided by Snipe worked like a charm.

                        It's been a bit, they've changed a lot because their old script didn't install at all, hence these instructions. Which script did you use?

                        rejivincentcR thwrT 2 Replies Last reply Reply Quote 0
                        • rejivincentcR
                          rejivincentc @scottalanmiller
                          last edited by

                          @scottalanmiller Script used - yum -y install wget firewalld; setenforce 0 && yum -y install epel-release; mkdir -p /var/www/html; cd /var/www/html/; wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh && chmod 744 install.sh && ./install.sh && cd snipeit; sed -i "s/'timezone' => '',/'timezone' => 'UTC',/" app/config/app.php; php artisan app:install; firewall-cmd --zone=public --add-port=80/tcp --permanent; firewall-cmd --reloadrpm

                          OS -Centos 7
                          snipe-it-3.4

                          RomoR 1 Reply Last reply Reply Quote 0
                          • thwrT
                            thwr @scottalanmiller
                            last edited by

                            @scottalanmiller said in Installing Snipe-IT on CentOS 7 and MariaDB:

                            @thwr said in Installing Snipe-IT on CentOS 7 and MariaDB:

                            Thx for mentioning Snipe-IT, @scottalanmiller. Didn't follow your instructions, because the install script provided by Snipe worked like a charm.

                            It's been a bit, they've changed a lot because their old script didn't install at all, hence these instructions. Which script did you use?

                            Will take a look on Tuesday. But it was the one provided in the github package.

                            1 Reply Last reply Reply Quote 0
                            • RomoR
                              Romo @rejivincentc
                              last edited by

                              @rejivincentc said in Installing Snipe-IT on CentOS 7 and MariaDB:

                              @scottalanmiller Script used - yum -y install wget firewalld; setenforce 0 && yum -y install epel-release; mkdir -p /var/www/html; cd /var/www/html/; wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh && chmod 744 install.sh && ./install.sh && cd snipeit; sed -i "s/'timezone' => '',/'timezone' => 'UTC',/" app/config/app.php; php artisan app:install; firewall-cmd --zone=public --add-port=80/tcp --permanent; firewall-cmd --reloadrpm

                              OS -Centos 7
                              snipe-it-3.4

                              Just use the following and it will take you to a working install of Snipe-IT

                              wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh
                              chmod 744 install.sh
                              ./install.sh
                              
                              JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 2
                              • JaredBuschJ
                                JaredBusch @Romo
                                last edited by

                                @Romo said in Installing Snipe-IT on CentOS 7 and MariaDB:

                                Just use the following and it will take you to a working install of Snipe-IT

                                Not when this was originally wrote.

                                1 Reply Last reply Reply Quote 1
                                • scottalanmillerS
                                  scottalanmiller @Romo
                                  last edited by

                                  @Romo said in Installing Snipe-IT on CentOS 7 and MariaDB:

                                  @rejivincentc said in Installing Snipe-IT on CentOS 7 and MariaDB:

                                  @scottalanmiller Script used - yum -y install wget firewalld; setenforce 0 && yum -y install epel-release; mkdir -p /var/www/html; cd /var/www/html/; wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh && chmod 744 install.sh && ./install.sh && cd snipeit; sed -i "s/'timezone' => '',/'timezone' => 'UTC',/" app/config/app.php; php artisan app:install; firewall-cmd --zone=public --add-port=80/tcp --permanent; firewall-cmd --reloadrpm

                                  OS -Centos 7
                                  snipe-it-3.4

                                  Just use the following and it will take you to a working install of Snipe-IT

                                  wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh
                                  chmod 744 install.sh
                                  ./install.sh
                                  

                                  Big changes from how it was before. Glad to see that they've made so much progress.

                                  rejivincentcR 1 Reply Last reply Reply Quote 1
                                  • T
                                    tiagom
                                    last edited by

                                    The install script works great. The stuff the tripped me up I submitted a PR to correct.

                                    Im still transitioning over, i currently have about 30% of my assets in there.

                                    1 Reply Last reply Reply Quote 0
                                    • rejivincentcR
                                      rejivincentc @scottalanmiller
                                      last edited by

                                      @scottalanmiller said in Installing Snipe-IT on CentOS 7 and MariaDB:

                                      se the following and it will take you to a working install of S

                                      Thanks 🙂

                                      scottalanmillerS 1 Reply Last reply Reply Quote 1
                                      • scottalanmillerS
                                        scottalanmiller @rejivincentc
                                        last edited by

                                        @rejivincentc said in Installing Snipe-IT on CentOS 7 and MariaDB:

                                        @scottalanmiller said in Installing Snipe-IT on CentOS 7 and MariaDB:

                                        se the following and it will take you to a working install of S

                                        Thanks 🙂

                                        Glad that it is working!

                                        1 Reply Last reply Reply Quote 0
                                        • RobbleheadR
                                          Robblehead
                                          last edited by

                                          so thankful I ran across this article, much more helpful then the snipe-it documentation. I am trying to do the CentOS 7 install method and have tried the single line Scott showed and the wget line that was confirmed working. Everything installs fine but when I enter the IP address/hostname nothing loads, I then open up the firewall to port 80 and the IP address will redirect to the hostname/setup but I receive a "This site can't be reached" I have literally spent 4 hours trying different things with no luck, the server DNS address could not be found is what I am seeing now.
                                          Please help!!! lol

                                          rejivincentcR 1 Reply Last reply Reply Quote 2
                                          • rejivincentcR
                                            rejivincentc @Robblehead
                                            last edited by

                                            @Robblehead Hi,
                                            Please try this one...

                                            setenforce 0
                                            mkdir -p /var/www/html; cd /var/www/html/
                                            wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh
                                            chmod 744 install.sh
                                            ./install.sh

                                            RobbleheadR 1 Reply Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 14
                                            • 15
                                            • 6 / 15
                                            • First post
                                              Last post