我有两个网站:
iq-dev.de 和 iq-dev.com
iq-dev.de 可以正常工作,也可以通过 www.iq-dev.de 获得。我有一个安装了 linux 的云服务器,并通过 ssh 编辑所有内容。
我的主机名是“thor”,我试过:
- 将 iq-dev.com 添加到我的主机文件
- 在 apache2 文件中将 iq-dev.com 添加为“启用站点”/“站点可用”
我的主机看起来像这样:
127.0.0.1 localhost localhost
82.223.17.182 iq-dev.com thor
82.223.17.182 iq-dev.de thor
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
在我的可用站点和已启用站点中,我添加了iq-dev.com.conf
具有以下设置的文件:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port t$
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
ServerName iq-dev.com
ServerAlias www.iq-dev.com
DocumentRoot /var/www/iq-dev.de/main
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
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
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
谁能告诉我哪里出错了?我现在真的不知道该怎么办。我搜索了主机文件和站点可用/站点启用的不同教程,但我看不到任何错误。
我想做的当然只是让 iq-dev.com 解析到与 iq-dev.de 相同的文件夹。
如果您希望两个网站上的内容相同,请编辑“iq-dev.de”的配置文件,添加以下内容:
您没有为
iq-dev.com
联系您的域名提供商,将域名指向您的网络服务器