最新消息:时间抓起来说是金子,抓不住就是流水。

AlmaLinux 8 安装部署chemex开源资产管理系统

LINUX技术 老子黑牵翻 927浏览 0评论

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

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

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 工具
dnf install -y yum-utils
 
# 安装依赖
dnf install -y openssl-devel gcc gcc-c++ wget make libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel bison autoconf sqlite-devel git
 
# 更换yum源
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
#为PHP 8启用流模块
dnf module reset php
dnf module install php:remi-8.0
 
#安装PHP 8及扩展:
dnf 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.28 (cli) (built: Feb 14 2023 11:05:44) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.28, Copyright (c), by 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、数据库

#安装mysql 8的官方源
dnf install -y https://dev.mysql.com/get/mysql80-community-release-el8-5.noarch.rpm

dnf clean all && dnf makecache
dnf install mysql-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

转载请注明:LINUX服务器运维架构技术分享 » AlmaLinux 8 安装部署chemex开源资产管理系统

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址