Linux

snipeit install for centos 7.x

Naan 2017. 5. 2. 15:32
320x100

centos 7.x 기준이다.

centos 6.x 에 설치를 하려고 했으나 설치가 안된다. hostname: Unknown host 어쩌구 저쩌구 하면서 안되는걸 봐선

OS 미지원인거 같다. 뭐 방법이 있겠지만 귀찮아서 centos 7.x 로 설치했다.

설정부분은 거의 대부분 default 로 엔터만 치면 된다.

 

 

# setenforce 0

# firewall-cmd --zone=public --add-port=http/tcp --permanent

# firewall-cmd --reload

# yum install -y install epel-release
# yum install -y php

# 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

 

2017-05-02 11:09:23 (573 KB/s) - ‘snipeit.sh’ saved [18343/18343]

 

           _____       _                  __________

          / ___/____  (_)___  ___        /  _/_  __/

          \__ \/ __ \/ / __ \/ _ \______ / /  / /

         ___/ / / / / / /_/ /  __/_____// /  / /

        /____/_/ /_/_/ .___/\___/     /___/ /_/

                    /_/

 

 

 

  Welcome to Snipe-IT Inventory Installer for Centos, Debian and Ubuntu!

 

  The installer has detected centos version 7 as the OS.

  Q. What is the FQDN of your server? (localhost): localhost

     Setting to localhost

 

  Q. Do you want me to automatically create the snipe database user password? (y  /n) y

 

##  Add IUS, epel-release and mariaDB repos.

##  Installing PHP and other needed stuff

 ## installing httpd ...

 ## installing mariadb-server ...

 ## installing git ...

 ## unzip already installed

 ## installing php56u ...

 ## installing php56u-mysqlnd ...

 ## installing php56u-bcmath ...

 ## php56u-cli already installed

 ## php56u-common already installed

 ## installing php56u-embedded ...

 ## installing php56u-gd ...

 ## installing php56u-mbstring ...

 ## installing php56u-mcrypt ...

 ## installing php56u-ldap ...

 

##  Downloading Snipe-IT from github and put it in the web directory.

##  Starting the mariaDB server.

Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

##  Securing mariaDB server.

 

 

 

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] n

 ... skipping.

 

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] n

 ... skipping.

 

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]

 - 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]

 ... 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 MySQL Database/User.

##  Please Input your MySQL/MariaDB root password

Enter password:

##  Setting up hosts file.

##  Starting the apache server.

Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

## Configuring .env file.

All settings correct for using Composer

Downloading...

 

Composer (version 1.4.1) successfully installed to: /var/www/html/snipeit/composer.phar

Use it: php composer.phar

 

Do not run Composer as root/super user! See https://getcomposer.org/root for details

Loading composer repositories with package information

Installing dependencies from lock file

Package operations: 60 installs, 0 updates, 0 removals

  - Installing vlucas/phpdotenv (v2.3.0): Cloning 9ca5644c53

  - Installing symfony/polyfill-mbstring (v1.2.0): Cloning dff51f72b0

  - Installing symfony/var-dumper (v3.0.9): Cloning 1f7e071aaf

  - Installing symfony/translation (v3.0.9): Cloning eee6c66485

  - Installing symfony/routing (v3.0.9): Cloning 9038984bd9

  - Installing symfony/process (v3.0.9): Cloning 768debc599

  - Installing symfony/polyfill-util (v1.2.0): Cloning ef830ce3d2

  - Installing symfony/polyfill-php56 (v1.2.0): Cloning 3edf57a8fb

  - Installing symfony/http-foundation (v3.0.9): Cloning 49ba00f8ed

  - Installing symfony/event-dispatcher (v3.1.3): Cloning c0c00c80b3

  - Installing psr/log (1.0.0): Cloning fe0936ee26

  - Installing symfony/debug (v3.0.9): Cloning 697c527acd

  - Installing symfony/http-kernel (v3.0.9): Cloning d97ba4425e

  - Installing symfony/finder (v3.0.9): Cloning 3eb4e64c61

  - Installing symfony/console (v3.0.9): Cloning 926061e742

  - Installing swiftmailer/swiftmailer (v5.4.3): Cloning 4cc9284206

  - Installing nikic/php-parser (v2.1.0): Cloning 47b254ea51

  - Installing jakub-onderka/php-console-color (0.1): Cloning e0b393dacf

  - 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.7.2): Cloning e64e10b20f

  - Installing paragonie/random_compat (v1.4.1): Cloning c7e26a21ba

  - Installing nesbot/carbon (1.21.0): Cloning 7b08ec6f75

  - Installing mtdowling/cron-expression (v1.1.0): Cloning c9ee7886f5

  - Installing monolog/monolog (1.21.0): Cloning f42fbdfd53

  - Installing league/flysystem (1.0.27): Cloning 50e2045ed7

  - Installing jeremeamia/superclosure (2.2.0): Cloning 29a88be2a4

  - Installing doctrine/inflector (v1.1.0): Cloning 90b2128806

  - Installing classpreloader/classpreloader (3.0.0): Cloning 9b10b913c2

  - Installing laravel/framework (v5.2.45): Cloning 2a79f920d5

  - Installing mtdowling/jmespath.php (2.3.0): Cloning 192f93e43c

  - Installing psr/http-message (1.0.1): Cloning f6561bf28d

  - Installing guzzlehttp/psr7 (1.3.1): Cloning 5c6447c9df

  - Installing guzzlehttp/promises (1.2.0): Cloning c10d860e2a

  - Installing guzzlehttp/guzzle (6.2.1): Cloning 3f808fba62

  - Installing aws/aws-sdk-php (3.19.2): Cloning 3cb9041312

  - Installing aws/aws-sdk-php-laravel (3.1.0): Cloning 3b946892d4

  - Installing maximebf/debugbar (v1.12.0): Cloning e634fbd32c

  - Installing barryvdh/laravel-debugbar (V2.2.3): Cloning ecd1ce5c4a

  - Installing doctrine/lexer (v1.0.1): Cloning 83893c552f

  - Installing doctrine/annotations (v1.2.7): Cloning f25c8aab83

  - Installing doctrine/cache (v1.5.4): Cloning 47cdc76ceb

  - Installing doctrine/collections (v1.3.0): Cloning 6c1e4eef75

  - Installing doctrine/common (v2.5.3): Cloning 10f1f19651

  - Installing doctrine/dbal (v2.4.2): Cloning fec965d330

  - Installing erusev/parsedown (dev-master f671ae7): Cloning f671ae7364

  - Installing fideloper/proxy (3.1.0): Cloning ec4dd30141

  - Installing intervention/image (dev-master 45a41a3): Cloning 45a41a38bd

  - Installing laravelcollective/html (v5.2.4): Cloning 3a312d39ff

  - Installing league/csv (7.2.0): Cloning 69bafa6ff9

  - Installing maknz/slack (dev-master e9bab77): Cloning e9bab77eb7

  - Installing misterphilip/maintenance-mode (1.0.2): Cloning 35e061703e

  - Installing neitanod/forceutf8 (dev-master 2c1b21e): Cloning 2c1b21e00e

  - Installing christian-riesen/base32 (1.3.1): Cloning 0a31e50c0f

  - Installing pragmarx/google2fa (v1.0.1): Cloning b346dc1383

  - Installing spatie/db-dumper (1.5.1): Cloning efdf41891a

  - Installing spatie/laravel-backup (3.8.1): Cloning 08b7b8c778

  - Installing tecnickcom/tc-lib-color (1.12.0): Cloning 176464ae7a

  - Installing tecnickcom/tc-lib-barcode (dev-master df69541): Cloning df69541618

  - Installing watson/validating (2.2.2): Cloning 8f37e416aa

Generating autoload files

> php artisan clear-compiled

> php artisan optimize

Generating optimized class loader

Compiling common classes

 

  ***If you want mail capabilities, edit /var/www/html/snipeit/.env and edit based on .env.example***

 

  ***Open http://snipeit to login to Snipe-IT.***

 

 

* Cleaning up...

* Finished!

#

자동으로 설치가 되니 편하다.

 

timezone 

# vi /var/www/html/snipeit/config/app.php

    'timezone' => 'Asia/Seoul',

수정해주자

 

사이트 접속

http://localhost

Config File 은 무시해도 된다. Next

 

기본적인 정보 입력 후 완료하면

 

 
한글 지원된다.

 

 

PHP Fatal error:  require(): Failed opening required '/var/www/html/snipeit/vendor/composer/../psy/psysh/src/Psy/functions.php'

혹시 위와 같이 에러가 발생이 된다면

설치 경로로 가서

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

# php composer.phar install --no-dev --prefer-source

설치 해주면 된다.

 

메일 발송상에 문제가 있다면

# /var/www/html/snipeit/storage/logs/laravel.log

위 로그를 확인해보자

 

자동백업 설정은 crontap 에 등록 하면 된다.

00 12 * * * root php /var/www/html/snipeit/artisan snipeit:backup

 

.env 환경설정 변경하려면

php artisan config:clear 해야 적용 된다.

 

추가로.

vi /var/www/html/snipeit/resources/views/notifications/markdown/asset-requested.blade.php

| **{{ trans('email') }}** | {{ $user->email }} |

알림 메일에 이메일 추가
https://github.com/snipe/snipe-it/issues/5933
 
메일 제목 수정은
vi /var/www/html/snipeit/app/Notifications/RequestAssetNotification.php
#->subject(trans('mail.Item_Requested'));
이 부분을 

->subject($this->item->asset_tag);

처럼 하면 asset_tag 로 해서 메일을 보낼 수 있다.

 
 
 
 
 

 

320x100