温馨提示:本文翻译自stackoverflow.com,查看原文请点击:linux - WHM/cPanel
apache cpanel dns linux whm

linux - WHM / cPanel

发布于 2020-04-08 17:38:49

我们需要新的专用IP地址(以及所有将来的专用IP地址)来“指向”我们VPS“父”域(具有所有业务逻辑的主域,检测到$ _SERVER ['host']连接)的相同根目录关联文件等)

因此,例如,domain.net(xxx146)应显示domain.com(xxx170)等的内容

我们有专用IP列表,已添加到WHM。我们有许多域名,这些IPS作为DNS A记录。我们已经通过cPanel添加了这些域以指向相同的public_html。

在此处输入图片说明 但是所有域都解析为:cgi-sys / defaultwebpage.cgi,带有“抱歉!如果您是此网站的所有者,请与您的托管服务提供商联系:”错误。

有什么建议?这应该是一件容易的事,但显然不是。

谢谢

查看更多

提问者
Rossitten
被浏览
50
Rossitten 2020-02-01 02:26

这是解决方案。安装了cPanel / WHM看起来似乎无能为力,这不是一个理想的机器人。

<VirtualHost x.x.x.x:443>
    ServerName domain.net
    ServerAlias www.domain.net
    DocumentRoot /home/user/public_html
    #todo common contact mail
    ServerAdmin support@domain.net
    UseCanonicalName Off
    <IfModule mod_suphp.c>
        suPHP_UserGroup user user
    </IfModule>
    <IfModule ssl_module>
        SSLEngine on
        SSLCertificateFile /etc/letsencrypt/live/domain.net/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/domain.net/privkey.pem
        SSLCertificateChainFile /etc/letsencrypt/live/domain.net/chain.pem
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    </IfModule>
    <IfModule headers_module>
        RequestHeader set X-HTTPS 1
    </IfModule>
</VirtualHost>
  • 从80重定向到443分别设置:
    
    RewriteEngine开 
    RewriteRule ^ /?(。*)https://%{SERVER_NAME} / $ 1 [R,L]