与开源软件glpi一样,snipe-it也是用于管理IT资产的软件。
部署之前,需要把软件运行环境搭建起来,主要是apache ,mysql,PHP
一、环境部署简单如下:
1、YUM安装apache

[root@localhost ~]#  yum install -y httpd httpd-devel
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# httpd  -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Mar 24 2022 14:57:57
[root@localhost ~]#


2、YUM安装最新Mariadb

[root@localhost ~]# vim /etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://mirrors.aliyun.com/mariadb/yum/10.3/centos7-amd64/
gpgkey =  http://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base epel extras mariadb remi-safe updates
Cleaning up list of fastest mirrors
Other repos take up 21 M of disk space (use --verbose for details)
[root@localhost ~]# yum makecache[root@localhost ~]# yum -y install MariaDB-server MariaDB-client

3、源码编译安装PHP7.4

[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget -c https://www.php.net/distributions/php-7.4.10.tar.gz
[root@localhost src]# tar -zxvf php-7.4.10.tar.gz
[root@localhost src]# cd php-7.4.10
[root@localhost php-7.4.10]# yum install -y make gcc wget openssl readline-devel openssl-devel libxslt-devel gmp-devel bzip2-devel freetype-devel libjpeg-devel   autoconf  freetype gd jpegsrc libmcrypt libpng libpng-devel libjpeg libxml2 libxml2-devel zlib curl curl-devel sqlite sqlite-devel oniguruma oniguruma-devel[root@localhost php-7.4.10]#./configure --prefix=/usr/local/php7.4.1
[root@localhost php-7.4.10]# ./configure --prefix=/usr/local/php7.4.1 --with-config-file-path=/etc --enable-fpm --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-soap --with-apxs2=/usr/bin/apxs  --with-xmlrpc --with-openssl --with-mhash --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter  --enable-ftp --enable-gd --with-openssl-dir  --with-zlib-dir   --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --enable-mbregex   --enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm  --with-xsl  --enable-mysqlnd-compression-support --with-pear --enable-opcachemake && make install#添加PHP环境变量,并使之生效
[root@localhost php-7.4.10]# vim /etc/profile
PATH=$PATH/usr/local/php7.4.1/bin
export PATH
"/etc/profile" 78L, 1866C written
[root@localhost php-7.4.10]# source /etc/profile
[root@localhost php-7.4.10]# cp php.ini-production  /etc/php.ini
[root@localhost php-7.4.10]# cp /usr/local/php7.4.1/etc/php-fpm.conf.default  /usr/local/php7.4.1/etc/php-fpm.conf
[root@localhost php-7.4.10]# cp /usr/local/php7.4.1/etc/php-fpm.d/www.conf.default  /usr/local/php7.4.1/etc/php-fpm.d/www.conf
[root@localhost php-7.4.10]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@localhost php-7.4.10]# chmod +x /etc/init.d/php-fpm
[root@localhost php-7.4.10]#
#启动php服务
[root@localhost php-7.4.10]# /etc/init.d/php-fpm start
Starting php-fpm  done
[root@localhost php-7.4.10]# php -v
PHP 7.4.28 (cli) (built: Feb 15 2022 13:23:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologieswith Zend OPcache v7.4.28, Copyright (c), by Zend Technologieswith Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
[root@localhost php-7.4.10]#

4、配置httpd,启到PHP模块

[root@localhost php-7.4.10]# vim /etc/httpd/conf/httpd.conf#增加:
1、<IfModule dir_module>DirectoryIndex index.php index.html
</IfModule>2、 #AddType application/x-compress .ZAddType application/x-gzip .gz .tgzAddType application/x-httpd-php .php .phtml#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews3、
# LoadModule foo_module modules/mod_foo.so
LoadModule php7_module        /usr/lib64/httpd/modules/libphp7.so
#
Include conf.modules.d/*.conf

重启apache

[root@localhost php-7.4.10]# systemctl restart httpd
[root@localhost php-7.4.10]#

二、安装snipe-it
1、初始化并创建snipeit数据库

[root@localhost php-7.4.10]# systemctl start mariadb
[root@localhost php-7.4.10]# mysql_secure_installation
#初始化完成,登录,创建数据库,并授权
[root@localhost php-7.4.10]# mysql -uroot -p
MariaDB [(none)]> create database snipe;
Query OK, 1 row affected (0.000 sec)MariaDB [(none)]> grant all on snipe.* to 'snipe'@'%' identified by 'snipe';
Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]>

2、下载,解压snipeit软件包

[root@localhost php-7.4.10]# cd /usr/src/
[root@localhost src]# rz
rz waiting to receive.zmodem trl+C ȡ100%   15417 KB 15417 KB/s 00:00:01       0 Errors.gz...[root@localhost src]# tar -zxvf snipe-it-6.0.0-RC-6.tar.gz
[root@localhost src]# mv snipe-it-6.0.0-RC-6 snipe-it
[root@localhost src]# mv snipe-it /var/www/
[root@localhost src]# cd /var/www/snipe-it/
[root@localhost snipe-it]#
#配置snipe配置文件
[root@localhost snipe-it]# cp .env.example .env
[root@localhost snipe-it]# vim .env#修改为如下几处:
APP_URL=172.18.1.252
APP_TIMEZONE='Asia/Shanghai'
APP_LOCALE=cnDB_DATABASE=snipe
DB_USERNAME=snipe
DB_PASSWORD=snipe#授权目录权限
[root@localhost snipe-it]# chown -R apache. storage public/uploads/
[root@localhost snipe-it]# chmod -R 755 storage/
[root@localhost snipe-it]# chmod -R 755 public/uploads/
[root@localhost snipe-it]#

3、配置apache,创建虚拟主机

[root@localhost snipe-it]# vim /etc/httpd/conf.d/snipeit.com.conf #增加:
<VirtualHost *:80>
ServerName snipeit.com
DocumentRoot /var/www/snipe-it/public/
<Directory /var/www/snipe-it/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride ALL
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

4、使用composer安装PHP依赖

#安装composer
[root@localhost snipe-it]# cd /usr/src/
[root@localhost src]# curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...Composer (version 2.3.3) successfully installed to: /usr/src/composer.phar
Use it: php composer.phar[root@localhost src]# mv composer.phar /usr/bin/composer
[root@localhost src]# #使用composer安装php依赖
[root@localhost src]# cd /var/www/snipe-it/
#更换composer下载镜像地址,默认是国外https://repo.packagist.org,更改为国外,这里替换为阿里云
[root@localhost snipe-it]# composer config -g -l repo.pachagist
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://repo.packagist.org
[process-timeout] 300
[use-include-path] false
[allow-plugins]
[use-parent-dir] prompt
[preferred-install] dist
[notify-on-install] true
[github-protocols] [https, ssh]
[gitlab-protocol]
[vendor-dir] vendor (/var/www/snipe-it/vendor)
[bin-dir] {$vendor-dir}/bin (/var/www/snipe-it/vendor/bin)
[cache-dir] /root/.cache/composer
[data-dir] /root/.local/share/composer
[cache-files-dir] {$cache-dir}/files (/root/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/root/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/root/.cache/composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[cache-read-only] false
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[lock] true
[platform-check] php-only
[home] /root/.config/composer
[root@localhost snipe-it]# composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
[root@localhost snipe-it]# composer config -g -l repo.pachagist
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://mirrors.aliyun.com/composer/
[process-timeout] 300
[use-include-path] false
[allow-plugins]
[use-parent-dir] prompt
[preferred-install] dist
[notify-on-install] true
[github-protocols] [https, ssh]
[gitlab-protocol]
[vendor-dir] vendor (/var/www/snipe-it/vendor)
[bin-dir] {$vendor-dir}/bin (/var/www/snipe-it/vendor/bin)
[cache-dir] /root/.cache/composer
[data-dir] /root/.local/share/composer
[cache-files-dir] {$cache-dir}/files (/root/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/root/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/root/.cache/composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[cache-read-only] false
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[lock] true
[platform-check] php-only
[home] /root/.config/composer
[root@localhost snipe-it]#
#更新
[root@localhost snipe-it]# composer update
#更新106包
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
106 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
[root@localhost snipe-it]#

执行PHP依赖检查安装

[root@localhost snipe-it]# composer install --no-dev --prefer-source
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 0 updates, 32 removals- Removing theseer/tokenizer (1.2.1)- Removing symfony/yaml (v5.4.3)- Removing symfony/dom-crawler (v4.4.39)- Removing sebastian/version (3.0.2)- Removing sebastian/type (2.3.4)- Removing sebastian/resource-operations (3.0.3)- Removing sebastian/object-reflector (2.0.4)- Removing sebastian/object-enumerator (4.0.4)- Removing sebastian/lines-of-code (1.0.3)- Removing sebastian/global-state (5.0.5)- Removing sebastian/environment (5.1.4)- Removing sebastian/complexity (2.0.2)- Removing sebastian/code-unit-reverse-lookup (2.0.3)- Removing sebastian/code-unit (1.0.8)- Removing sebastian/cli-parser (1.0.1)- Removing phpunit/phpunit (9.5.18)- Removing phpunit/php-token-stream (3.1.3)- Removing phpunit/php-timer (5.0.3)- Removing phpunit/php-text-template (2.0.4)- Removing phpunit/php-invoker (3.1.1)- Removing phpunit/php-file-iterator (3.0.6)- Removing phpunit/php-code-coverage (9.2.15)- Removing php-webdriver/webdriver (1.12.0)- Removing phar-io/version (3.2.1)- Removing phar-io/manifest (2.0.3)- Removing overtrue/phplint (3.0.6)- Removing n98/junit-xml (1.1.0)- Removing myclabs/deep-copy (1.11.0)- Removing mockery/mockery (1.5.0)- Removing laravel/dusk (v6.22.3)- Removing hamcrest/hamcrest-php (v2.0.1)- Removing fakerphp/faker (v1.19.0)
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
82 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
[root@localhost snipe-it]#

5、 生成 app_key

[root@localhost snipe-it]# php artisan key:generate
**************************************
*     Application In Production!     *
**************************************Do you really wish to run this command? (yes/no) [no]:> yesApplication key set successfully.
[root@localhost snipe-it]#


至此,snipe-it部署完成,打开浏览器,输入地址,按提示配置就可以了


部署开源软件snipe-it相关推荐

  1. 企业使用开源软件的风险

    很多时候,我们过高地估计了开源软件面临的版权威胁,开源软件并非天生就比专有软件存在更多风险.虽然在企业中开源软件越来越普及,但开源软件始终难以摆脱知识产权带来的阴影.2007年,微软声称开源软件侵犯了 ...

  2. Spring Boot 2.0(六):使用 Docker 部署 Spring Boot 开源软件云收藏

    只需三步即可部署开源项目云收藏,打造专属个人的收藏系统,就是这么简单! 云收藏项目已经开源2年多了,作为当初刚开始学习 Spring Boot 的练手项目,使用了很多当时很新的技术,现在看来其实很多新 ...

  3. 开源软件让云服务部署加速前行

    开源软件让云服务部署加速前行 为了提高云部署的速度与稳定性,英特尔IT部门为私有云增加了混合解决方案,包括OpenStack软件--一种可扩展的开源云操作环境.使用OpenStack,加上内部代码与现 ...

  4. 在云中利用开源软件进行开发以提高创新能力

    企业可以在自己的云平台上利用开源软件开发应用程序以提高创新能力,而无需为创新支付更多的费用. 企业可以在自己的云平台上利用开源软件开发应用程序以提高创新能力,而无需为创新支付更多的费用. 在大多数企业 ...

  5. 银行选型和排坑实战:用开源软件自建分布式数据服务平台

    来自:DBAplus社群 之前设计篇讲了数据拆分的方式.场景.优缺点以及实施步骤,偏方法与理论.技术篇会介绍分布式数据服务平台设计与实现,讲述如何通过技术手段解决数据拆分带来的各种问题,以及各中间件的 ...

  6. 2014年最热门的国人开发开源软件TOP100

    2014年最热门的国人开发开源软件TOP100 不知道从什么时候开始,很多一说起国产好像就非常愤慨,其实大可不必.做开源中国六年有余,这六年时间国内的开源蓬勃发展,从一开始的使用到贡献,到推出自己很多 ...

  7. 2019年度最受欢迎中国开源软件公布

    点击上方"深度学习技术前沿",选择"星标"公众号 资源干货,第一时间送达 经过 22 天的投票评选,今天 2019 年度最受欢迎中国开源软件产生了. 开源中国( ...

  8. 2015 年 Git@OSC 新增热门开源软件项目 Top 50

    在刚刚过去的 2015 年里,Git@OSC 取得了巨大的发展,收录了大量热门优秀作品.与<2015 年 Git@OSC 最热门开源项目 Top 50>一样,此榜单仍然是通过 Watch. ...

  9. 2011 年最重要的 10 个开源软件

    2011 年即将过去,是该对这即将过去的这一年做一个总结,这么一个标题如何去确定其实是很难的,而且也可能会比较片面.那么什么叫做"重要"呢,什么样的开源软件算是"重要&q ...

最新文章

  1. 5分钟掌握手动优化机器学习模型超参数
  2. Java刷题知识点之进程和线程的区别
  3. 完成GitHub个人主页设计,只需要这三步
  4. 【Hihocoder - offer编程练习赛86 - C】跳数游戏(STLset或map预处理,dp)
  5. java 对象加密_java.security包实现对象加密
  6. php unset函数_PHP | 使用unset()函数从数组中删除元素
  7. AJAX应用之注册用户即时检测
  8. 拼接SQL文的测试方法
  9. less 、more 翻页显示文件内容
  10. 树莓派如何接硬盘_利用树莓派和闲置硬盘,搭建起家中的个人网盘
  11. 编码器及编码器在SMART200中的使用
  12. [路由器] k2p支持ipv6相关设置
  13. JavaScript如何实现汉字按拼音首字母分组拼序
  14. 常用应届生Java开发笔试面试题(更新中)
  15. 联合开发网被罚50万元,站长直接关站!
  16. GPS基带P码处理总结——FPGA实现的关键点
  17. 波特率、比特率 与数据传输速率的区别
  18. AR可视化远程协助,医护诊疗,对讲指挥调度系统方案
  19. 数据库集群技术(转载)
  20. python脚本名_python获取类名函数名、脚本路径

热门文章

  1. 第二十三课:运算放大电路正反馈
  2. 【微信小程序】一文带你吃透开发中的常用组件
  3. ティラミス / 龙枪
  4. C语言实现一元多项式的加减运算
  5. springboot毕设项目线上跳蚤市场平台iy7e7(java+VUE+Mybatis+Maven+Mysql)
  6. 2022.01.05 Acwing寒假每日一题 拖拉机
  7. WINVER 和 _WIN32_WINNT
  8. Python实现量化选股
  9. C语言字母大小写互换的简单方法
  10. 【睡眠障碍】睡觉前数绵羊对睡眠障碍没有作用