【问题标题】:apache vitual host (EAI 2)Name or service not known: AH00547: Could not resolve host nameapache 虚拟主机(EAI 2)名称或服务未知:AH00547:无法解析主机名
【发布时间】:2023-12-03 07:46:02
【问题描述】:

我收到此错误,我的网站无法启动 (EAI 2)名称或服务未知:AH00547:无法解析主机名 betatgh.tgi.na -- 忽略!

我的主机配置文件是这样的

    ServerName betatgh.tgi.na
    ServerAdmin itwhk@tgh.na
    ServerAlias www.betatgh.tgi.na
    DocumentRoot /var/www/betatgh.tgi.na
    #Redirect "/" "http://betatgh.tgi.na/"
    <Directory /var/www/betatgh.tgi.na/>
       Options Indexes FollowSymLinks
       Require all granted
       AllowOverride all
    </Directory>

    

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

vim: 语法=apache ts=4 sw=4 sts=4 sr noet

【问题讨论】:

    标签: apache localhost virtualhost


    【解决方案1】:

    您必须在您的 dns 中定义 betatgh.tgi.na。

    例如使用 CNAME 指向 tgi.na

    【讨论】: