Apache WebServer-为子域设置DNS [英] Apache webserver - setting dns for subdomain

查看:85
本文介绍了Apache WebServer-为子域设置DNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,我们将其命名为www.website.ro,该网站运行在apache服务器centos上. 我没有cpanel或whm,但是我可以通过ssh访问centos.

I have a website let's name it www.website.ro which runs on apache server, centos. I do not have a cpanel or whm but I have acces to centos throught ssh.

我已经为我的主域和子域设置了VirtualHost,但是我不知道如何使子域从Internet可见. 我知道这与DNS和CNAME之类的东西有关,但我不知道将它们放在apache的文件中的位置.

I already set VirtualHost for my main domain and subdomain but I don't know how can I make my subdomain visible from internet. I know that is something related to DNS and things like CNAME, but I don't know where to put them in apache's files.

通过我的主域名已经可以在Internet上看到的方式,现在我也想使子域名也可见.

By the way my main domain is already visible on the internet,now i want to make the subdomain visible as well.

我已经编辑了httpd conf:

I have edited httpd conf:

<VirtualHost *:80>
    ServerAdmin webmaster@mywebsite.com
    ServerName  www.website.com
    ServerAlias www.website.com
    DocumentRoot /var/www/website.com
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@mywebsite.com
    ServerName subdomain.website.com
    ServerAlias subdomain.website.com
    DocumentRoot /var/www/subdomain.website.com
</VirtualHost>

谢谢

推荐答案

您对Apache配置的更改告诉它如果收到子域的请求,则可以处理该子域的请求,但不会影响访问者查找您的子域所需的DNS条目首先.

Your changes to Apache's configuration tell it to handle requests for the subdomain if it receives them, but won't affect the DNS entries that visitors need to find your subdomain in the first place.

要使您的子域可见,您必须将条目添加到DNS区域,该区域由ISP或注册商处理.

To make your subdomain visible you have to add entries to your DNS zone, which is handled by your ISP or registrar.

您必须在两个地方都进行更改才能使新的子域正常工作.

You have to make changes in both places to make your new subdomain work.

这篇关于Apache WebServer-为子域设置DNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆