In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
I. introduction
Snipe-IT is a free open source IT asset management web application. Is a free and open source IT asset management system based on Laravel5.4. Snipe-IT is used for IT asset management, through which IT departments can track who owns which laptops, when they buy them, what software licenses and accessories are included, and so on.
Main features: can be hosted on CVM, powerful REST API, fast update, ensure the security of APP and Platform, one-click backup, LDAP login / user synchronization.
II. Environmental preparation
The system used in this installation is as follows:
1. Operating system:
Centos7.6: CentOS Linux release 7.6.1810 (Core)
2 、 Apache
This system is built using Apache2.4.6.
3 、 PHP
This system is built using PHP7.2.
4. Database
The database version used in this system is: Mariadb5.5.60
Third, prepare before installation
1. System update. The system used here is the minimum installed version of Centos7.6.
Yum-y install epel-release
Yum update-y
2. Install Apache 2.4.6 using yum
Yum install-y httpd httpd-devel
Httpd-v
3. Use yum to install Mariadb database
Yum install-y mariadb mariadb-server
4. Install PHP with source code and configure Apache support
Dependent environment required to install PHP
Yum install-y make gcc wget openssl readline-devel openssl-devel libxslt-devel gmp-devel bzip2-devel freetype-devel libjpeg-devel php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd jpegsrc libmcrypt libpng libpng-devel libjpeg libxml2 libxml2-devel zlib curl curl-devel
Download the PHP installation package and extract it:
Cd / home
Wget http://cn2.php.net/get/php-7.2.3.tar.gz/from/this/mirror
Tar zxvf mirror
Compile and install PHP7.2.3 with source code:
Cd php-7.2.3
Ls
Check the configuration:
/ configure-- prefix=/usr/local/php7.2.3-- with-config-file-path=/etc-- enable-fpm-- enable-inline-optimization-- disable-debug-- disable-rpath-- enable-shared-- enable-soap-- with-apxs2=/usr/bin/apxs-- with-libxml-dir-- with-xmlrpc-- with-openssl-- with-mcrypt-- with-mhash-- with-pcre-regex-with-sqlite3-- with-zlib-- enable-bcmath- -with-iconv-- with-bz2-- enable-calendar-- with-curl-- with-cdb-- enable-dom-- enable-fileinfo-- enable-filter-- with-pcre-dir-- enable-ftp-- with-gd-- with-openssl-dir-- with-jpeg-dir-- with-png-dir-- with-zlib-dir-with-freetype-dir-- enable-gd-native-ttf-- enable-gd-jis-conv-- with-gettext-- -with-gmp-with-mhash-- enable-json-- enable-mbstring-- enable-mbregex--enable-mbregex-backtrack-- with-libmbfl-- with-onig-- 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-- enable-wddx-- with -libxml-dir-with-xsl-- enable-zip-- enable-mysqlnd-compression-support-- with-pear-- enable-opcache
(PS: this procedure will be checked for about a minute. As long as there is no error, it will be executed until the following interface appears:)
After the above check is free of errors, the following installation and compilation begins:
Make & & make install
(PS: this process will probably last about three to five minutes. According to the performance of your device, as long as you do not report an error, you will wait for self-installation until the following interface appears:)
After waiting for the above installation to complete, the following needs to configure the environment variable of php:
Vim / etc/profile
Add the following information at the bottom of the file:
PATH=$PATH:/usr/local/php7.2.3/bin
Export PATH
Make its environment variable effective:
Source / etc/profile
Configure php-fpm to complete the following:
Cd / home/php-7.2.3
Cp php.ini-production / etc/php.ini
Cp / usr/local/php7.2.3/etc/php-fpm.conf.default / usr/local/php7.2.3/etc/php-fpm.conf
Cp / usr/local/php7.2.3/etc/php-fpm.d/www.conf.default / usr/local/php7.2.3/etc/php-fpm.d/www.conf
Cp sapi/fpm/init.d.php-fpm / etc/init.d/php-fpm
Chmod + x / etc/init.d/php-fpm
Start php-fpm
Service php-fpm start
Check the enabled status:
Lsof-iPUR 9000
(PS: lsof is not installed this time, you can use yum to install lsof first)
Modify the httpd.conf file
Vim / etc/httpd/conf/httpd.conf
The information that needs to be modified is as follows:
(1) add the following line after AddType application*
AddType application/x-httpd-php .php .phtml
(2) add index.php to DirectoryIndex index.html
DirectoryIndex index.php index.html
(3) make sure that the following fields are included in the httd.conf file, and if not, add this field (already exists, no need to be added)
LoadModule php7_module / usr/lib64/httpd/modules/libphp7.so
Restart the httpd service:
Service httpd restart
Verify PHP support and version information for httpd:
Echo "> > / var/www/html/index.php
Restart the service and view the httpd status:
Systemctl restart httpd
Systemctl status httpd
Enter the server address in the browser to verify that PHP is installed successfully:
(PS: before you do this step, you need to turn off the firewall of the server, or add the following command:
Firewall-cmd-permanent-zone=public-add-port=80/tcp
Systemctl restart firewalld.service) otherwise the browser will not display properly.
Third, install Snipe-IT
1. Initialize and create the snipeit database
Service mariadb start # start the maraidb service
Mysql_secure_installation # initialize database service
Log in to the database and create the corresponding users and the corresponding database
Mysql-u root-p
Mysql > create database snipeit
Mysql > grant all on snipeit.* to 'snipeit'@'%' identified by' 324215'
Mysql > flush privileges
Mysql > exit
2. Install composer
What is composer:
Composer is a command-line tool created by Jordi Boggiano and Nils Aderman whose mission is to help you automatically install dependent development packages for your project. Many of the ideas in Composer are borrowed from npm and Bundler, and if you know anything about these two tools, you will find them in composer. Composer includes a dependency parser to handle complex dependencies between development packages; in addition, it contains interesting things such as downloaders, installers, and so on.
Download and install compose:
Cd
Curl-sS https://getcomposer.org/installer | php
Mv / root/composer.phar / usr/bin/composer
3. Install snipeit
Cd / var/www
Yum install-y git
Git clone https://github.com/snipe/snipe-it snipe-it
Edit configuration file
Cd / var/www/snipe-it
Sudo cp .env.example .env
Vim .env
Cd / var/www
Yum install-y git
Git clone https://github.com/snipe/snipe-it snipe-it
APP_URL=192.168.201.102 # enter the address
APP_TIMEZONE='Asia/Shanghai' # enter country address
DB_DATABASE=snipeit # Database name
DB_USERNAME=snipeit # Database user name
DB_PASSWORD=324215 # database password
Among them
APP_DEBUG=false
Please change it to true when debugging
Change directory permissions:
Chown-R apache:apache storage public/uploads
Chmod-R 755 storage
Chmod-R 755 public/uploads
Install PHP dependencies using composer
Composer install-no-dev-prefer-source
(PS: installation is in progress. This step will take a long time to install. Please wait patiently. )
(such an error may occur in the middle, ignore it and wait for the installation to continue)
(PS: this process took about two hours to install, and the installation was finally successful. The above interface appears)
If the installation time is too long, you can modify the source and try again
Composer config-g repo.packagist composer https://packagist.phpcomposer.com
Generate app_key
Php artisan key:generate
4. Modify the Apache configuration file to create a virtual host
Vim / etc/httpd/conf.d/snipeit.example.com.conf
The specific configuration information is as follows:
ServerName snipeit.example.com
DocumentRoot / var/www/snipe-it/public
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Restart the Apache service and check the Apache status:
Systemctl restart httpd
Systemctl enable httpd
Systemctl status httpd
At present, Snipe-IT has been installed, so error checking and pre-installation configuration check are needed.
IV. Elimination and problems encountered
1. Close the selinux of the system:
Vim / etc/sysconfig/selinux
2. Check and report errors before installation
The browser enters the server IP address:
3. Create a user and handle errors:
The above error should be caused by the database. Modify the .env file:
Cd / var/www/snipe-it
Vim .env
The environment, database and server of this article are installed on the same server, modify DB_HOST=172.31.14.167 (server address)
Systemctl restart mariadb # restart the maraidb service
Systemctl enable mariadb
Systemctl status mariadb
4. Continue checking for errors and creating users
5. Fill in the user information:
Fifth, interface display:
1. Turn off debug mode:
Cd / var/www/snipe-it
Vim .env
2. Restart the httpd service
Systemctl restart httpd
3. The browser reopens the server address:
The above steps have completed the installation of the snipe-IT system and can be displayed as the Chinese version normally.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.