CentOS-stream-9 Zabbix的安裝與配置

一、Web環境搭建部署Zabbix時,選擇合適的MariaDB、PHP和Nginx版本非常重要,以確保兼容性和最佳性能。以下是建議版本:Zabbix 6.4
MariaDB:官方文檔推薦使用MariaDB 10.3或更高版本。對于CentOS Stream 9,建議使用MariaDB 10.5或更新版本。
PHP:Zabbix 6.4支持PHP 8.0或更高版本。根據您的需求,可以選擇安裝PHP 8.0、8.1或8.2。請注意,PHP 8.3雖然也可能是可用的,但在撰寫本文時可能尚未被所有官方渠道支持。
Nginx:官方文檔中提到Nginx 1.18或更高版本是兼容的。對于CentOS Stream 9,默認提供的Nginx版本應該滿足要求。1、切換CentOS -stream-9源為阿里源
備份原有的yum源文件,以便需要時恢復:sudo mv /etc/yum.repos.d/CentOS-* /tmp/
centos.repo[baseos]
name=CentOS Stream $releasever - BaseOS
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1[baseos-debug]
name=CentOS Stream $releasever - BaseOS - Debug
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[baseos-source]
name=CentOS Stream $releasever - BaseOS - Source
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/source/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[appstream]
name=CentOS Stream $releasever - AppStream
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1[appstream-debug]
name=CentOS Stream $releasever - AppStream - Debug
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[appstream-source]
name=CentOS Stream $releasever - AppStream - Source
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[crb]
name=CentOS Stream $releasever - CRB
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/CRB/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0[crb-debug]
name=CentOS Stream $releasever - CRB - Debug
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/CRB/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[crb-source]
name=CentOS Stream $releasever - CRB - Source
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/CRB/source/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0

?centos-addons.repo

[highavailability]
name=CentOS Stream $releasever - HighAvailability
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/HighAvailability/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0[highavailability-debug]
name=CentOS Stream $releasever - HighAvailability - Debug
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/HighAvailability/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[highavailability-source]
name=CentOS Stream $releasever - HighAvailability - Source
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/HighAvailability/source/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[nfv]
name=CentOS Stream $releasever - NFV
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/NFV/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0[nfv-debug]
name=CentOS Stream $releasever - NFV - Debug
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/NFV/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[nfv-source]
name=CentOS Stream $releasever - NFV - Source
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/NFV/source/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[rt]
name=CentOS Stream $releasever - RT
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/RT/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0[rt-debug]
name=CentOS Stream $releasever - RT - Debug
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/RT/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[rt-source]
name=CentOS Stream $releasever - RT - Source
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/RT/source/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[resilientstorage]
name=CentOS Stream $releasever - ResilientStorage
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/ResilientStorage/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=0[resilientstorage-debug]
name=CentOS Stream $releasever - ResilientStorage - Debug
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/ResilientStorage/$basearch/debug/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[resilientstorage-source]
name=CentOS Stream $releasever - ResilientStorage - Source
baseurl=http://mirrors.aliyun.com/centos-stream/$stream/ResilientStorage/source/tree/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0[extras-common]
name=CentOS Stream $releasever - Extras packages
baseurl=http://mirrors.aliyun.com/centos-stream/SIGs/$stream/extras/$basearch/extras-common/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1[extras-common-source]
name=CentOS Stream $releasever - Extras packages - Source
baseurl=http://mirrors.aliyun.com/centos-stream/SIGs/$stream/extras/source/extras-common/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
enabled=0
生成緩存并且更新源:yum clean all && yum makecacheyum -y update
2、關閉防火墻,SELINUX
# 關閉防火墻(臨時關閉,系統重啟后會開啟)
systemctl stop firewalld
# 查看防火墻狀態
systemctl status firewalld
# 重啟系統后不開啟防火墻
systemctl disable firewalldSELinux是一種強制訪問控制的安全模塊,它被集成到了Linux操作系統中;在SELinux下,所有進程和用戶都必須明確獲得執行特定操作的權限。# 查看selinux狀態
getenforce
# 臨時關閉selinux
setenforce 0
# 永久關閉selinux,將SELINUX=disabled
vim /etc/selinux/config

3、web環境搭建(安裝LNMP)
LAMP和LNMP是常見的web環境,它們具體代表如下:

L:linux,操作系統
A或N:Apache或Nginx,Web服務器軟件
M:MariaDB或MySQL,數據庫軟件
P:PHP、Perl、Python,腳本軟件
?使用yum源,向系統安裝MariaDB、PHP、hpptd或者nginx,并借助yum解決LAMP各組件間的依賴關系

yum -y install mariadb mariadb-server php php-mysqlnd nginx# 啟動nginx
systemctl start nginx
# 設置開機自啟
systemctl enable nginx# 啟動mariadb
systemctl start mariadb
# 設置開機自啟
systemctl enable mariadb # 查看nginx的版本,默認版本已經夠用了
nginx -v
[root@localhost yum.repos.d]# nginx -v
nginx version: nginx/1.20.1# 查看php的版本
php -v[root@localhost yum.repos.d]# php -v
PHP 8.0.30 (cli) (built: Aug  3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologieswith Zend OPcache v8.0.30, Copyright (c), by Zend Technologies# 查看mariadb版本,10.5.27
mysql -V 或者 mysql --version[root@localhost yum.repos.d]# mysql -V
mysql  Ver 15.1 Distrib 10.5.27-MariaDB, for Linux (x86_64) using  EditLine wrapper
4、測試nginx,輸入地址:http://你的主機地址,看到ngin歡迎頁面,說明測試成功

5、配置數據庫

安全初始化數據庫

[root@localhost yum.repos.d]# mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none): 
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
## 改變使用Unix套接字文件來進行用戶認證的方式 否
Switch to unix_socket authentication [Y/n] n... skipping.
You already have your root account protected, so you can safely answer 'n'.## 修改了root用戶的密碼,看個人需要 是
Change the root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
## 是否移除匿名用戶 是
Remove anonymous users? [Y/n] y... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
## 不允許遠程連接 否
Disallow root login remotely? [Y/n] n... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
## 是否刪除測試用的數據庫權限? 是
Remove test database and access to it? [Y/n] y- Dropping test database...... Success!- Removing privileges on test database...... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
## 是否重新加載權限表  是
Reload privilege tables now? [Y/n] y... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.Thanks for using MariaDB!

數據庫安裝并初始化完成

6、創建Zabbix數據庫及用戶
[root@localhost yum.repos.d]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.5.27-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
## 建zabbix庫,并設定utf8字符集
MariaDB [(none)]> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.001 sec)
## 授權zabbix用戶給zabbix庫權限并修改密碼
MariaDB [(none)]>grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
Query OK, 0 rows affected (0.001 sec)
## 然后刷新權限以使更改生效
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)MariaDB [(none)]> exit
Bye

退出數據庫,測試zabbix用戶

[root@localhost yum.repos.d]# mysql -uzabbix -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.5.27-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
## 查看數據庫
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| zabbix             |
+--------------------+
2 rows in set (0.001 sec)MariaDB [(none)]> exit
Bye

二、Server端安裝配置

1、添加Zabbix官方倉庫
yum -y install https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
yum clean all && yum makecache
2、安裝Zabbix Server、Web前端和Agent
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-agent
3、配置數據庫

?配置Zabbix Server連接到MariaDB: 編輯/etc/zabbix/zabbix_server.conf文件,設置數據庫連接參數,如DBHostDBNameDBUserDBPassword

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

修改配置文件 ,添加DBPassword=123456

vim /etc/zabbix/zabbix_server.conf

# 在文件的最后添加
NodeAddress=localhost:10051
AllowUnsupportedDBVersions=1
DBSocket=/var/lib/mysql/mysql.sock
更改時區vim /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai  # 有的話修改,沒有的可以添加啟動Zabbix Server和Agent,并設置開機自啟systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm

三、 Zabbix訪問測試,http://你的地址/zabbix

訪問過程中出現的問題

解決過程

配置Nginx以托管Zabbix前端:

編輯或創建一個Nginx配置文件(例如/etc/nginx/conf.d/zabbix.conf),并將內容設置為適合Zabbix的配置。請確保配置中包含正確的PHP處理指令以及指向Zabbix文檔根目錄的路徑。一個基本的Nginx配置示例如下:

server {listen       80;server_name  yourdomain.com;root   /usr/share/zabbix;index  index.php;location / {try_files $uri $uri/ /index.php?$query_string;}location ~ \.php$ {fastcgi_pass unix:/run/php-fpm/www.sock;fastcgi_index index.php;include fastcgi_params;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}
}
開始測試:

為了確保Zabbix在CentOS Stream 9上的正常運行,需要調整PHP的一些配置參數以滿足Zabbix的要求。具體來說,post_max_sizemax_execution_timemax_input_time這三個配置項需要設置為至少指定的最小值。

第二步錯誤解決辦法
修改PHP配置
你可以通過編輯PHP的主配置文件來更改這些設置。對于大多數系統,默認的PHP配置文件位于/etc/php.ini。不過,如果你使用的是PHP-FPM,你可能還需要檢查并編輯/etc/php-fpm.d/www.conf中的相關設置。以下是具體的步驟:編輯PHP配置文件打開PHP配置文件進行編輯:sudo vim /etc/php.ini
找到或添加以下配置項,并根據需要修改它們的值:post_max_size:設置為至少16M。post_max_size = 16M
max_execution_time:設置為至少300秒。max_execution_time = 300
max_input_time:設置為至少300秒max_input_time = 300
此外,為了確保上傳文件大小也足夠大,建議同時設置upload_max_filesize為至少16M(這與post_max_size相關聯):upload_max_filesize = 16M
記得重啟PHP-FPM服務以使更改生效:sudo systemctl restart php-fpm

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/83649.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/83649.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/83649.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

CppCon 2014 學習:Adventures in Updating a Legacy Vintage Codebase

“VINTAGE” 部分是對現實中飛行模擬系統中遺留系統復雜性的描述。以下是對關鍵點的理解與拆解: 飛行模擬系統的背景 多環境、多語言、多硬件: 編程語言: 混用的“遺留語言”:Ada, C, C, Fortran, Jovial, PL/M, Pascal不同語言…

【計算機】計算機存儲器的分類與特性

文章目錄 一、按作用層次分類1. 主存儲器(內存)2. 輔助存儲器(外存)3. 高速緩沖存儲器(Cache) 二、按存儲介質分類1. 半導體存儲器2. 磁存儲技術3. 光存儲發展 三、按存取方式分類1. 隨機存儲器技術細節2. …

Redisson - 實現延遲隊列

Redisson 延遲隊列 Redisson 是基于 Redis 的一款功能強大的 Java 客戶端。它提供了諸如分布式鎖、限流器、阻塞隊列、延遲隊列等高可用、高并發組件。 其中,RDelayedQueue 是對 Redis 數據結構的高階封裝,能讓你將消息延遲一定時間后再進入消費隊列。…

上門服務小程序訂單系統框架設計

一、邏輯分析 上門服務小程序訂單系統主要涉及服務展示、用戶下單、訂單處理、服務人員接單與服務完成反饋等核心流程。 服務展示:不同類型的上門服務(如家政、維修等)需要在小程序中展示詳細信息,包括服務名稱、價格、服務內容介…

Android apk裝機編譯類型: verify、speed-profile, speed與啟動耗時

Android apk裝機編譯類型: verify、speed-profile, speed與啟動耗時 Dex2oat (dalvik excutable file to optimized art file) ,對 dex 文件進行編譯優化,Android 虛擬機可識別的是dex文件,應用運行過程如果每次都將dex文件加載內存&#xff…

winrm登錄失敗,指定的憑據被服務器拒絕

winrm登錄失敗,指定的憑據被服務器拒絕。 異常提示:the specified credentials were rejected by the server 在windows power shell執行 set-executionpolicy remotesigned winrm quickconfig winrm set winrm/config/service/auth {Basic"true…

Unity3D ET框架游戲腳本系統解析

前言 ET框架在Unity3D中實現的GamePlay腳本系統是一種革命性的、基于ECS(實體-組件-系統)架構的設計,它徹底改變了傳統的基于MonoBehaviour的游戲邏輯編寫方式。其核心思想是追求高性能、高解耦、易熱更新,特別適合大型復雜的網絡…

android與Qt類比

一、概念對應關系 Android RecyclerView 組件類比描述Qt 模型 - 視圖組件Qt 類比描述RecyclerView畫板(容器)QAbstractItemView視圖(展示數據的容器,如列表、表格)RecyclerView.Adapter畫布(數據橋梁&…

Jenkins 2.479.1安裝和郵箱配置教程

1.安裝 在JDK安裝并設置環境變量完成后,下載官網對應的war版本,在對應目錄下打開命令行窗口并輸入 java -jar jenkins.war其余參數感興趣可以自行查閱,這里啟動的 jenkins 服務默認占用8080端口,在瀏覽器輸入 localhost:8080進入…

多分辨率 LCD 的 GUI 架構設計與實現

1.1多分辨率顯示系統的挑戰與解決方案 1.1.1 分辨率適配的核心問題 在嵌入式系統中,同時支持不同分辨率的 LCD(如 240160、320480 等)面臨以下挑戰: 布局適配:同一界面元素在不同分辨率下需要調整大小和位置 字體顯示:小分辨率屏幕需要更小的字體,而大分辨率需要更清…

11. MySQL事務管理(上)

1. CURD不加控制&#xff0c;會有什么問題&#xff1f; 火車票售票系統tickets表 id name nums 10 西安<->蘭州 1 客戶端A 客戶端B if (nums > 0) { if (nums > 0) { 賣票 賣票 // update numsnums - 1 update numsnums - 1 } } 當客戶端A檢查還有一張票時&#xf…

Beta分布Dirichlet分布

目錄 Beta分布Dirichlet分布Beta分布&Dirichlet分布從Dirichlet分布生成Beta樣本Beta分布&Dirichlet分布應用 Beta分布 Beta分布是定義在區間 [ 0 , 1 ] [0, 1] [0,1]上的連續概率分布&#xff0c;通常用于模擬概率或比例的隨機變量。Beta分布的概率密度函數&#xff…

嵌入式系統中常用的開源協議

目錄 1、GNU通用公共許可證&#xff08;GPL&#xff09; 2、GNU寬松通用公共許可證&#xff08;LGPL&#xff09; 3、MIT許可證 4、Apache許可證2.0 5、BSD許可證 6、如何選擇合適的協議 在嵌入式系統開發中&#xff0c;開源軟件的使用已成為主流趨勢。從物聯網設備到汽車…

告別延遲,擁抱速度:存儲加速仿真應用的解決方案【1】

需求分析 現代仿真&#xff08;如CFD流體動力學、FEA結構分析、電磁仿真、氣候模擬、自動駕駛場景仿真、芯片設計等&#xff09;會產生PB級甚至EB級的數據。海量數據的生成、處理和存儲&#xff0c;主要體現在以下幾個關鍵方面&#xff1a; 數據量爆炸式增長&#xff1a;高分…

vue封裝gsap自定義動畫指令

1、指令文件封裝 import { gsap } from gsap;// 動畫類型配置 const ANIMATION_TYPES {// 縮放scale: {from: { scale: 0.5, opacity: 0 },to: { scale: 1, opacity: 1 },hide: { scale: 0.5, opacity: 0 },},// 透明度fade: {from: { opacity: 0 },to: { opacity: 1, ease: …

HTTP 如何升級成 HTTPS

有一個自己的項目需要上線&#xff0c;域名解析完成后&#xff0c;發現只能使用 http 協議&#xff0c;這在瀏覽器上會限制&#xff0c;提示用戶不安全&#xff0c;所以需要把 HTTP 升級成 HTTPS 協議&#xff0c;但又不想花錢。 前提條件&#xff1a; 已經配置好 Nginx 服務器…

測試面試題總結一

目錄 列表、元組、字典的區別 nvicat連接出現問題如何排查 mysql性能調優 python連接mysql數據庫方法 參數化 pytest.mark.parametrize 裝飾器 list1 [1,7,4,5,5,6] for i in range(len(list1): assert list1[i] < list1[i1] 這段程序有問題嘛&#xff1f; pytest.i…

[藍橋杯]密文搜索

密文搜索 題目描述 福爾摩斯從 X 星收到一份資料&#xff0c;全部是小寫字母組成。 他的助手提供了另一份資料&#xff1a;許多長度為 8 的密碼列表。 福爾摩斯發現&#xff0c;這些密碼是被打亂后隱藏在先前那份資料中的。 請你編寫一個程序&#xff0c;從第一份資料中搜…

打卡第36天:模型可視化以及推理

知識點回顧&#xff1a; 1.三種不同的模型可視化方法&#xff1a;推薦torchinfo打印summary權重分布可視化 2.進度條功能&#xff1a;手動和自動寫法&#xff0c;讓打印結果更加美觀 3.推理的寫法&#xff1a;評估模式 作業&#xff1a;調整模型定義時的超參數&#xff0c;對…

8天Python從入門到精通【itheima】-68(元組)

目錄 65節——元組的定義和操作 1.學習目標 2.為什么要學習元組 3.元組的定義 4.定義元組的注意事項 5.元組的嵌套 6.元組的相關操作 【1】index方法 【2】count方法 【3】len方法 7.元組的遍歷 【1】while循環進行元組的遍歷 【2】for循環進行元組的變量 Python …