Installing Snipe-IT on CentOS 7 and MariaDB
-
@hobbit666 said in Installing Snipe-IT on CentOS 7 and MariaDB:
@dustinb3403 Not yet that's my next step is to try again and then talk to the Dev's
Why keep spinning your wheels? Just jump on gitter and speak with them directly.
@tiagom is one of the people who helped me to get upgraded.
-
Running V4 now.
Not sure what I did different to the first 2 times I tried but works now -
Scratching my head trying to update from 3.6.3. @JaredBusch was super helpful in getting us up and running.
We are looking to move our VM to a new server so I installed a fresh version of 4.0.13 with the above method and its working great.
I am attempting to update the existing server so I can do a backup then restore it on the new server.
I have tried following above directions and can not do a git pull as I used the install.sh script originally. I tried doing an install.sh on top again and no luck. I tried a git clone on top as well and no change. I am still loading up to the 3.6.3 version. Gitter hasn't been super helpful so I am crossing my fingers here.
-
Do steps 1 -4 from the official guide - https://snipe-it.readme.io/docs/upgrading-to-v4. Step 3 is not required if no one else is using the app. Run the commands as the apache user (
sudo -u apache .........)
5- Follow along the first part from @JaredBusch guide to upgrade you install to use git
git clone https://github.com/snipe/snipe-it temp rm -rf /var/www/html/snipeit/.git* mv temp/.git* /var/www/html/snipeit/ rm -rf temp/ cd /var/www/html/snipeit/ git reset --hard origin/master git pull --force chown -R apache:apache /var/www/html/snipeit/
6- Run the following as apache user as @JaredBusch guide recommends.
sudo -u apache php composer.phar install --no-dev --prefer-source sudo -u apache php composer.phar dump-autoload
7- Add
APP_LOCALE=en
to your .env file.8- Double-check that your storage directory and all sub-directories are writable by apache user
9- Apply db migrations as the apache user
sudo -u apache php artisan migrate
10- Open your .env file again and change your current APP_KEY to LEGACY_APP_KEY and add a new APP_KEY= to the file. So assuming both fields are the last ones of the file, your .env file should look like this with the changes:
.... .... LEGACY_APP_KEY=thisisyourpreviouskey APP_KEY=
Save your .env file with the changes and run
sudo -u apache php artisan key:generate sudo -u apache php artisan config:clear sudo -u apache php artisan snipeit:legacy-recrypt
If you get a "Whoops" error when you try to login or refresh your Snipe-IT page, you probably forgot to clear your browser cookies. That error happens because we use a more encryption cipher to encrypt your data (including sessions), and clearing your browser should fix that.
11 - If you put the site on maintenance bring it up (
sudo -u apache php artisan up
)and go to your snipeit url. -
@aaronstuder does anything replace this step in v4 or it's just no longer needed?
-
when heading to Step 3, Create Admin User, the server defaults to an http connection. Is there anyway to configure snipe with https before getting to the setup page for the first user?
-
@larsen161 said in Installing Snipe-IT on CentOS 7 and MariaDB:
when heading to Step 3, Create Admin User, the server defaults to an http connection. Is there anyway to configure snipe with https before getting to the setup page for the first user?
I think you can modify the .env file to use https://your-ip (or installation name).
-
@larsen161 said in Installing Snipe-IT on CentOS 7 and MariaDB:
when heading to Step 3, Create Admin User, the server defaults to an http connection. Is there anyway to configure snipe with https before getting to the setup page for the first user?
In your .env config file, you would change
APP_URL=http://snipeit.domain.com
toAPP_URL=https://snipeit.domain.com
-
@romo Worked first time. The -u apache was what I was missing in my code.
-
What is the best practice for restoring backups?
It looks like exporting and importing CSV you lose some data. I am obviously not super familiar with linux but can probably figure out SSH if that is preferred method?
-
Greetings of the Day!
We installed snipe-it but the pre-flight check page is not appearing.
The below command we used to install...
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.shnano /var/log/httpd/snipeIT.error.log
[Wed Nov 01 08:27:56.547689 2017] [php7:warn] [pid 9026] [client 192.168.173.175:49699] PHP Warning: require(/var/www/html/snipeit/vendor/composer/../psy/psysh/src/Psy/functions.php): failed to open stream: No such file or directory in /var/www/html/snipeit/vendor/composer/autoload_real.php on line 66 -
You don't need to run
setenforce 0 mkdir -p /var/www/html; cd /var/www/html/
The script handles selinux setup on CentOS 7.
I just tested it and successfully install on CentOS 7. Can you provide the output of /var/log/snipeit-install.log ?
-
@robblehead You restore the database and then restore the files to the appropriate place. I don't have a backup in front of me but the file structure is preserved in the backup.
If you're extracting on windows don't use the builtin unzip. You need to use 7zip or another file archiver.
SnipeIT currently as far as i am aware does not have an automated restore backup feature.
-
Hi @tiagom ,
Please find the log file from the below link.
var/log/httpd/snipeIT.error.log
[Mon Nov 06 15:13:41.998634 2017] [php7:error] [pid 20711] [client 127.0.0.1:43457] PHP Fatal error: require(): Failed opening required '/var/www/html/snipeit/vendor/composer/../psy/psysh/src/Psy/functions.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/snipeit/vendor/composer/autoload_real.php on line 66 -
@tiagom Kindly assist
-
Dear All,
@JaredBusch @tiagom
Please assist me. -
@rejivincentc said in Installing Snipe-IT on CentOS 7 and MariaDB:
Hi @tiagom ,
Please find the log file from the below link.
var/log/httpd/snipeIT.error.log
[Mon Nov 06 15:13:41.998634 2017] [php7:error] [pid 20711] [client 127.0.0.1:43457] PHP Fatal error: require(): Failed opening required '/var/www/html/snipeit/vendor/composer/../psy/psysh/src/Psy/functions.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/snipeit/vendor/composer/autoload_real.php on line 66I suggest you also post your issue to...
https://github.com/snipe/snipe-it/issues
https://gitter.im/snipe/snipe-it -
@rejivincentc The install script on Fedora and CentOS works perfectly. I do not know what your problem is. You are obviously doing something abnormal.
-
Please find the log...
After installing the setup page is not coming, it is just blank.
_____ _ __________ / ___/____ (_)___ ___ / _/_ __/ \__ \/ __ \/ / __ \/ _ \______ / / / / ___/ / / / / / /_/ / __/_____// / / / /____/_/ /_/_/ .___/\___/ /___/ /_/ /_/
Welcome to Snipe-IT Inventory Installer for CentOS, Fedora, Debian and Ubuntu!
The installer has detected CentOS version 6.5.
Q. What is the FQDN of your server? (localhost): asset.testsnipe.co.za
Setting to asset.testsnipe.co.zaQ. Do you want to automatically create the database user password? (y/n) y
- Adding IUS, epel-release and MariaDB repositories.
- Installing Apache httpd, PHP, MariaDB and other requirements.
- httpd already installed
- Installing mariadb-server ...
- Installing git ...
- unzip already installed
- Installing php71u ...
- Installing php71u-mysqlnd ...
- Installing php71u-bcmath ...
- Installing php71u-cli ...
- php71u-common already installed
- Installing php71u-embedded ...
- Installing php71u-gd ...
- Installing php71u-mbstring ...
- Installing php71u-mcrypt ...
- Installing php71u-ldap ...
- Installing php71u-json ...
- Installing php71u-simplexml ...
- Setting MariaDB to start on boot and starting MariaDB.
- Securing MariaDB.
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.Enter current password for root (enter for none):
OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.Remove anonymous users? [Y/n] y
... Success!Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] y
... Success!By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success! - Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.Reload privilege tables now? [Y/n] y
... Success!Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.Thanks for using MariaDB!
- Creating MariaDB Database/User.
- Please Input your MariaDB root password:
Enter password: - Creating the new virtual host in Apache.
- Setting up hosts file.
- Configuring iptables.
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ] - Cloning Snipe-IT from github to the web directory.
- Configuring .env file.
- Installing and running composer.
All settings correct for using Composer
Downloading...
Composer (version 1.5.2) successfully installed to: /var/www/html/snipeit/composer.phar
Use it: php composer.pharLoading composer repositories with package information
Installing dependencies from lock file
Package operations: 85 installs, 0 updates, 0 removals- Installing symfony/finder (v3.3.10): Cloning 773e19a491
- Installing symfony/polyfill-mbstring (v1.6.0): Cloning 2ec8b39c38
- Installing symfony/var-dumper (v3.3.10): Cloning 03e3693a36
- Installing psr/log (1.0.2): Cloning 4ebe3a8bf7
- Installing maximebf/debugbar (1.13.1): Cloning afee79a236
- Installing vlucas/phpdotenv (v2.4.0): Cloning 3cc116adbe
- Installing symfony/css-selector (v3.1.10): Cloning 722a87478a
- Installing tijsverkoyen/css-to-inline-styles (2.2.0): Cloning ab03919dfd
- Installing symfony/routing (v3.3.10): Cloning 2e26fa63da
- Installing symfony/process (v3.3.10): Cloning fdf89e57a7
- Installing symfony/http-foundation (v3.3.10): Cloning 22cf9c2b1d
- Installing symfony/event-dispatcher (v3.3.10): Cloning d7ba037e4b
- Installing symfony/debug (v3.3.10): Cloning eb95d9ce8f
- Installing symfony/http-kernel (v3.3.10): Cloning 654f047a78
- Installing symfony/console (v3.3.10): Cloning 116bc56e45
- Installing swiftmailer/swiftmailer (v5.4.8): Cloning 9a06dc570a
- Installing paragonie/random_compat (v2.0.11): Cloning 5da4d3c796
- Installing ramsey/uuid (3.7.1): Cloning 45cffe8220
- Installing symfony/translation (v3.3.10): Cloning 409bf229cd
- Installing nesbot/carbon (1.22.1): Cloning 7cdf42c0b1
- Installing mtdowling/cron-expression (v1.2.1): Cloning 9504fa9ea6
- Installing monolog/monolog (1.23.0): Cloning fd8c787753
- Installing league/flysystem (1.0.41): Cloning f400aa9891
- Installing erusev/parsedown (1.6.3): Cloning 728952b90a
- Installing doctrine/inflector (v1.1.0): Cloning 90b2128806
- Installing laravel/framework (v5.4.29): Cloning 4f7588c744
- Installing barryvdh/laravel-debugbar (v2.4.3): Cloning d7c88f0813
- Installing doctrine/lexer (v1.0.1): Cloning 83893c552f
- Installing doctrine/annotations (v1.4.0): Cloning 54cacc9b81
- Installing doctrine/cache (v1.6.2): Cloning eb152c5100
- Installing doctrine/collections (v1.4.0): Cloning 1a4fb7e902
- Installing doctrine/common (v2.7.3): Cloning 4acb8f8962
- Installing doctrine/dbal (v2.5.13): Cloning 729340d8d1
- Installing fideloper/proxy (3.3.4): Cloning 9cdf6f118a
- Installing guzzlehttp/promises (v1.3.1): Cloning a59da6cf61
- Installing psr/http-message (1.0.1): Cloning f6561bf28d
- Installing guzzlehttp/psr7 (1.4.2): Cloning f5b8a8512e
- Installing intervention/image (2.4.1): Cloning 3603dbcc9a
- Installing jakub-onderka/php-console-color (0.1): Cloning e0b393dacf
- Installing javiereguiluz/easyslugger (v1.0.0): Cloning 11524a3fd7
- Installing zendframework/zend-diactoros (1.6.1): Cloning c8664b92a6
- Installing symfony/psr-http-message-bridge (v1.0.0): Cloning 66085f246d
- Installing phpseclib/phpseclib (2.0.7): Cloning f4b6a522df
- Installing league/event (2.1.2): Cloning e4bfc88dbc
- Installing lcobucci/jwt (3.2.2): Cloning 0b5930be73
- Installing defuse/php-encryption (v2.1.0): Cloning 5176f5abb3
- Installing league/oauth2-server (6.0.2): Cloning 925776958f
- Installing guzzlehttp/guzzle (6.3.0): Cloning f4db5a78a5
- Installing firebase/php-jwt (v4.0.0): Cloning dccf163dc8
- Installing laravel/passport (v3.0.1): Cloning d19a6b6050
- Installing nikic/php-parser (v3.1.2): Cloning 08131e7ff2
- Installing jakub-onderka/php-console-highlighter (v0.3.2): Cloning 7daa75df45
- Installing dnoegel/php-xdg-base-dir (0.1): Cloning 265b859349
- Installing psy/psysh (v0.8.14): Cloning 91e53c1656
Failed to download psy/psysh from source: The process "git clone --no-checkout 'https://github.com/bobthecow/psysh.git' '/var/www/html/snipeit/vendor/psy/psysh' && cd '/var/www/html/snipeit/vendor/psy/psysh' && git remote add composer 'https://github.com/bobthecow/psysh.git' && git fetch composer" exceeded the timeout of 300 seconds.
Now trying to download from dist - Installing psy/psysh (v0.8.14): Downloading (100%)
- Installing laravel/tinker (v1.0.2): Cloning 203978fd67
- Installing laravelcollective/html (v5.4.9): Cloning f04965dc68
- Installing league/csv (8.2.2): Cloning fa8bc05f64
- Installing maknz/slack (1.7.0): Cloning 7f21fefc70
- Installing neitanod/forceutf8 (v2.0.1): Cloning 47c883ab27
- Installing patchwork/utf8 (v1.3.1): Cloning 30ec6451ae
- Installing phpdocumentor/reflection-common (1.0.1): Cloning 21bdeb5f65
- Installing phpdocumentor/type-resolver (0.3.0): Cloning fb39335120
- Installing sebastian/recursion-context (2.0.0): Cloning 2c3ba150cb
- Installing sebastian/exporter (2.0.0): Cloning ce474bdd1a
- Installing sebastian/diff (1.4.3): Cloning 7f066a26a9
- Installing sebastian/comparator (1.2.4): Cloning 2b7424b55f
- Installing webmozart/assert (1.2.0): Cloning 2db61e59ff
- Installing phpdocumentor/reflection-docblock (3.2.2): Cloning 4aada1f93c
- Installing doctrine/instantiator (1.0.5): Cloning 8e884e78f9
- Installing phpspec/prophecy (v1.6.2): Cloning 6c52c2722f
- Installing symfony/polyfill-util (v1.6.0): Cloning 6e719200c8
- Installing symfony/polyfill-php56 (v1.6.0): Cloning 265fc96795
- Installing christian-riesen/base32 (1.3.1): Cloning 0a31e50c0f
- Installing pragmarx/google2fa (v1.0.1): Cloning b346dc1383
- Installing predis/predis (v1.1.1): Cloning f0210e3888
- Installing rollbar/rollbar (v1.3.3): Cloning 2e092656f4
- Installing rollbar/rollbar-laravel (v2.2.1): Cloning 8d46138367
- Installing schuppo/password-strength (v1.10): Cloning 06198d64e9
- Installing spatie/db-dumper (1.5.1): Cloning efdf41891a
- Installing spatie/laravel-backup (3.11.0): Cloning 2382532ce5
- Installing tecnickcom/tc-lib-color (1.12.6): Cloning 8921acc8e9
- Installing tecnickcom/tc-lib-barcode (1.15.6): Cloning 18b8b9224c
- Installing tightenco/ziggy (v0.4.1): Cloning 88ceae070d
- Installing unicodeveloper/laravel-password (1.0.2): Cloning 5c3bdc977c
- Installing watson/validating (3.1.2): Cloning 22edd06d45
Generating optimized autoload files
-
Setting permissions.
-
Generating the application key.
-
Artisan Migrate.
-
Creating scheduler cron.
no crontab for root -
Setting Apache httpd to start on boot and starting service.
Q. Do you want to configure mail server settings? (y/n) nOpen http://asset.testsnipe.co.za to login to Snipe-IT.
-
Cleaning up...
-
Finished!
[root@localhost ~]#
-