这是我第一次尝试托管网站..首先我在“Strato”上购买了一个域名,我通过ubuntu服务器和我们的fitzbox使用Dyndns在这个域上运行apache。但现在我想进行下一步并托管一个子域。我在strato web界面上创建了一个子域,并尝试在apache中设置它,但我无法连接到它。如果我将fritzbox中的DynDns更改为子域,我可以连接到子域但不能连接到普通域,你知道我可以做些什么来通过互联网连接它们吗?
在apache中我创建了这两个文件:000.default.conf ----它们都已启用
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# 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.SaneQt.de
ServerAdmin webmaster@localhost
DocumentRoot /var/www/000
# 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>
001-oneway.conf
<VirtualHost *:80>
ServerName onewaygaming.saneqt.de
DocumentRoot /var/www/001
</VirtualHost>
FritzboxSettings:端口80已打开,我使用此设置Fritzbox DynDns Settings
Strato:Strato Domains
我真的很喜欢我的英语,我不是最好的傻瓜,我希望你可以忽略这个事实...
提前致谢!!
答案 0 :(得分:1)
你的apache设置没问题,问题在于DNS:
;QUESTION
onewaygaming.saneqt.de. IN A
;ANSWER
onewaygaming.saneqt.de. 149 IN A 81.169.145.156
www.SaneQt.de. IN A
;ANSWER
www.SaneQt.de. 149 IN CNAME SaneQt.de.
SaneQt.de. 59 IN A 46.243.84.57
目前,http://www.saneqt.de/正在回复Hallo welt
,所以我猜它有正确的设置。如果是,则需要为CNAME
配置与onewaygaming.saneqt.de
完全相同的www.SaneQt.de
记录。