【问题标题】:Virtual Host on CentOS5CentOS5 上的虚拟主机
【发布时间】:2023-03-28 05:55:02
【问题描述】:

我正在尝试向 CentOS 5 机器添加一个新的虚拟主机。

我在 virtualhost.conf 中添加了一个与现有条目匹配的新部分:

<VirtualHost ip address:80>
    ServerAdmin email@email.com
    DocumentRoot /home/stuff/public_html
    ServerName stuff.stuff.com
    ErrorLog /var/log/httpd/stuff.stuff.com-error_log
    CustomLog /var/log/httpd/stuff.stuff.com-access_log combined
    <Directory /home/stuff/public_html>
        Options All
        AllowOverride All
    </Directory>
    <IfModule mpm_itk_module>
      AssignUserId stuff stuff
    </IfModule>
</VirtualHost>

然后我使用以下命令重新加载:/etc/init.d/httpd reload

我在目录中放置了一个占位符 index.php,并希望在访问域时看到“它可以工作”,但 Chrome 却显示“ERR_NAME_NOT_RESOLVED”

我在这里缺少哪些步骤? (我习惯在windows环境下工作,这是我第一次真正接触CentOS)

【问题讨论】:

  • Chrome 未能将 DNS 名称解析为其 IP 地址,可能与 Apache 配置无关。名称 stuff.stuff.com 是否已在 DNS 中注册?如果您从您尝试访问它的客户端计算机上ping stuff.stuff.com,它会解决吗?
  • 不,当我 ping 它时不返回任何内容。这看起来可能是 DNS 而不是配置。
  • 如果您在 localhost 上工作,请尝试编辑您的 /etc/hosts 文件。更改您的主机名并将其指向 /etc/hosts 文件中的 IP 地址。

标签: apache centos


【解决方案1】:

将此作为 DNS 问题解决,已解决本地编辑主机以匹配 IP。

【讨论】:

    猜你喜欢
    • 2011-04-26
    • 2020-01-23
    • 2023-04-06
    • 2020-07-17
    • 2011-05-13
    • 2012-02-16
    • 2016-05-16
    • 2020-09-11
    • 2010-10-07
    相关资源
    最近更新 更多