首页 > 系统相关 >CentOS 7安装部署咖啡壶 chemex 开源资产管理系统

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

时间:2023-06-02 11:32:54浏览次数:50  
标签:CentOS local nginx html yum usr chemex php 咖啡壶

一、简介

    咖啡壶chemex是一款开源、高颜值的IT资产管理平台。资产管理、归属、追溯、盘点以及轻量的服务器状态面板。支持导出导入、LDAP、自定义字段等。

    由于公司目前暂时没有资产管理系统平台,公司的网络设备类资产都是通过Excel表格来进行统计和维护,整个过程全靠手工,非常不方便。于是,在Github上找到一个开源资产管理系统-咖啡壶chemex,下面分享下具体的安装过程。在安装时,踩了不少坑,对于安装时的报错也做了整理,以供大家参考和学习。

二、环境准备

2.1、操作系统

此次部署固定资产管理系统使用的是Linux系统CentOS 7.9,操作系统安装不做介绍。



[root@aliyun ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)



#关闭防火墙



systemctl stop firewalld
systemctl disable firewalld




#关闭selinux

[root@localhost html]# 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

安装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



# 更换yum源



sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm



#为PHP 8启用流模块



sudo yum-config-manager --disable 'remi-php*'
sudo yum-config-manager --enable remi-php80



#安装PHP 8及扩展:



yum install php -y
yum install -y 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 GroupZend 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  nginx -s /sbin/nologin

#nginx源码可登录nginx官网进行下载,http://nginx.org/en/download.html

tar zxf nginx-1.20.1.tar.gz -C /usr/local/
cd /usr/local/nginx-1.20.1./configure --prefix=/usr/local/nginx --with-http_dav_module \
--with-http_stub_status_module --with-http_addition_module \
--with-http_sub_module --with-http_flv_module --with-http_mp4_module \
--with-http_ssl_module --user=nginx --group=nginx
 
make && make install


配置systemctl托管nginx


vim /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target remote-fs.target

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecStop=/usr/local/nginx/sbin/nginx -s stop
ExecReload=/usr/local/nginx/sbin/nginx -s reload

[Install]
WantedBy=multi-user.target

systemctl daemon-reload  && systemctl start nginx


配置nginx.conf


user  nginx;
worker_processes  1;
events {
   worker_connections  1024;
}
http {
   include       mime.types;
   default_type  application/octet-stream;
   sendfile        on;
   keepalive_timeout  65;
   server {
       listen       80;
       server_name  localhost;
       root /usr/local/nginx/html/public/;
       location / {
           index  index.html index.htm index.php;
           try_files $uri $uri/ /index.php?$args;
       }
       error_page   500 502 503 504  /50x.html;
       location = /50x.html {
           root   /usr/local/nginx/html/public/;
       }
       location ~ \.php$ {
           root           html;
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html/public/$fastcgi_script_name;
           include        fastcgi_params;
       }
   }
}


2.4、数据库

安装MySQL数据库

#修改 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'@'%' IDENTIFIED BY '数据库密码';
create database chemex;
create user 'chemex'@'%' identified by 'admin';
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、下载咖啡壶源码

咖啡壶下载地址:https://gitee.com/celaraze/chemex.git

cd /usr/local/nginx                                      # 切换到网站根目录
git clone https://gitee.com/celaraze/chemex.git          # 下载咖啡壶源码
rm -rf html                                                                                  # 删除默认html根目录
mv chemex html                                           # 将下载的源码重命名为html
chown -R nginx:nginx html                                # 更改根目录的属组和属主为nginx,将nginx的安装目录/usr/local/nginx的属组和属主为nginx,nginx是中间件nginx的运行用户。
chmod -R 755 html                                        # 修改根目录的权限属性
chmod -R 777 html/storage                                # 修改html/storage的权限属性为777
cp .env.example .env                                     # 拷贝.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                                    # 数据库密码,自己在MySQL中的配置的密码

3.2、执行安装chemex

cd /usr/local/nginx/html
#执行安装chemex
php artisan chemex:install
chmod 777 -R /html/storage

四、访问资产管理系统

通过访问http://your_ip打开资产管理系统,初始密码为admin/admin

CentOS 7安装部署咖啡壶 chemex 开源资产管理系统_php

五、常见问题

1、执行安装chemex时,提示php版本不符合要求

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.29-1

解决方法:

#首先,禁用当前PHP80源
yum-config-manager --disable remi-php80
#然后,启用需要升级的PHP82源
yum-config-manager --enable remi-php82
#最后,升级更新
yum update -y
#更新完成后查看当前的php版本
[root@aliyun html]# php -v
PHP 8.2.4 (cli) (built: Mar 14 2023 16:11:05) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.2.4, Copyright (c) Zend Technologies

2、当执行yum update更新时,报如下错误

yum报错:You could try using --skip-broken to work around the problem You could try running: rpm -Va

解决方法:

yum update -y --skip-broken

3、所有安装步骤操作完成,访问http://your_ip时,web界面报如下错误,查看后台日志如下

web界面报错:

nginx 500 internal server error

后台日志:

[root@aliyun ~]# tailf /usr/local/nginx/logs/error.log
2023/04/08 00:05:20 [error] 75768#0: *3 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 192.168.127.1, server: localhost, request: "GET /index.php HTTP/1.1", host: "192.168.127.128"

解决方法:由于nginx配置文件内容有误,nginx配置文件可参考如下配置

nginx;
worker_processes  1;
events {
   worker_connections  1024;
}
http {
   include       mime.types;
   default_type  application/octet-stream;
   sendfile        on;
   keepalive_timeout  65;
   server {
       listen       80;
       server_name  localhost;
       root /usr/local/nginx/html/public/;
       location / {
           index  index.html index.htm index.php;
           try_files $uri $uri/ /index.php?$args;
       }


       error_page   500 502 503 504  /50x.html;
       location = /50x.html {
           root   /usr/local/nginx/html/public/;
       }
       location ~ \.php$ {
           root           html;
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html/public/$fastcgi_script_name;
           include        fastcgi_params;
       }
   }
}


标签:CentOS,local,nginx,html,yum,usr,chemex,php,咖啡壶
From: https://blog.51cto.com/u_64214/6401132

相关文章

  • centos7时间同步(ntp)
    root用户登录1、安装ntpyuminstallntp2、修改ntp.confvim/etc/ntp.confserverntp1.aliyun.compreferserverntp2.aliyun.com3、设置时区timedatectlset-timezoneAsia/Shanghai4、时间同步ntpdatentp1.aliyun.com5、启动NTP服务servicentpdstart6、设......
  • linux | CentOS 发送邮件附件
    如图:  配置内容[email protected][email protected]=授权码#在邮箱后台申请setsmtp-auth=login 发送内容:#格式:echo邮件正文mail-s"邮件标题"-a附件地址收件邮箱echohelloword!m......
  • Centos上配置服务开机自启动的3种方式
    前言  在服务器上安装的各种中间件,为了防止意外宕机重启导致的后果,一般都需要配置成开机自启动。但是有些中间件的安装过程中并没有提供相关配置开机自启动的说明文档。今天和各位大朋友们聊一聊Centos上配置服务开机自启动的几种方式。Centos下配置服务开机自启动有3种方式:......
  • CentOS 安装 svn server
    https://www.howtoforge.com/tutorial/how-to-setup-a-svn-server-on-centos-6/安装安装subversion只需一条命令yuminstall-ysubversion输入的日志信息:Loadedplugins:fastestmirror,langpacksRepodataisover2weeksold.Installyum-cron?Orrun:yummakec......
  • CentOS 安装 svn server ..
    https://subversion.apache.org/packages.html 1.安装Subversionyuminstall-ysubversion2.安装mod_dav_svnyuminstall-ymod_dav_svn3.使用svnadmin命令创建svn仓库手册svnadmincreate/data/svn/repo14.将所属权移交apachechown-Rapache:apache......
  • Linux centos7 ppc64le编译安装MySQL8遇见问题
    一.关于Nopackagedevtoolset-7-gccavailable.的解决办法1.使用centos默认yum源2.依次执行以下命令yuminstall-ycentos-release-sclyuminstall-ydevtoolset-7 二.cmake3>=3.6.1isneededbymysql-community-8.0.18-1.el7.ppc64le安装cmake3yuminstall......
  • CentOS7部署LAMP环境
    【转载】CentOS7部署LAMP环境宇翔2020 网路小栈 2023-04-1823:12 发表于山东收录于合集#CentOS3个#Linux操作系统2个LAMP分别代表Linux、Apache、MySQL和PHP。  本文使用的软件版本如下:Apache:2.4.6MySQL:8.0.32PHP:8.2.4phpMyAdmin:5.2.1 ......
  • 基于CentOS7系统Docker19.03.15离线安装
    一、离线安装(1)去官网下载docker安装二进制包,选择适合自己的版本。这里下载的是docker-19.03.15.tgz,下载地址:https://download.docker.com/linux/static/stable/x86_64/(2)将安装包上传至安装机器(3)解压tar-xfdocker-19.03.15.tgz(4)将解压后的文件移至/usr/bin/......
  • Centos Yum源配置(清华源)
    配置清华源执行清华源官方语句https://mirrors.tuna.tsinghua.edu.cn/help/centos/?repo=centos7替换当前文件并备份请注意,CentOS8(非Stream版)已提前进入EOL停止服务阶段,因此镜像已被官方移动。如果您正在寻找关于这些系统的镜像,请参考centos-vault的帮助。该文件夹只提......
  • centos 添加新用户并授权
    添加用户[root@devops~]#adduserxuwei为这个用户初始化密码,linux会判断密码复杂度,不过可以强行忽略:[root@devops~]#passwdxuwei赋予sudo权限vim/etc/sudoers添加一行查看用户信息的常用命令用户列表文件:/etc/passwd用户组列表文件:/etc/group查看系统中有哪......