雷达智富

首页 > 内容 > 程序笔记 > 正文

程序笔记

如何在 Rocky Linux/AlmaLinux 8 上安装 WHMCS

2024-07-19 Linux 39

Web Host Manager完整解决方案(WHMCS)是专为Web托管业务设计的解决方案。它有助于客户管理、支持管理、计费和发票,并作为托管业务的完整订单管理系统。借助大量可扩展功能的插件,可以轻松集成其他软件解决方案并将其打包以供客户订购。

如果您正在考虑创办一家网络托管公司,WHMCS 是您实现公司运营自动化和简化的最佳选择。它确保有效管理客户、计费和一般支持流程。如前所述,与各种托管相关工具集成的便利性使其成为托管服务集中管理的首选解决方案。

在我们过去的文章中,我们研究了在 Ubuntu 服务器上安装和配置 WHMCS。您可以在下面的文章链接中引用它。

  • 如何在 Ubuntu 上安装 WHMCS

本文将重点介绍 WHMCS 在 Rocky/AlmaLinux 8 Linux 系统上的安装、配置和使用。按照本指南中概述的步骤进行操作时,任何基于 RHEL 8 的 Linux 系统的全新安装都应该有效。那么让我们开始吧。

设置主机名、时区、ntp 同步

我们始终主张在完成任何其他软件包安装之前进行系统升级。通过在服务器终端上运行以下命令来执行此操作。

sudo dnf -y update

设置服务器的主机名。将 portal.example.com 替换为您的实际域名。

sudo hostnamectl set-hostname portal.example.com

我的时区是非洲/内罗毕。 这是使用timedatectl命令设置的。

sudo timedatectl set-timezone Africa/Nairobi

我们还在系统上安装 chrony ntp 软件包。

sudo dnf -y install chrony

确保该服务在系统启动时启动。

sudo systemctl enable --now chronyd

检查状态应返回正在运行状态。

$ systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2023-12-10 02:40:04 EAT; 3 days ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
 Main PID: 749 (chronyd)
    Tasks: 1 (limit: 203493)
   Memory: 2.1M
   CGroup: /system.slice/chronyd.service
           └─749 /usr/sbin/chronyd

Dec 10 02:40:04 hosting.example.com systemd[1]: Starting NTP client/server...
Dec 10 02:40:04 hosting.example.com chronyd[749]: chronyd version 4.2 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 +DEBUG)
Dec 10 02:40:04 hosting.example.com chronyd[749]: Frequency 0.000 +/- 1000000.000 ppm read from /var/lib/chrony/drift
Dec 10 02:40:04 hosting.example.com chronyd[749]: Using right/UTC timezone to obtain leap second data
Dec 10 02:40:04 hosting.example.com systemd[1]: Started NTP client/server.
Dec 10 02:40:11 hosting.example.com chronyd[749]: Selected source 160.119.216.202 (2.rocky.pool.ntp.org)
Dec 10 02:40:11 hosting.example.com chronyd[749]: System clock TAI offset set to 37 seconds

通过执行以下命令同步服务器上的时间和日期。

$ sudo chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^+ 160.119.216.197               3   6    37     5   +162us[  +67us] +/- 7212us
^- time.cloudflare.com           3   6    37     5    +52ms[  +52ms] +/-  163ms
^- time.cloudflare.com           3   6    37     4    +42ms[  +41ms] +/-  152ms
^* 160.119.216.206               3   6    37     4    -72us[ -168us] +/- 7425us

安装 Apache Web 服务器和 PHP

我们将从基于 RHEL 的系统的 REMI 第三方 RPM 存储库在系统上安装 PHP 8.1。安装存储库发布文件,该文件在导入 GPG 密钥时在系统上配置存储库。

sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

让我们禁用其他 PHP AppStream 存储库并为 REMI PHP 8.1 启用一个存储库

sudo dnf module reset php -y
sudo dnf module install php:remi-8.1 -y

接下来我们安装 PHP 和运行 WHMCS 平台所需的所有其他扩展。

sudo dnf -y install php  php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-opcache

确保安装了带有 mod_ssl 模块的 httpd 服务器。

sudo dnf -y install @httpd

启用 PHP FPM 和 httpd 服务。

sudo systemctl enable --now httpd php-fpm

安装MariaDB数据库服务器

使用最新版本的 MariaDB 数据库服务器就可以了。使用自动脚本配置器将存储库添加到基于 RHEL 的服务器中。

curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s --

接下来安装 MariaDB 服务器和客户端包。

sudo dnf -qy module disable mariadb
sudo dnf module reset mariadb -y
sudo dnf install MariaDB-server MariaDB-client MariaDB-backup

启动并启用 mariadb 服务。

sudo systemctl enable --now mariadb

使用强密码为 WHCMS 创建用户和数据库。

$ sudo mysql -u root
CREATE DATABASE whmcs;
GRANT ALL ON whmcs.* TO whmcs@localhost IDENTIFIED BY "DBUserPassw0rd";
FLUSH PRIVILEGES;
QUIT;

安装 PHP IonCube 加载器

解码加密的 PHP 文件需要 IonCube 加载程序。这是在 WHMCS 安装期间必需的。 IonCube Loader 在操作系统软件包上不可用,我们需要针对系统上特定版本的 PHP 手动安装它。

首先检查系统中PHP的版本。

$ php --version
PHP 8.1.26 (cli) (built: Nov 21 2023 21:53:48) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.26, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.26, Copyright (c), by Zend Technologies

安装用于下载 IonCube 加载程序存档文件的 wget 包。

sudo dnf -y install wget

现在将 IonCube 加载程序下载到本地系统中。

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

使用 tar 提取包

tar xvf ioncube_loaders_lin_x86-64.tar.gz

找到已安装的PHP版本的扩展目录

$ php -i | grep extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
sqlite3.extension_dir => no value => no value

在 PHP 配置文件中复制并配置 IonCube Loader。

sudo cp ioncube/ioncube_loader_lin_8.1.so /usr/lib64/php/modules
echo "zend_extension=/usr/lib64/php/modules/ioncube_loader_lin_8.1.so"|sudo tee -a /etc/php.ini

将 PHP 设置调整为以下推荐的参数值。

$ sudo vim /etc/php.ini
max_execution_time = 600
default_socket_timeout = 600
max_input_time = 600
memory_limit = 256M

进行更改后重新启动 Apache Web 服务器。

sudo systemctl restart httpd php-fpm

安装和配置 WHMCS

下载并解压 WHMCS 存档。如果您已经有,请上传到服务器并使用 unzip 解压缩。

sudo dnf -y install unzip
unzip WHMCS-Archive.zip

将文件夹移至 /var/www/ 目录。

sudo mv path/to/whmcs/folder /var/www/whmcs

configuration.php.new 重命名为 configuration.php

sudo mv /var/www/whmcs/configuration.sample.php /var/www/whmcs/configuration.php
#OR
sudo mv /var/www/whmcs/configuration.php.new /var/www/whmcs/configuration.php

最终代码和所有文件应位于 /var/www/html/whmcs 中。相应地更新目录权限。

### Apache Web Server ###
sudo chown -R apache:apache /var/www/whmcs/

### With Nginx Web Server ###
sudo chown -R nginx:nginx /var/www/whmcs/

如果您在 Enforcing 中有 SELinux,请打开以下布尔值。

sudo setsebool -P httpd_can_network_connect on
sudo setsebool -P httpd_can_network_connect_db on
sudo setsebool -P httpd_can_sendmail on

还要向目录添加 SELinux 标签。

sudo yum -y install policycoreutils-python-utils
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/whmcs(/.*)?"
sudo restorecon -Rv /var/www/whmcs

为WHMCS创建VirtualHost文件

使用 Apache 网络服务器

sudo vim /etc/httpd/conf.d/whmcs.conf

您可以自定义以下代码片段。至少更改 ServerNameServerAdmin 值。

<VirtualHost *:80>
        ServerName portal.example.com
        ServerAdmin [email 
        DocumentRoot /var/www/whmcs
        <Directory  /var/www/whmcs/>
	  Options Indexes FollowSymLinks MultiViews
	  AllowOverride All
 	  Order allow,deny
	  allow from all
          Require all granted
        </Directory>
        ErrorLog  /var/log/httpd/whmcs_error.log
        CustomLog /var/log/httpd/whmcs_access.log combined
</VirtualHost>

检查 Apache 服务器配置语法是否正确。

$ sudo apachectl configtest
Syntax OK

禁用 Apache 的默认虚拟主机文件。

sudo rm /etc/httpd/conf.d/welcome.conf

完成后重新启动 httpd 服务。

sudo systemctl restart httpd

使用 Nginx 网络服务器

创建 Nginx 配置文件

sudo vim /etc/nginx/conf.d/whmcs.conf

将以下内容复制、修改并粘贴到文件中。

server {
	listen 80;
	server_name whmcs.example.com www.whmcs.example.com;
	root /var/www/whmcs;
        access_log /var/log/nginx/whmcs_access_log;
        error_log /var/log/nginx/whmcs_error_log;

	add_header X-Frame-Options "SAMEORIGIN";
	add_header X-XSS-Protection "1; mode=block";
	add_header X-Content-Type-Options "nosniff";
	add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

	index index.php index.html index.htm;

	charset utf-8;

	location ~ /clients/admin/(client!\.php|client/(.*)|table/(.*)|search!\.php|search/(.*)|apps|billing|setup|user|services|addons|domains|utilitiesemailmarketer!\.php|utilities/(.*)|logs|help!\.php|help/license|modules|image/(recent|upload)|validation_com/(.*))/?(.*)$ {
		rewrite ^/(.*)$ /clients/admin/index.php?rp=/admin/$1/$2;
	}

	location ~ /clients/(images/em|invoice|login|password|account|store|download|knowledgebase|announcements|clientarea/ssl-certificates|user/(verification|accounts|profile|password|security|verify)|cart/(domain/renew)|domain/pricing|cart/order|images/kb)/?(.*)$ {
                rewrite ^/(.*)$ /clients/index.php?rp=/$1/$2;
	}

	location / {
		try_files $uri $uri/ /index.php?$query_string;
	}

	location = /favicon.ico { access_log off; log_not_found off; }
	location = /robots.txt  { access_log off; log_not_found off; }

	error_page 404 /index.php;


	proxy_send_timeout 300s;
	proxy_read_timeout 300s;


	location ~ \.php$ {
		fastcgi_pass unix:/run/php-fpm/www.sock;
		fastcgi_send_timeout 300;
	        fastcgi_read_timeout 300;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
		include fastcgi_params;
	}

	location ~ /\.(?!well-known).* {
		deny all;
	}


	location ^~ /clients/vendor/ {
	        deny all;
		return 403;
	}

	location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|svg|woff|woff2|ttf)\$ {
		expires 1M;
		access_log off;
	        add_header Cache-Control "public";
	}

	location ~* \.(?:css|js)\$ {
	        expires 7d;
	        access_log off;
	        add_header Cache-Control "public";
	}

	location ~ /\.ht {
		deny  all;
	}
}

带有https 重定向和 ssl 证书的示例模板。

server {
	listen 80 default_server;
	server_name whmcs.example.com www.whmcs.example.com;
	return 301 https://whmcs.example.com$request_uri;
}

# HTTPS server
#
server {
	listen 443;
	server_name whmcs.example.com;
	root /var/www/whmcs;
        access_log /var/log/nginx/whmcs_access_log;
        error_log /var/log/nginx/whmcs_error_log;

	add_header X-Frame-Options "SAMEORIGIN";
	add_header X-XSS-Protection "1; mode=block";
	add_header X-Content-Type-Options "nosniff";
	add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

	index index.php index.html index.htm;

	charset utf-8;

	ssl on;
	ssl_certificate /etc/letsencrypt/live/whmcs.example.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/whmcs.example.com/privkey.pem;

	ssl_session_timeout 5m;

	ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
	ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
	ssl_prefer_server_ciphers on;


	location ~ /clients/admin/(client!\.php|client/(.*)|table/(.*)|search!\.php|search/(.*)|apps|billing|setup|user|services|addons|domains|utilitiesemailmarketer!\.php|utilities/(.*)|logs|help!\.php|help/license|modules|image/(recent|upload)|validation_com/(.*))/?(.*)$ {
		rewrite ^/(.*)$ /clients/admin/index.php?rp=/admin/$1/$2;
	}

	location ~ /clients/(images/em|invoice|login|password|account|store|download|knowledgebase|announcements|clientarea/ssl-certificates|user/(verification|accounts|profile|password|security|verify)|cart/(domain/renew)|domain/pricing|cart/order|images/kb)/?(.*)$ {
                rewrite ^/(.*)$ /clients/index.php?rp=/$1/$2;
	}

	location / {
		try_files $uri $uri/ /index.php?$query_string;
	}

	location = /favicon.ico { access_log off; log_not_found off; }
	location = /robots.txt  { access_log off; log_not_found off; }

	error_page 404 /index.php;


	proxy_send_timeout 300s;
	proxy_read_timeout 300s;


	location ~ \.php$ {
		fastcgi_pass unix:/run/php-fpm/www.sock;
		fastcgi_send_timeout 300;
	        fastcgi_read_timeout 300;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
		include fastcgi_params;
	}

	location ~ /\.(?!well-known).* {
		deny all;
	}


	location ^~ /clients/vendor/ {
	        deny all;
		return 403;
	}

	location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|svg|woff|woff2|ttf)\$ {
		expires 1M;
		access_log off;
	        add_header Cache-Control "public";
	}

	location ~* \.(?:css|js)\$ {
	        expires 7d;
	        access_log off;
	        add_header Cache-Control "public";
	}

	location ~ /\.ht {
		deny  all;
	}
}

有两种方法可用于配置 WHCMS。

选项 1:从 CLI 配置 WHMCS

切换到 root 用户并导航到 var/www/whmcs/install 目录。

sudo su -
cd /var/www/whmcs/install

安装脚本使用以下语法:

php -f bin/installer.php –- [options]

以下选项可用于 WHMCS 的 CLI 配置。

执行脚本时,我们需要提供 JSON 格式的配置数据。要获取加密的哈希值,请使用以下命令。

openssl rand -base64 128|tr -d "\n\/+="|cut -c 1-64

将配置复制到文本编辑器中并调整它们以适合您的环境。

#!/bin/env bash
# The following assumes the respective environment variables are populated

CONF='{
 "admin":{
  "username":"admin",
  "password":"StrongAdminPassword"
 },
 "configuration":{
  "license": "License-Key",
  "db_host": "127.0.0.1",
  "db_username": "whmcs",
  "db_password": "DBUserPassw0rd",
  "db_name": "whmcs",
  "cc_encryption_hash": "4T9Td8eJMfYL6Wl0GYdttolEmVmh99ZTuOtDrgHZkSWWs01KSsSGLnqPTNJrI3IA",
  "mysql_charset": "utf8"
 }
}'

自定义完成后,将内容粘贴到终端中。

删除现有的 configuration.php 文件。

sudo rm  /var/www/whmcs/configuration.php

现在调用安装程序使用上面的配置内容配置 WHMCS。

echo $(echo $CONF | tr -d "\n") | php -f bin/installer.php – -i -n -c

WHMCS 示例的 CLI 安装。

************************************************************************
************************************************************************
***            __          ___    _ __  __  _____  _____             ***
***            \ \        / / |  | |  \/  |/ ____|/ ____|            ***
***             \ \  /\  / /| |__| | \  / | |    | (___              ***
***              \ \/  \/ / |  __  | |\/| | |     \___ \             ***
***               \  /\  /  | |  | | |  | | |____ ____) |            ***
***                \/  \/   |_|  |_|_|  |_|\_____|_____/             ***
***                                                                  ***
************************************************************************
************************************************************************

************************************************************************
*** Install WHMCS ***
*** NON-INTERACTIVE MODE ***
************************************************************************

** EULA NOT ACCEPTED via NON-INTERACTIVE MODE **

** Creating Configuration File **
/var/www/whmcs/configuration.php

** Preflight Checks **
1. Attempting to load configuration file ................... Ok
2. Attempting to connect to database ....................... Ok
3. Validating database for install ......................... Ok

All checks passed successfully. Ready to Install.

** Beginning Installation **
This may take a few minutes. Please Wait...

====================================================================================================> 100%
Install Completed Successfully!

A primary admin user account has been created with the following credentials:

Username: admin
Password: StrongAdminPassword


Program Completed
************************************************************************
************************************************************************

更新目录权限。

### Apache ###
sudo chown -R apache:apache /var/www/whmcs/

### Nginx ###
sudo chown -R nginx:nginx /var/www/whmcs/

接下来在终端上为 WHMCS 配置 cron。

$ sudo crontab -e -u apache
*/5 * * * * /usr/bin/php -q /var/www/whmcs/crons/cron.php

对于 Nginx 用户使用:

$ sudo crontab -e -u nginx
*/5 * * * * /usr/bin/php -q /var/www/whmcs/crons/cron.php

更新权限配置脚本文件。

sudo chmod 0400 /var/www/whmcs/configuration.php

通过 http://fqdn/ 访问 WHMCS 前端,直接管理仪表板位于 http://fqdn/admin >。

删除安装目录。

sudo rm -r /var/www/whmcs/install

选项 2:从 Web 界面配置 WHMCS

对于喜欢 Web 而非 CLI 安装 WHMCS 的用户,请在浏览器中访问http://portal.example.com/install/install.php

您将看到以下 WHMCS 欢迎页面。

接受最终用户许可协议以继续安装。

开始在您的系统中安装 WHCMS。

在下一步中,我们根据 MariaDB 数据库安装中使用的信息配置数据库连接。

配置数据b

  • 数据库名称:whmcs
  • 数据库用户:whmcs
  • 数据库密码: DBUserPassw0rd

通过创建用于 WHMCS 管理的第一个管理员用户来完成安装

如果一切按预期进行,您应该会看到成功消息。

单击“立即转到管理区域”链接访问 WHMCS 管理门户。

使用您刚刚创建的管理员用户名和密码登录。

接下来在终端上为 WHMCS 配置 cron。

Apache httpd 服务器

$ sudo crontab -e -u apache
*/5 * * * * /usr/bin/php -q /var/www/whmcs/crons/cron.php

Nginx 网络服务器。

$ sudo crontab -e -u nginx
*/5 * * * * /usr/bin/php -q /var/www/whmcs/crons/cron.php

删除安装脚本

sudo rm -r /var/www/whmcs/install

更新权限配置脚本文件。

sudo chmod 0400 /var/www/whmcs/configuration.php

您可以通过http://fqdn/访问WHMCS前端,直接管理仪表板位于http://fqdn/admin

使用 Let's Encrypt SSL 证书保护 WHCMS

确保安装脚本已删除。

sudo rm -r /var/www/whmcs/install

从 EPEL 存储库安装 certbot 工具。

sudo dnf -y install epel-release
sudo dnf -y install certbot
sudo dnf -y install  python3-certbot-apache

[email  更改为您用于证书过期通知的有效电子邮件地址。如果您的 FQDN 与系统上设置的主机名匹配,请使用此处提供的 DOMAIN 值,否则使用 DNS 服务器中配置的 A 记录设置 VirtualHost 域值。

ALERT_EMAIL=[email 
DOMAIN=$(hostname -f)
sudo certbot --apache --redirect -d $DOMAIN --preferred-challenges http --agree-tos -n -m $ALERT_EMAIL --keep-until-expiring

对于 nginx

sudo certbot --nginx --redirect -d $DOMAIN --preferred-challenges http --agree-tos -n -m $ALERT_EMAIL --keep-until-expiring

使用 --apache 标志 certbot 将修改 VirtualHost 文件的内容以包含 SSL 配置。

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Account registered.
Requesting a certificate for hosting.example.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/hosting.example.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/hosting.example.com/privkey.pem
This certificate expires on 2024-03-12.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for hosting.example.com to /etc/httpd/conf.d/whmcs-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://hosting.example.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

我们可以确认有一个新文件存在。

$ ls /etc/httpd/conf.d/whmcs*
/etc/httpd/conf.d/whmcs.conf  /etc/httpd/conf.d/whmcs-le-ssl.conf

可以使用cat查看/etc/httpd/conf.d/whmcs-le-ssl.conf文件的内容。

$ cat  /etc/httpd/conf.d/whmcs-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName hosting.example.com
        ServerAdmin [email 
        DocumentRoot /var/www/whmcs
        <Directory /var/www/whmcs/>
	  Options Indexes FollowSymLinks MultiViews
	  AllowOverride All
 	  Order allow,deny
	  allow from all
          Require all granted
        </Directory>
        ErrorLog  /var/log/httpd/whmcs_error.log
        CustomLog /var/log/httpd/whmcs_access.log combined

SSLCertificateFile /etc/letsencrypt/live/hosting.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hosting.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf

对于 /etc/httpd/conf.d/whmcs.conf 也是如此。

$ cat  /etc/httpd/conf.d/whmcs.conf
<VirtualHost *:80>
        ServerName hosting.example.com
        ServerAdmin [email 
        DocumentRoot /var/www/whmcs
        <Directory /var/www/whmcs/>
	  Options Indexes FollowSymLinks MultiViews
	  AllowOverride All
 	  Order allow,deny
	  allow from all
          Require all granted
        </Directory>
        ErrorLog  /var/log/httpd/whmcs_error.log
        CustomLog /var/log/httpd/whmcs_access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =hosting.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

备份 Apache /etc/httpd/conf.d/ssl.conf 配置文件。

sudo mv  /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak

编辑文件并进行调整以包含 Listen 443 https 行。

$ sudo vim /etc/httpd/conf/httpd.conf
Listen 80
Listen 443 https

重新启动 httpd 服务。

sudo systemctl restart httpd

接下来,更新“常规”选项卡中的WHMCS 系统网址设置(位于配置 > 系统设置 > 常规设置),输入您网站启用的 https://网址。


更新于:1个月前
赞一波!3

文章评论

全部评论