软件简介
Snipe-IT 是一个开源的资产管理系统。Snipe-IT 用于IT资产管理,IT部门通过它能够跟踪谁拥有哪台笔记本电脑、何时购买、包含哪些软件许可证和可用的附件等等。功能特性- 托管在云主机
- 强大的 REST API
- 快速更新
- 保证 App 和 Platform 的安全性
- 一键备份
- LDAP 登录/用户同步
运行截图
安装开始:一、环境准备
CentOS 7 + Apache + PHP +Mariadb
CentOS 7 (阿里云):http://mirrors.aliyun.com/centos/7.7.1908/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso 这个自行选择吧,我提供下版本,链接不一定有效.....
安装php72w,是需要配置额外的yum源地址(连接不一定长期有效,如果无效自行查找)的,否则会报错不能找到相关软件包。php高版本的yum源地址,有两部分,其中一部分是epel-release,另外一部分来自webtatic。如果跳过epel-release的话,安装webtatic的时候,会有错误爆出。所以,这里需要的命令是:
注意:如果你在使用Laravel框架,那么经过上述操作之后你会发现还缺少一个 bcmath 扩展。在网上也有各种各样的安装命令,但大多数都麻烦。下面这条命令可以做到,一次安装成功。
- [root@snipeit snipe-it]# yum install php72w-bcmath
- 已加载插件:fastestmirror, langpacks
- Loading mirror speeds from cached hostfile
- * base: mirrors.ustc.edu.cn
- * epel: mirrors.aliyun.com
- * extras: mirrors.163.com
- * updates: mirrors.aliyun.com
- * webtatic: us-east.repo.webtatic.com
- 正在解决依赖关系
- --> 正在检查事务
- ---> 软件包 php72w-bcmath.x86_64.0.7.2.27-1.w7 将被 安装
- --> 解决依赖关系完成
-
- 依赖关系解决
-
- ========================================================================================================================================
- Package 架构 版本 源 大小
- ========================================================================================================================================
- 正在安装:
- php72w-bcmath x86_64 7.2.27-1.w7 webtatic 36 k
-
- 事务概要
- ========================================================================================================================================
- 安装 1 软件包
-
- 总下载量:36 k
- 安装大小:98 k
- Is this ok [y/d/N]: y
- Downloading packages:
- php72w-bcmath-7.2.27-1.w7.x86_64.rpm | 36 kB 00:00:05
- Running transaction check
- Running transaction test
- Transaction test succeeded
- Running transaction
- 正在安装 : php72w-bcmath-7.2.27-1.w7.x86_64 1/1
- 验证中 : php72w-bcmath-7.2.27-1.w7.x86_64 1/1
-
- 已安装:
- php72w-bcmath.x86_64 0:7.2.27-1.w7
-
- 完毕!
复制代码
安装完成以后,启动服务...
- [root@snipeit ~]# systemctl enable php-fpm.service
- Created symlink from /etc/systemd/system/multi-user.target.wants/php-fpm.service to /usr/lib/systemd/system/php-fpm.service.
- [root@snipeit ~]# systemctl start php-fpm.service
- [root@snipeit ~]###查看php-fpm开启状态,这里使用的lsof命令,笔者安装的Centos默认没有,需要安装。
- [root@snipeit ~]# yum install lsof
- 已加载插件:fastestmirror, langpacks
- Loading mirror speeds from cached hostfile
- * base: mirrors.ustc.edu.cn
- * epel: mirrors.aliyun.com
- * extras: mirrors.163.com
- * updates: mirrors.aliyun.com
- * webtatic: us-east.repo.webtatic.com
- 软件包 lsof-4.87-6.el7.x86_64 已安装并且是最新版本
- 无须任何处理
- [root@snipeit ~]# lsof -i:9000
- COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
- php-fpm 11830 root 7u IPv4 54937 0t0 TCP localhost:cslistener (LISTEN)
- php-fpm 11832 apache 9u IPv4 54937 0t0 TCP localhost:cslistener (LISTEN)
- php-fpm 11833 apache 9u IPv4 54937 0t0 TCP localhost:cslistener (LISTEN)
- php-fpm 11834 apache 9u IPv4 54937 0t0 TCP localhost:cslistener (LISTEN)
- php-fpm 11835 apache 9u IPv4 54937 0t0 TCP localhost:cslistener (LISTEN)
- php-fpm 11836 apache 9u IPv4 54937 0t0 TCP localhost:cslistener (LISTEN)
复制代码
经过以上命令检测,代表php-fpm已开启成功查看PHP版本,成功查询即表示安装成功
- [root@snipeit ~]# php -v
- PHP 7.2.27 (cli) (built: Jan 26 2020 15:49:49) ( NTS )
- Copyright (c) 1997-2018 The PHP Group
- Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
- with Zend OPcache v7.2.27, Copyright (c) 1999-2018, by Zend Technologies
复制代码
配置Apache支持PHP,修改httpd.conf文件 PS,这里不熟悉的代码的家伙,可以用winscp登陆进去,直接修改文件......
- [root@snipeit ~]# vi /etc/httpd/conf/httpd.conf
- [root@snipeit ~]##在AddType application*后面加如下一行
- [root@snipeit ~]##AddType application/x-httpd-php .php .phtml
- [root@snipeit ~]##在DirectoryIndex index.html加上index.php
- [root@snipeit ~]##DirectoryIndex index.php index.html
- [root@snipeit ~]##确保httd.conf文件中包含以下字段,如不包含则加入此字段
- [root@snipeit ~]##LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so
- [root@snipeit ~]#修改完成后,重启httpd服务
- [root@snipeit ~]# service httpd restart
- Redirecting to /bin/systemctl restart httpd.service
- [root@snipeit ~]# #检验httpd的PHP支持
- [root@snipeit ~]# echo "<?php phpinfo(); ?>" >> /var/www/html/index.php
- [root@snipeit ~]##重启httpd服务,添加防火墙例外之后在网页访问,查看是否有显示PHP版本页面
- [root@snipeit ~]# service httpd restart
- Redirecting to /bin/systemctl restart httpd.service
- [root@snipeit ~]# firewall-cmd --permanent --zone=public --add-port=80/tcp
- success
- [root@snipeit ~]# systemctl restart firewalld.service
复制代码
检查下PHP运行情况
我们开始检测一下环境配置 By kcuye
- [root@snipeit ~]# cat /etc/redhat-release
- CentOS Linux release 7.7.1908 (Core)
- [root@snipeit ~]# uname -a
- Linux snipeit 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
- [root@snipeit ~]# mysql --version
- mysql Ver 15.1 Distrib 5.5.64-MariaDB, for Linux (x86_64) using readline 5.1
- [root@snipeit ~]# php -v
- PHP 7.2.27 (cli) (built: Jan 26 2020 15:49:49) ( NTS )
- Copyright (c) 1997-2018 The PHP Group
- Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
- with Zend OPcache v7.2.27, Copyright (c) 1999-2018, by Zend Technologies
- [root@snipeit ~]# php -fpm -v
- PHP 7.2.27 (cli) (built: Jan 26 2020 15:49:49) ( NTS )
- Copyright (c) 1997-2018 The PHP Group
- Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
- with Zend OPcache v7.2.27, Copyright (c) 1999-2018, by Zend Technologies
- [root@snipeit ~]# httpd -v
- Server version: Apache/2.4.6 (CentOS)
- Server built: Aug 8 2019 11:41:18
复制代码
环境检测结束,开始安装snipe-it初始化并创建snipeit数据库
- [root@snipeit ~]# service mariadb start
- Redirecting to /bin/systemctl start mariadb.service
- [root@snipeit ~]# mysql_secure_installation
-
- 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:
- Sorry, passwords do not match.
-
- 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!
- [root@snipeit ~]##登陆数据库,创建对应用户及对应的数据库
- [root@snipeit ~]# mysql -u root -p
- Enter password:
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 10
- Server version: 5.5.64-MariaDB MariaDB Server
-
- Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
-
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-
- MariaDB [(none)]> create database snipeit;
- Query OK, 1 row affected (0.00 sec)
-
- MariaDB [(none)]> grant all on snipeit.* to 'snipeit'@'%' identified by 'Passw0rd';
- Query OK, 0 rows affected (0.00 sec)
-
- MariaDB [(none)]> flush privileges;
- Query OK, 0 rows affected (0.00 sec)
-
- MariaDB [(none)]> exit
- Bye
复制代码
安装composer,Composer是PHP的依赖管理器
- [root@snipeit ~]# cd ~
- [root@snipeit ~]# curl -sS https://getcomposer.org/installer | php
- All settings correct for using Composer
- Downloading...
-
- Composer (version 1.9.3) successfully installed to: /root/composer.phar
- Use it: php composer.phar
-
- [root@snipeit ~]# mv /root/composer.phar /usr/bin/composer
- [root@snipeit ~]##安装snipeit
- [root@snipeit ~]# cd /var/www
- [root@snipeit ~]# #安装git支持
- [root@snipeit www]# yum install -y git
- 已加载插件:fastestmirror, langpacks
- Loading mirror speeds from cached hostfile
- * base: mirrors.ustc.edu.cn
- * epel: mirrors.aliyun.com
- * extras: mirrors.163.com
- * updates: mirrors.aliyun.com
- * webtatic: us-east.repo.webtatic.com
- 正在解决依赖关系
- --> 正在检查事务
- ---> 软件包 git.x86_64.0.1.8.3.1-20.el7 将被 升级
- --> 正在处理依赖关系 git = 1.8.3.1-20.el7,它被软件包 perl-Git-1.8.3.1-20.el7.noarch 需要
- ---> 软件包 git.x86_64.0.1.8.3.1-21.el7_7 将被 更新
- --> 正在检查事务
- ---> 软件包 perl-Git.noarch.0.1.8.3.1-20.el7 将被 升级
- ---> 软件包 perl-Git.noarch.0.1.8.3.1-21.el7_7 将被 更新
- --> 解决依赖关系完成
-
- 依赖关系解决
-
- ========================================================================================================================================
- Package 架构 版本 源 大小
- ========================================================================================================================================
- 正在更新:
- git x86_64 1.8.3.1-21.el7_7 updates 4.4 M
- 为依赖而更新:
- perl-Git noarch 1.8.3.1-21.el7_7 updates 55 k
-
- 事务概要
- ========================================================================================================================================
- 升级 1 软件包 (+1 依赖软件包)
-
- 总计:4.4 M
- Downloading packages:
- Running transaction check
- Running transaction test
- Transaction test succeeded
- Running transaction
- 正在更新 : perl-Git-1.8.3.1-21.el7_7.noarch 1/4
- 正在更新 : git-1.8.3.1-21.el7_7.x86_64 2/4
- 清理 : perl-Git-1.8.3.1-20.el7.noarch 3/4
- 清理 : git-1.8.3.1-20.el7.x86_64 4/4
- 验证中 : git-1.8.3.1-21.el7_7.x86_64 1/4
- 验证中 : perl-Git-1.8.3.1-21.el7_7.noarch 2/4
- 验证中 : git-1.8.3.1-20.el7.x86_64 3/4
- 验证中 : perl-Git-1.8.3.1-20.el7.noarch 4/4
-
- 更新完毕:
- git.x86_64 0:1.8.3.1-21.el7_7
-
- 作为依赖被升级:
- perl-Git.noarch 0:1.8.3.1-21.el7_7
-
- 完毕!
复制代码
开始克隆snipe-it,这里从github克隆速度有些慢,需要很长时间,为做教程我对网络进行了一定的处理。.
什么?你问怎么对网络处理的?Emm......
- [root@snipeit www]# git clone https://github.com/snipe/snipe-it snipe-it
- 正克隆到 'snipe-it'...
- remote: Enumerating objects: 90083, done.
- remote: Total 90083 (delta 0), reused 0 (delta 0), pack-reused 90083
- 接收对象中: 100% (90083/90083), 92.79 MiB | 7.70 MiB/s, done.
- 处理 delta 中: 100% (56812/56812), done.
- [root@snipeit www]##编辑配置文件
- [root@snipeit www]# cd /var/www/snipe-it
- [root@snipeit snipe-it]# sudo cp .env.example .env
- [root@snipeit snipe-it]# vi .env
- [root@snipeit www]##APP_URL=192.168.208.128 #填入IP地址,IP查询命令ip add
- [root@snipeit www]##APP_TIMEZONE='Asia/Shanghai' #时区
- [root@snipeit www]##DB_DATABASE=snipeit #数据库名称
- [root@snipeit www]##DB_USERNAME=snipeit #数据库用户名
- [root@snipeit www]##DB_PASSWORD=Passw0rd #前面设置数据库密码
- [root@snipeit www]###其中
- [root@snipeit www]##APP_DEBUG=false #需要调试的时候请更改为true,一般用不到
- [root@snipeit www]##更改目录权限
- [root@snipeit snipe-it]# chown -R apache:apache storage public/uploads
- [root@snipeit snipe-it]# chmod -R 755 storage
- [root@snipeit snipe-it]# chmod -R 755 public/uploads
- [root@snipeit snipe-it]#安装PHP依赖,这里非常的慢,需要加载107个插件
- [root@snipeit snipe-it]# composer install --no-dev --prefer-source
- Loading composer repositories with package information
- Installing dependencies from lock file
- Package operations: 107 installs, 0 updates, 0 removals
- - Installing kylekatarnls/update-helper (1.2.0): Cloning 5786fa188e
- - Installing symfony/polyfill-util (v1.13.1): Cloning 964a67f293
- - Installing symfony/polyfill-php56 (v1.13.1): Cloning 53dd1cdf3c
- - Installing symfony/polyfill-ctype (v1.13.1): Cloning f8f0b461be
- - Installing paragonie/random_compat (v2.0.18): Cloning 0a58ef6e31
- - Installing symfony/polyfill-php70 (v1.13.1): Cloning af23c7bb26
- - Installing symfony/polyfill-mbstring (v1.13.1): Cloning 7b4aab9743
- - Installing symfony/http-foundation (v3.4.36): Cloning d2d0cfe8e3
- - Installing symfony/event-dispatcher (v3.4.36): Cloning f9031c22ec
- - Installing psr/log (1.1.2): Cloning 446d54b4cb
- - Installing symfony/debug (v3.4.36): Cloning f72e33fdb1
- - Installing symfony/http-kernel (v3.4.36): Cloning c42c8339ac
- - Installing vlucas/phpdotenv (v2.6.1): Cloning 2a7dcf7e3e
- - Installing symfony/css-selector (v3.1.10): Cloning 722a87478a
- - Installing tijsverkoyen/css-to-inline-styles (2.2.2): Cloning dda2ee426a
- - Installing symfony/var-dumper (v3.4.36): Cloning 569e261461
- - Installing symfony/routing (v3.4.36): Cloning b689ccd48e
- - Installing symfony/process (v3.4.36): Cloning 9a4545c01e
- - Installing symfony/finder (v3.4.36): Cloning 290ae21279
- - Installing symfony/console (v3.4.36): Cloning 1ee23b3b65
- - Installing symfony/polyfill-php72 (v1.13.1): Cloning 66fea50f6c
- - Installing symfony/polyfill-intl-idn (v1.13.1): Cloning 6f9c239e61
- - Installing symfony/polyfill-iconv (v1.13.1): Cloning a019efccc0
- - Installing doctrine/lexer (1.0.2): Cloning 1febd6c3ef
- - Installing egulias/email-validator (2.1.11): Cloning 92dd169c32
- - Installing swiftmailer/swiftmailer (v6.2.3): Cloning 149cfdf118
- - Installing ramsey/uuid (3.9.1): Cloning 5ac2740e0c
- - Installing psr/simple-cache (1.0.1): Cloning 408d5eafb8
- - Installing psr/container (1.0.0): Cloning b7ce3b1764
- - Installing symfony/translation (v3.4.36): Cloning 0be25347c4
- - Installing nesbot/carbon (1.39.1): Cloning 4be0c00516
- - Installing mtdowling/cron-expression (v1.2.1): Cloning 9504fa9ea6
- - Installing monolog/monolog (1.25.2): Cloning d5e2fb341c
- - Installing league/flysystem (1.0.57): Cloning 0e9db7f0b9
- - Installing erusev/parsedown (1.7.3): Cloning 6d89393817
- - Installing doctrine/inflector (1.3.1): Cloning ec3a552422
- - Installing laravel/framework (v5.5.48): Cloning e3e8d585dc
- - Installing asm89/stack-cors (1.2.0): Cloning c163e2b614
- - Installing barryvdh/laravel-cors (v0.11.4): Cloning 03492f1a3b
- - Installing maximebf/debugbar (v1.15.1): Cloning 6c4277f611
- - Installing barryvdh/laravel-debugbar (v3.2.8): Cloning 18208d6489
- - Installing dasprid/enum (1.0.0): Cloning 631ef6e638
- - Installing doctrine/annotations (v1.8.0): Cloning 904dca4eb1
- - Installing doctrine/reflection (v1.0.0): Cloning 02538d3f95
- - Installing doctrine/event-manager (1.1.0): Cloning 6295728199
- - Installing doctrine/collections (v1.5.0): Cloning a01ee38fcd
- - Installing doctrine/cache (1.10.0): Cloning 382e7f4db9
- - Installing doctrine/persistence (1.2.0): Cloning 43526ae633
- - Installing doctrine/common (v2.11.0): Cloning b8ca1dcf6b
- - Installing doctrine/dbal (v2.9.0): Cloning 21fdabe2fc
- - Installing eduardokum/laravel-mail-auto-embed (1.0.4): Cloning 918c3aff22
- - Installing enshrined/svg-sanitize (0.13.0): Cloning 4cf8d0f61e
- - Installing fideloper/proxy (4.2.1): Cloning 03085e58ec
- - Installing guzzlehttp/promises (v1.3.1): Cloning a59da6cf61
- - Installing ralouphie/getallheaders (3.0.3): Cloning 120b605dfe
- - Installing psr/http-message (1.0.1): Cloning f6561bf28d
- - Installing guzzlehttp/psr7 (1.6.1): Cloning 239400de7a
- - Installing intervention/image (2.5.1): Cloning abbf18d5ab
- - Installing jakub-onderka/php-console-color (v0.2): Cloning d5deaecff5
- - Installing javiereguiluz/easyslugger (v1.0.0): Cloning 11524a3fd7
- - Installing zendframework/zend-diactoros (1.8.7): Cloning a85e67b86e
- - Installing symfony/psr-http-message-bridge (v1.2.0): Cloning 9ab9d71f97
- - Installing phpseclib/phpseclib (2.0.23): Cloning c78eb5058d
- - Installing league/event (2.2.0): Cloning d2cc124cf9
- - Installing lcobucci/jwt (3.3.1): Cloning a11ec5f4b4
- - Installing defuse/php-encryption (v2.2.1): Cloning 0f407c43b9
- - Installing league/oauth2-server (6.1.1): Cloning a0cabb573c
- - Installing guzzlehttp/guzzle (6.4.1): Cloning 0895c93240
- - Installing firebase/php-jwt (v5.0.0): Cloning 9984a4d3a3
- - Installing laravel/passport (v4.0.3): Cloning 0542f1f82e
- - Installing nikic/php-parser (v4.3.0): Cloning 9a9981c347
- - Installing jakub-onderka/php-console-highlighter (v0.4): Cloning 9f7a229a69
- - Installing dnoegel/php-xdg-base-dir (0.1): Cloning 265b859349
- - Installing psy/psysh (v0.9.11): Cloning 75d9ac1c16
- - Installing laravel/tinker (v1.0.10): Cloning ad571aacba
- - Installing laravelcollective/html (v5.5.4): Cloning 04c596a699
- - Installing league/csv (9.4.1): Cloning bf83acc23a
- - Installing maknz/slack (1.7.0): Cloning 7f21fefc70
- - Installing neitanod/forceutf8 (v2.0.2): Cloning 30980a8ca2
- - Installing paragonie/constant_time_encoding (v2.3.0): Cloning 47a1cedd2e
- - Installing patchwork/utf8 (v1.3.2): Cloning d296e0026e
- - Installing phpdocumentor/reflection-common (2.0.0): Cloning 63a995caa1
- - Installing phpdocumentor/type-resolver (1.0.1): Cloning 2e32a6d489
- - Installing sebastian/recursion-context (3.0.0): Cloning 5b0cd72350
- - Installing sebastian/exporter (3.1.2): Cloning 68609e1261
- - Installing sebastian/diff (2.0.1): Cloning 347c1d8b49
- - Installing sebastian/comparator (2.1.3): Cloning 34369daee4
- - Installing webmozart/assert (1.6.0): Cloning 573381c0a6
- - Installing phpdocumentor/reflection-docblock (4.3.2): Cloning b83ff7cfcf
- - Installing doctrine/instantiator (1.3.0): Cloning ae466f7262
- - Installing phpspec/prophecy (1.9.0): Cloning f6811d96d9
- - Installing pragmarx/google2fa (v5.0.0): Cloning 17c969c82f
- - Installing bacon/bacon-qr-code (2.0.0): Cloning eaac909da3
- - Installing pragmarx/google2fa-qrcode (v1.0.3): Cloning fd5ff0531a
- - Installing pragmarx/google2fa-laravel (v1.3.0): Cloning 4ccc17dbf5
- - Installing predis/predis (v1.1.1): Cloning f0210e3888
- - Installing rollbar/rollbar (v1.8.1): Cloning 8a57ad9574
- - Installing rollbar/rollbar-laravel (v2.4.3): Cloning e581cd9a17
- - Installing schuppo/password-strength (v1.11): Cloning 7ab466d43c
- - Installing spatie/temporary-directory (1.1.5): Cloning 539d0856c5
- - Installing spatie/db-dumper (2.13.1): Cloning 8f88e6f772
- - Installing spatie/laravel-backup (5.12.1): Cloning 553562557e
- - Installing tecnickcom/tc-lib-color (1.12.13): Cloning 67402204a7
- - Installing tecnickcom/tc-lib-barcode (1.15.16): Cloning 60780acd7a
- - Installing tightenco/ziggy (v0.7.1): Cloning aa4c42aaec
- - Installing unicodeveloper/laravel-password (1.0.3): Cloning c2e532cbbb
- - Installing watson/validating (3.3.0): Cloning 288eb177e9
- Generating optimized autoload files
- Carbon 1 is deprecated, see how to migrate to Carbon 2.
- https://carbon.nesbot.com/docs/#api-carbon-2
- You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
- > Illuminate\Foundation\ComposerScripts::postAutoloadDump
- > [url=home.php?mod=space&uid=212996]@php[/url] artisan package:discover
- Discovered Package: barryvdh/laravel-cors
- Discovered Package: barryvdh/laravel-debugbar
- Discovered Package: eduardokum/laravel-mail-auto-embed
- Discovered Package: fideloper/proxy
- Discovered Package: intervention/image
- Discovered Package: laravel/passport
- Discovered Package: laravel/tinker
- Discovered Package: laravelcollective/html
- Discovered Package: nesbot/carbon
- Discovered Package: pragmarx/google2fa-laravel
- Discovered Package: rollbar/rollbar-laravel
- Discovered Package: schuppo/password-strength
- Discovered Package: spatie/laravel-backup
- Discovered Package: tightenco/ziggy
- Discovered Package: unicodeveloper/laravel-password
- Package manifest generated successfully.
复制代码
如果上述过程安装时间过长,可以修改为国内源之后重新安装尝试
- [root@snipeit snipe-it]##composer config -g repo.packagist composer https://packagist.phpcomposer.com
- [root@snipeit snipe-it]##生成app_key
- [root@snipeit snipe-it]# php artisan key:generate
- **************************************
- * Application In Production! *
- **************************************
-
- Do you really wish to run this command? (yes/no) [no]:
- > yes
-
- Application key [base64:BgJOq6cR/V+3ilFBaY+yzgV5ylL2Tyque36TYcGDFfc=] set successfully.
复制代码
修改Apache配置文件,创建虚拟主机
- [root@snipeit snipe-it]# vi /etc/httpd/conf.d/snipeit.example.com.conf
- [root@snipeit snipe-it]##<VirtualHost *:80>
- [root@snipeit snipe-it]## ServerName snipeit.example.com
- [root@snipeit snipe-it]## DocumentRoot /var/www/snipe-it/public
- [root@snipeit snipe-it]## <Directory /var/www/snipe-it/public>
- [root@snipeit snipe-it]## Options Indexes FollowSymLinks MultiViews
- [root@snipeit snipe-it]## AllowOverride All
- [root@snipeit snipe-it]## Order allow,deny
- [root@snipeit snipe-it]## allow from all
- [root@snipeit snipe-it]## </Directory>
- [root@snipeit snipe-it]##</VirtualHost>
- [root@snipeit snipe-it]##重启Apache服务
- [root@snipeit snipe-it]# service httpd restart
- Redirecting to /bin/systemctl restart httpd.service
- [root@snipeit snipe-it]##如果出现配置完成之后仍然无法访问,请关闭本机的selinux
- [root@snipeit snipe-it]# #临时关闭selinu
- [root@snipeit snipe-it]# setenforce 0
- [root@snipeit snipe-it]# #永久关闭selinux
- [root@snipeit snipe-it]# vi /etc/sysconfig/selinux
- [root@snipeit snipe-it]##SELINUX=enforcing 改为 SELINUX=disabled #永久关闭selinux
复制代码
打开网页开始配置Snipe-IT
|