标签 cPanel 下的文章

cPanel - WHM - 为apache2新增模块 - mod_version - Invalid command '<IfVersion'

问题:迁移magento2站点后,访问首页,提示500错误,apache2错误日志里有此类错误信息:.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by

尝试:WHM -> EasyApache 4 --> Apache Modules ---> 选上 mod_version

cpanel-apache-modules-version.png

参考:https://stackoverflow.com/questions/51743921/magento-ifversion-perhaps-misspelled-or-defined-by-a-module-not-included-in-t

Magento2的SMTP Pro测试发送gmail邮件失败 - cPanel

现象:WHM/cPanel环境里安装了Magento2,想通过SMTP Pro用gmail的邮件服务发邮件。邮件发送测试时提示出错:SMTP Pro Self Test Results: Exception message was: Unable to connect via TLS

过程:

1.确认php环境是支持openssl的,发信测试也是一样的失败结果
magento-smtp-gmail-ssl-1.png

2.搜索得,需要在WHM的Tweak Settings中,将“Restrick outgoing SMTP to root, exim, and mailman(FKA SMTP Tweak)”的功能关闭(设置为Off)
magento-smtp-gmail-ssl-3.png

3.重新测试发信,正常了

参考:https://magento.stackexchange.com/questions/22227/transactional-emails-not-going-out/22233#22233?newreg=72b194287746436db1f4744ce11838b4

找到cPanel的站点证书路径 - /var/cpanel/ssl/apache_tls/domain.com/combined

问题:cPanel的站点,布置了SSL证书,现在需要从apache转换到nginx提供https访问,但从cPanel中复制的私匙和证书,nginx会报错,提示证书不匹配。

cpanel-ssl-nginx-1.png

尝试:搜索.pem文件,找到/var/cpanel/ssl目录,再找到相应站点里的combined,查看到里边有私匙和证书。将combined文件添加到nginx里,可以使用。

cpanel-ssl-nginx-2.png