CentOS7 installs IT asset management system Snipe-IT

   Copyright statement: This article is an original article by Shaon Puppet. Please indicate the original address for reprinting. Thank you very much. https://blog.csdn.net/wh211212/article/details/80814045

CentOS7 install IT asset management system#

Snipe-IT Introduction##

Installation requirements##

Hostname Role IP
snipeit.aniu.so snipeit 192.168.0.220
PHP version MySQL version snipeit version
7.2.7 5.7 4.4.1
sudo yum -y install epel-release
sudo yum update -y
# The author uses nginx
echo '[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
' | sudo tee /etc/yum.repos.d/nginx.repo

sudo yum install nginx -y
systemctl start nginx
systemctl enable nginx
# Configure remi source
sudo yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo sed -i -e "s/enabled=1/enabled=0/g"/etc/yum.repos.d/remi-safe.repo

# Download php
yum --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 -v
PHP 7.2.7(cli)(built: Jun 20201807:26:08)( NTS )Copyright(c)1997-2018 The PHP Group
Zend Engine v3.2.0,Copyright(c)1998-2018 Zend Technologies
# Write to environment variable
[ root@ops-01~]# vi /etc/profile.d/php72.sh #Remember to do
#! /bin/bash
source /opt/remi/php72/enable
export X_SCLS="`scl enable php72 'echo $X_SCLS'`"
# Reference: https://blog.csdn.net/wh211212/article/details/62881670, the author here uses the mysql that has been installed before, so the installation process will not be described separately
# Log in to the database
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;
# Install Composer using the following command,Composer is a dependency manager for PHP
[ root@ops-01~]# curl -sS https://getcomposer.org/installer | php
All 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/composer
# Install git
[ root@ops-01~]# cd /data/[root@ops-01 data]# sudo git clone https://github.com/snipe/snipe-it snipeit #The author is particularly slow when cloning. The source code downloaded directly by the author

# Create from the provided sample file.env file
cd /data/snipeit
sudo cp .env.example .env

# edit.env file, find the following line and modify it according to the instructions provided
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=production
APP_DEBUG=false #This is changed to true when troubleshooting
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.
# /data/snipeit
cd /data/snipeit
chown -R nginx:nginx 
chmod -R 755 storage
chmod -R 755public/uploads
cd ~
curl - sS https://getcomposer.org/installer | php
sudo mv composer.phar /data/snipeitsnipe-it
php composer.phar install --no - dev --prefer - source
[ 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.
[ 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{return404;} 

 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;}}
# Specific optimization parameters are in nginx.conf configuration

1

Recommended Posts

CentOS7 installs IT asset management system Snipe-IT
centos system management
Centos system process management
Deploy Graylog open source log management system under CentOS7
01 CentOS 7.6 switch system language
CentOS7.5-1804 system kernel upgrade
CentOS system startup process
VirtualBox install CentOS system
CentOS 8.0 installs docker error
Centos7.2 system optimization original