子域 Apache2
Subdomain Apache2
这是我第一次尝试托管网站。首先,我在 "Strato" 上购买了一个域,然后通过 ubuntu 服务器和我们的服务器在该域上安装了 apache 运行使用 Dyndns 的 fitzbox。但现在我想做下一步并托管一个子域。我在 strato 网络界面上创建了一个子域并尝试在 apache 中设置它,但我无法连接到它。如果我将我们的 fritzbox 中的 DynDns 更改为子域,我可以连接到子域但不能连接到普通域,你知道我可以做些什么来通过互联网访问它们吗?
在 apache 中我创建了这 2 个文件: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
我真的很抱歉我的英语,我在学校不是最好的我希望你可以忽略这个事实...
提前致谢!!
你的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
,所以我猜它的设置是正确的。如果是这样,您需要为 onewaygaming.saneqt.de
配置 CNAME
记录,与为 www.SaneQt.de
所做的完全相同。
这是我第一次尝试托管网站。首先,我在 "Strato" 上购买了一个域,然后通过 ubuntu 服务器和我们的服务器在该域上安装了 apache 运行使用 Dyndns 的 fitzbox。但现在我想做下一步并托管一个子域。我在 strato 网络界面上创建了一个子域并尝试在 apache 中设置它,但我无法连接到它。如果我将我们的 fritzbox 中的 DynDns 更改为子域,我可以连接到子域但不能连接到普通域,你知道我可以做些什么来通过互联网访问它们吗?
在 apache 中我创建了这 2 个文件: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
我真的很抱歉我的英语,我在学校不是最好的我希望你可以忽略这个事实...
提前致谢!!
你的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
,所以我猜它的设置是正确的。如果是这样,您需要为 onewaygaming.saneqt.de
配置 CNAME
记录,与为 www.SaneQt.de
所做的完全相同。