简体   繁体   English

从Internet访问基于名称的虚拟主机

[英]Accessing name-based virtual hosts from the internet

I'm currently beginning to learn Apache. 我目前正在学习Apache。 So I'm really a beginner here. 所以我真的是这里的初学者。 I've been able to set up a basic site and virtual hosts that I can access within my own network. 我已经能够建立一个基本站点和虚拟主机,可以在自己的网络中访问它们。

Forgive me if my question sounds stupid but is it possible to access my virtual hosts via name-based virtual hosting using only my external IP? 如果我的问题听起来很愚蠢,请原谅我,但是可以仅使用外部IP通过基于名称的虚拟主机访问我的虚拟主机吗? Or would I have to have an actual registered domain name for my virtual hosts that will be mapped by DNS to my external IP? 还是我必须为虚拟主机设置一个实际的注册域名,该域名将通过DNS映射到我的外部IP?

I might have answered my own question here. 我可能已经在这里回答了我自己的问题。 But I dunno. 但是我不知道。 I'm a total noob here. 我这里真是个菜鸟。

Thanks! 谢谢!

You can serve multiple domain-names off of a single IP, though IMO it is always best practice to have separate IP's for each domain/subdomain you want to use, as over time you might need to move domains around across different servers. 您可以在单个IP上提供多个域名,尽管IMO始终始终为您要使用的每个域/子域提供单独的IP,因为随着时间的流逝,您可能需要在不同服务器之间移动域。 In these cases you can (if your hosting set up allows) move the IP address along with the site you are migrating without having to update DNS. 在这些情况下,您可以(如果托管设置允许)将IP地址与要迁移的站点一起移动,而不必更新DNS。

虽然它不是一个很好的永久解决方案,但PageKite是一项简洁的服务,可以帮助您

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM