本文介绍了使用Google Cloud + CloudFlare创建子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CloudFlare上有一个域名bar.com,它链接到Google Cloud上托管的网站。我可以在CloudFlare上为子域 foo创建新的A记录,但是如何将其映射到Google Cloud上的bar.com/foo?

I have a domain bar.com on CloudFlare that is linked to a site hosted on Google Cloud. I can create a new A record on CloudFlare for a subdomain "foo", but how do I map that to bar.com/foo on Google Cloud?

不知道这个问题是否有意义。基本上,我有一个托管在标准服务器上的网站,该网站即将移至Google Cloud。在标准服务器上,我拥有CPanel,可处理子域(已添加到CloudFlare的DNS中)的创建。我不确定如何在Google Cloud上复制此过程。

I'm not sure if this question makes sense. Basically, I have a site that is hosted on standard server which I am moving to Google Cloud. On the standard server, I have CPanel which handles creation of subdomains (of which are added to CloudFlare's DNS). I'm not sure how this process is replicated on Google Cloud.

任何帮助将不胜感激!

推荐答案

我找到了解决方案,基本上是手动创建一个条目。我有点困惑,因为我正在使用Bitnami LAMP部署。

I found the solution, it's basically to manually create a entry. I was confused a little because I am using the Bitnami LAMP deployment.

如果将来对某人有帮助,如果您使用Bitnami的LAMP,这是怎么做的您创建子域

In case this will help somebody in the future, if you're using Bitnami's LAMP, this is how you create subdomain(s)

打开文件 /opt/bitnami/apache2/conf/bitnami/bitnami.conf 并添加以下内容:

Open the file /opt/bitnami/apache2/conf/bitnami/bitnami.conf and add the following:

<VirtualHost *:80>
    ServerName foo.bar.com
    ServerAdmin [email protected]

    DocumentRoot "/opt/bitnami/apache2/htdocs/foo"
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory "/opt/bitnami/apache2/htdocs/foo">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

</VirtualHost>

其中 foo 是子域。然后重新启动Apache sudo /opt/bitnami/ctlscript.sh重新启动apache

where foo is the subdomain. Then restart Apache sudo /opt/bitnami/ctlscript.sh restart apache

如果您使用的是CloudFlare,您将需要在您的DNS中添加一个A条目,并以 foo 作为名称,以及您的Bitnami / Google Cloud部署的IP。您可以将状态保留为绕过(灰色云)或活动(橙色云)。

If you are using CloudFlare, you will need to add an A entry into your DNS, with foo as the name, and your Bitnami/Google Cloud deployment's IP. You may leave the status as bypass (grey cloud) or active (orange cloud), it doesn't matter.

希望对您有所帮助!

这篇关于使用Google Cloud + CloudFlare创建子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 05:37