Chemex

DevOps Tool评论2,167字数 10558阅读35分11秒阅读模式

简介

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

关闭防火墙

firewalld

[root@devopd-Chemex ~]# systemctl stop firewalld
[root@devopd-Chemex ~]# systemctl disable firewalld

selinux

[root@devopd-Chemex ~]# setenforce 0
[root@devopd-Chemex ~]#  sed -i "s/enforcing/disabled/g" `grep enforcing -rl /etc/selinux/config`

PHP

安装yum-utils工具

[root@devopd-Chemex ~]# 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源

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-php81

安装PHP8及扩展

yum install php81 -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@devopd-Chemex ~]# php -v
PHP 8.1.13 (cli) (built: Nov 22 2022 14:42:07) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies

修改php.ini文件

[root@devopd-Chemex ~]# vim /etc/php.ini
zlib.output_compression = On

启动服务

[root@devopd-Chemex ~]# systemctl start php-fpm
[root@devopd-Chemex ~]# systemctl enable php-fpm
Created symlink from /etc/systemd/system/multi-user.target.wants/php-fpm.service to /usr/lib/systemd/system/php-fpm.service.

安装mysql

添加yum源

[root@devops-efk-master ~]# 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
[root@devops-efk-master ~]# yum clean all && yum makecache
[root@devops-efk-master ~]# yum install mysql-community-server    -y

初始化数据库

[root@devops-efk-master ~]# systemctl enable --now mysqld
[root@devops-efk-master ~]# grep "password" /var/log/mysqld.log 
2022-12-07T07:03:44.959077Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: k,Etjq;Oa3hm
[root@devops-efk-master ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.31

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

配置连接信息

mysql> alter user 'root'@'localhost' IDENTIFIED BY 'k,Etjq;Oa3hm';
Query OK, 0 rows affected (0.00 sec)

mysql> create database chemex;
Query OK, 1 row affected (0.00 sec)


mysql> CREATE USER 'chemex'@'%' IDENTIFIED BY 'Hivepass70@' ;
Query OK, 0 rows affected (0.01 sec)

mysql> grant all privileges on chemex.* to 'chemex'@'%';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

安装nginx

[root@devops-efk-master ~]# yum install nginx -y
[root@devops-efk-master ~]# systemctl start nginx
[root@devops-efk-master ~]# systemctl enable nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.

添加nginx配置

[root@devops-efk-master conf.d]# pwd
/etc/nginx/conf.d
[root@devops-efk-master conf.d]# ll
total 4
-rw-r--r-- 1 root root 595 Dec  7 15:30 localhost.conf

chemex配置

[root@devops-efk-master conf.d]# cat localhost.conf 
server {
        listen       80;
        root   /usr/www/chemex/public/; #源码目录
location / {
        index index.php  index.html index.htm;
        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 /usr/www/chemex/public$fastcgi_script_name;
        include        fastcgi_params;
        }
     
}

composer

安装composer

[root@devops-efk-master ~]# php -r "readfile('https://getcomposer.org/installer');" | php
All settings correct for using Composer
Downloading...

Composer (version 2.4.4) successfully installed to: /root/composer.phar
Use it: php composer.phar

[root@devops-efk-master ~]# mv composer.phar /usr/local/bin/composer
[root@devops-efk-master ~]# composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 
bash: composer: command not found
[root@devops-efk-master ~]# /usr/local/bin/composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
[root@devops-efk-master ~]# /usr/local/bin/composer config -g -l repo.packagist
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://mirrors.aliyun.com/composer/
[process-timeout] 300
[use-include-path] false
[use-parent-dir] prompt
[preferred-install] dist
[notify-on-install] true
[github-protocols] [https, ssh]
[gitlab-protocol] 
[vendor-dir] vendor (/root/vendor)
[bin-dir] {$vendor-dir}/bin (/root/vendor/bin)
[cache-dir] /root/.cache/composer
[data-dir] /root/.local/share/composer
[cache-files-dir] {$cache-dir}/files (/root/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/root/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/root/.cache/composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[cache-read-only] false
[bin-compat] auto
[discard-changes] false
[autoloader-suffix] 
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile] 
[capath] 
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[lock] true
[platform-check] php-only
[home] /root/.config/composer

安装部署

下载源码

[root@devops-efk-master ~]# mkdir /usr/www/ -p
[root@devops-efk-master ~]# cd /usr/www/
[root@devops-efk-master www]# git clone https://gitee.com/celaraze/chemex.git
Cloning into 'chemex'...
remote: Enumerating objects: 26915, done.
remote: Counting objects: 100% (3100/3100), done.
remote: Compressing objects: 100% (2494/2494), done.
remote: Total 26915 (delta 726), reused 2577 (delta 495), pack-reused 23815
Receiving objects: 100% (26915/26915), 59.53 MiB | 14.37 MiB/s, done.
Resolving deltas: 100% (11778/11778), done.
[root@devops-efk-master www]# chmod  -R 775 chemex/
[root@devops-efk-master www]# cd chemex/
[root@devops-efk-master chemex]# chmod -R 777 storage/
[root@devops-efk-master ~]# chmod 777 /usr/www/chemex -R

复制文件,编辑.env文件,填入数据库名和账号密码

[root@devops-efk-master chemex]# cp .env.example .env
[root@devops-efk-master chemex]# vim .env
### 第一步:数据库配置
DB_CONNECTION=mysql #数据库类型,不需要修改(兼容mariadb)
DB_HOST=127.0.0.1 # 数据库地址
DB_PORT=3306 # 数据库端口号
DB_DATABASE=chemex # 数据库名称
DB_USERNAME=chemex # 数据库用户名
DB_PASSWORD=Hivepass70@ # 数据库密码

### 第二步:配置HTTPS
### 如果您使用HTTPS协议,请将下面两个参数修改为true
ADMIN_HTTPS=true

执行安装chemex

[root@devops-efk-master chemex]# php artisan chemex:install
正在优化配置!
   INFO  Clearing cached bootstrap files.  

  events .................................................................................................................................. 1ms DONE
  views ................................................................................................................................... 1ms DONE
  cache ................................................................................................................................... 1ms DONE
  route ................................................................................................................................... 0ms DONE
  config .................................................................................................................................. 0ms DONE
  compiled ................................................................................................................................ 1ms DONE

正在设置存储系统!
   INFO  The [public/storage] link has been connected to [storage/app/public].  

正在配置APP密钥!
   INFO  Application key set successfully.  

jwt-auth secret [7CegCplfo9qFyR3MefYEiPykVOmRlDVOwmekbwByJ5VOT4y1yWQfKQEXs8HVcS55] set successfully.
正在处理数据库迁移!
   INFO  Preparing database.  

  Creating migration table ............................................................................................................... 26ms DONE

   INFO  Running migrations.  

  2016_01_04_173148_create_admin_tables ................................................................................................. 331ms DONE
  2020_09_07_090635_create_admin_settings_table .......................................................................................... 52ms DONE
  2020_09_22_015815_create_admin_extensions_table ........................................................................................ 65ms DONE
  2020_11_01_083237_update_admin_menu_table .............................................................................................. 14ms DONE
  2021_03_24_213912_version_3_0_0 ....................................................................................................... 740ms DONE
  2021_04_02_085513_version_3_0_1 ........................................................................................................ 70ms DONE
  2021_04_03_085513_version_3_0_2 ........................................................................................................ 43ms DONE
  2021_05_19_085513_version_3_0_10 ....................................................................................................... 39ms DONE
  2021_09_09_214313_version_3_2 .......................................................................................................... 70ms DONE
  2021_09_27_194135_version_3_2_1 ......................................................................................................... 1ms DONE
  2021_10_15_091340_version_3_3_0 ........................................................................................................ 48ms DONE
  2021_11_22_160713_version_3_4_0 ........................................................................................................ 17ms DONE
  2022_03_18_104844_version_3_5_1 ........................................................................................................ 16ms DONE
  2022_05_25_215950_version_3_5_2 ........................................................................................................ 39ms DONE
  2022_07_18_093147_version_3_7_0 ........................................................................................................ 14ms DONE

正在初始化基础数据!
   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

   INFO  Seeding database.  

Admin账户已成功重置为 admin/admin
安装完成!
用户名密码都为:admin

访问

Chemex

参考地址 https://blog.csdn.net/qq_32547551/article/details/120196347

参考地址https://www.jianshu.com/p/060f46a196dc

继续阅读
DevOps
  • 本文由 发表于 2022年12月7日 14:22:10
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
部署NFS服务 NFS

部署NFS服务

部署 NFS 服务 服务端: 192.168.100.11 安装依赖 yum -y install epel-release 安装 NFS yum -y install nfs-...
git clone代码报文件名过长 Tool

git clone代码报文件名过长

简述 由于工程路径过长导致克隆代码时会出现文件名过长的问题不能clone代码中断 打开git Bash窗口执行 git config --global core.longpaths tr...
服务器禁ping Tool

服务器禁ping

ping是通的 [root@nginx-2 ~]# ping 192.168.1.227 PING 192.168.1.227 (192.168.1.227) 56(84) bytes of da...
linux压缩包加密 Tool

linux压缩包加密

OpenSSL加密算法 OpenSSL是一个开源的用以实现SSL协议的产品,它主要包括了三个部分:密码算法库、应用程序、SSL协议库[vip] Openssl支持的加密算法有: ...
评论  0  访客  0

发表评论