虚拟主机的问题

发布于 2025-01-02 09:22:54 字数 475 浏览 1 评论 0原文

您好,我目前正在尝试设置基于 CentOS 的 Web 服务器,但在使域正常工作时遇到问题。

我按如下方式设置 httpd.conf:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot /etc/httpd/www/alexandergatti.com
  ServerName alexandergatti.com
</VirtualHost>

当我尝试访问该网站时,网络浏览器显示找不到服务器。我联系了我的主机,他们说 DNS 已正确设置。有人有什么想法吗?

Hello I am try set up a CentOS based web server currently and am having trouble getting the domains to work.

I set up the httpd.conf as follows:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot /etc/httpd/www/alexandergatti.com
  ServerName alexandergatti.com
</VirtualHost>

When I try to access the website the web browser says the server can't be found. I contacted my host and they said the DNS was set up corrently. Anyone have any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

御守 2025-01-09 09:22:54

您是否将您的域名“alexandergatti.com”指向您的公共IP地址并进行端口转发。如果您没有指向它,则必须通过转到域注册者 EX 中的 DNS 管理器区域来指向它:Go Daddy 或 1and1 并将站点 IP 地址指向您的公共 IP。

如果您还没有这样做,请执行下一步。端口转发也是最重要的。好的,现在您的访问者位于您的 IP 地址,但您的路由器不知道将他们发送到哪里。因此,许多路由器要么将它们放在应用程序和游戏中,要么将它们放在访问或虚拟服务器中。你打开它,上面写着端口启动或公共做公共端口。我更喜欢 80,因为您的访问者不必写 domain.com:8080。他们只需输入domain.com。结束端口或者私有端口是你为apache设置的ip地址。我假设你选择了 80。所以你输入 80。在 ip 地址或指向你输入你的计算机私有本地 ip,在我的例子中是 192.168.1.205..... 单击添加或更新或保存并尝试你的站点名称再次。如果您从路由器后面尝试,它可能无法工作,因此请在您的计划中有网络的手机或邻居互联网上尝试。它应该有效。

另外,在 NameVirtualHost *:80 和 VirtualHost *:80 处,您应该输入您的公共 IP,而不是星号或星号。

所以它应该看起来像

NameVirtualHost my.ip.add.ress:80

<VirtualHost my.ip.add.ress:80>
  ServerAdmin [email protected]
  DocumentRoot /etc/httpd/www/alexandergatti.com
  ServerName alexandergatti.com
</VirtualHost>

Did you point your domain name "alexandergatti.com" to your public ip address and do port forwarding. If you didn't point it you must point it by going to the DNS Manager zone in your domains registrant EX: Go Daddy or 1and1 and point the sites ip address to your public ip.

Next if you didn't already do this. Port Forwarding is also most important. OK so now your visitors are at your ip but your router doesn't know where to send them. So lots of routers either have them in applications and gamig or access or Virtual Server. You open it and where it says port start or public do the public port. I prefer 80 because your visitors will not have to write domain.com:8080. they just type domain.com. Ending port or private port is the ip address you set for apache. Im assuming you chose 80. So there you type 80. At the ip address or points to you type your computers private local ip which in my case is 192.168.1.205..... Click add or update or save and try your site name again. If you try it from behind your router it might not work so try it on a phone that has web in your plan or at a neighbors internet. It should work.

Also at NameVirtualHost *:80 and VirtualHost *:80 you should put your public ip instead of the star or astreics..

So it should be looking like

NameVirtualHost my.ip.add.ress:80

<VirtualHost my.ip.add.ress:80>
  ServerAdmin [email protected]
  DocumentRoot /etc/httpd/www/alexandergatti.com
  ServerName alexandergatti.com
</VirtualHost>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文