我想要子域名sarkastrunova.clevermarketing.cz
如果你现在将它添加到浏览器,它会解析为horsetransport.cz
同一 Web 服务器上的另一个虚拟主机。我不知道为什么。
解析到我的服务器的A 和 AAAA 的 DNS 记录sarkastrunova.clevermarketing.cz
。
子域名的配置文件
# domain: sarkastrunova.clevermarketing.cz
# public: /var/www/html/sarkastrunova.clevermarketing.cz/public_html/
NameVirtualHost *:80
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerName sarkastrunova.clevermarketing.cz
ServerAlias clevermarketing.cz
ServerAdmin [email protected]
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/html/sarkastrunova.clevermarketing.cz/public_html
<Directory /var/www/html/sarkastrunova.clevermarketing.cz/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -F info [email protected]"
</Directory>
# Log file locations
LogLevel warn
ErrorLog /var/www/html/sarkastrunova.clevermarketing.cz/log/error.log
CustomLog /var/www/html/sarkastrunova.clevermarketing.cz/log/access.log combined
</VirtualHost>
现在解析到的域的配置文件
# domain: horsetransport.cz
# public: /var/www/html/horsetransport.cz/public_html/
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin [email protected]
ServerName horsetransport.cz
ServerAlias www.horsetransport.cz
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/html/horsetransport.cz/public_html
<Directory /var/www/html/horsetransport.cz/public_html>
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -F info [email protected]"
AllowOverride All
</Directory>
# Log file locations
LogLevel warn
ErrorLog /var/www/html/horsetransport.cz/log/error.log
CustomLog /var/www/html/horsetransport.cz/log/access.log combined
</VirtualHost>
子域名无法解析肯定存在一些明显错误。如能提供任何帮助,我们将不胜感激
答案1
您的VirtualHost
配置本身似乎没问题。您的配置中是否包含所有配置文件?您可以使用检查sudo apache2ctl -S
。修改配置后您是否重新加载了 Apache(sudo systemtcl reload apache2
)?