2016-08-02 50 views
1

它第一次嘗試託管一個網站..首先我買了一個域名在「Strato」上,我通過Ubuntu服務器和我們的Fitzbox使用Dyndns獲得了在這個域上運行的apache。但是現在我想做下一步並託管一個子域。我在strato網頁界面上創建了一個子域,並試圖在apache中設置它,但我無法連接到它。如果我將我們的fritzbox中的DynDns更改爲子域名,我可以連接到子域名但不能訪問正常的域名,您知道我可以通過互聯網連接到這兩個域名嗎?子域Apache2

在阿帕奇我創造了這個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 [email protected] 
    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 Domains

我真的是我的英語,我不是最好的,我希望你可以忽略這個事實...

在此先感謝!

回答

1

Apache的設置都OK,問題是DNS:

onewaygaming.saneqt.de

;QUESTION 
onewaygaming.saneqt.de. IN A 
;ANSWER 
onewaygaming.saneqt.de. 149 IN A 81.169.145.156 

www.SaneQt.de

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完全相同。

+0

林不知道你是什麼意思與「onewaygaming.saneqt.de IN A」和其他的東西......問題是我的fritzbox IP每天都在變化.Im rly新...和CNAME的事情是我dindnt配置saneqt.de的東西設置被阻止,而我激活dyndns ... –

+0

做到這一點:http://www.strato-faq.co.uk/article/111/How-to-setup-CNAME-record -for-your-subdomain.html爲您的子域名。作爲CNAME條目把'www.saneqt.de' –

+0

我得到一個錯誤,稱爲「我需要填寫一個絕對服務器名稱」 –