CentOS 7 安装部署chemex开源资产管理系统

一、简介
咖啡壶是开源、高颜值的IT资产管理平台。资产管理、归属、追溯、盘点以及轻量的服务器状态面板。支持导出导入、LDAP、自定义字段等。基于优雅的Laravel框架和DcatAdmin开发。

二、环境准备
2.1、操作系统
此次部署固定资产管理系统使用的是Linux系统。CentOS 7.9,如何安装不做介绍。
关闭防火墙

systemctl stop firewalld
systemctl disable firewalld
[root@localhost ~]# vim /etc/selinux/config 
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled                #### 修改为disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

reboot                  # 重启linux系统

2.2、安装PHP

# 安装yum-utils 工具
yum install -y yum-utils

# 安装依赖
yum install openssl-devel gcc gcc-++ gcc-c++ wget make libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel bison autoconf sqlite-devel oniguruma-devel git

# 更换yum源
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
#为PHP 8启用流模块
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable remi-php80

#安装PHP 8及扩展:
yum install -y php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis  php-xmlrpc php-fileinfo php-mysqli php-ldap

[root@localhost ~]# php -v
PHP 8.0.8 (cli) (built: Jun 29 2021 07:41:19) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.8, Copyright (c) Zend Technologies

# php 安装成功 修改php.ini文件
vim /etc/php.ini
zlib.output_compression = On

systemctl start php-fpm

2.3、安装nginx

useradd www -s /sbin/nologin
wget http://nginx.org/download/nginx-1.22.1.tar.gz
tar zxvf nginx-1.22.1.tar.gz
cd nginx-1.22.1
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-pcre --with-file-aio
make && make install

配置nginx

server {
    listen       80;
    index  index.php index.html;
    root   /opt/var/www/chemex/public/; #源码目录
    try_files $uri $uri/ /index.php?$args; #伪静态规则
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME /opt/var/www/chemex/public$fastcgi_script_name;
        include        fastcgi_params;
    }
}

2.4、数据库

#修改 yum源指向 清华大学镜像
vim /etc/yum.repos.d/mysql.repo
[mysql]
name= mysql8.0
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-8.0-community-el7-x86_64/
enable=1
gpgcheck=0

yum clean all && yum makecache
yum install mysql-community-server -y     
systemctl enable --now mysqld
grep "password" /var/log/mysqld.log 

mysql -uroot -p

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
set global validate_password.policy=0;    #关闭密码复杂度检查
create database chemex;
create user 'chemex'@'%' identified by 'admin@123';
grant all privileges on chemex.* to 'chemex'@'%';
flush privileges

2.5、安装composer

php -r "readfile('https://getcomposer.org/installer');" | php
mv composer.phar /usr/local/bin/composer
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/            # 更换国内源
composer config -g -l repo.packagist                      # 查看当前源

三、安装部署
3.1、下载咖啡壶源码

mkdir -p /opt/var/www && cd /opt/var/www
git clone https://github.com/celaraze/chemex.git
chown -R apahce.apache chemex
chmod -R 755 chemex
chmod -R 777 chemex/storage
cd chemex
cp .env.example .env
vim .env
    DB_CONNECTION=mysql #数据库类型,不需要修改(兼容mariadb)
    DB_HOST=127.0.0.1 # 数据库地址
    DB_PORT=3306 # 数据库端口号
    DB_DATABASE=chemex # 数据库名称
    DB_USERNAME=chemex # 数据库用户名
    DB_PASSWORD=admin@123 # 数据库密码,自己在MySQL中的配置的密码

3.2、执行安装chemex

composer install
php artisan chemex:install
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《CentOS 7 安装部署chemex开源资产管理系统》
文章链接:https://zhuji.vsping.com/2757.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。