Annoying "www" host

Discussion in 'Installation/Configuration' started by t-mug, Jul 15, 2007.

  1. t-mug

    t-mug New Member

    Hi,

    I created a site named "domain.tld" by deleting the automatic entry "www" in the host field. But this is rather an invisible :D feature since every time I open the basic tab for the site, the "www" is inserted again by the ispwizard, though wheter there is a domain like this nor I want a domain like this.
    So I can understand that this automatism is useful while creating a new site - it's annoying if you open an existing site, because every time I open this web I have to delete the "www" before moving to the next tab. Is there a way to avoid this behavior?

    Thanks.
     
  2. TexasTaz

    TexasTaz New Member

    I ran into the same thing however I wouldn't worry about it because, if it created right, it created a co-domain that is this only http://domain.tld as it is, that is a default hard coded setting and really is not that obtrusive. As long as you have the co-domain http://domain.tld your web site will answer to http://domain.tld just don't advertise that www is there. No big deal really. By the way there is no reason to keep deleting the www in the config just leave it alone.

    That's why the co-domain was created by the wizard is to answer those calls to the website/server/domain in any fashion.

    See ya Hope this helps.
     
    Last edited: Jul 16, 2007
  3. t-mug

    t-mug New Member

    Hi TexasTaz,
    There are always reasons we are not facing - e.g.: if you already have a domain named www.domain.tld and if you have a ssl certified domain, that needs the form "domain.tld", well, maybe you see no way out than creating a web named "domain.tld" (due to the certificate) and keeping the www.domain.tld web redirecting to this. This way leaving the automatic www hostname means fighting against error messages, because this domain is already existent! So you have to delete the hostname. Every time.
    For me it looked better and cleaner if records which are saved already wouldn't be changed automatically. As far as I see nobody would expect this.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The records are changed automatically as the www is nescessary for ISPConfig, otherwise the website will not work properly.
     
  5. t-mug

    t-mug New Member

    Thanks for reply,

    but what would be the correct solution in this case? I need the domain name like https://domain.tld as quasi primary domain name. What other way works?

    My above-mentioned "method" looks working meanwhile - the starting page is shown, the web folders are created, the vhost entry is made - what would come if I continue?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Please do what TexaTaz suggested, you will see it works perfectly this way.
     
  7. t-mug

    t-mug New Member

    Hi Till,

    you're right. It works this way. My error in reasoning.

    Thanks again for your patience.
     
  8. t-mug

    t-mug New Member

    Confused

    Good day, again,

    now the link http://www.domain.tld doesn't work und gives the sharedip message. Looking in the Vhosts_ispconfig.conf file: no entry for host "www", there are entries for "domain.tld" (port 80 and 443) only.

    This is really confusing: I am forced to create a www.domain.tld, I created the co-domain domain.tld (and, yes, for this is the ssl certificate installed via the ssl tab) and the www.domain.tld will not generated? Is this an intended behaviour due to the ssl certificate?
    If I want to use the http://www.domain.tld too, what have I to do? Creating another co-domain "www" does not work, well, ispconfig says it exists already. But it doesn't.

    Sorry for insisting on this issue, but it seems I think quite diffent.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    This happens most likely because you removed the www the first time. Please make sure that www is entered in the hostname field of the website and hit save.
     
  10. t-mug

    t-mug New Member

    No difference. The entries in the Vhosts_ispconfig.conf file remain the same. I hit another name to make sure, that it's taken. Looked OK, then "www" again, no difference. Only the 2 http + https domain.tld entries.
     
  11. TexasTaz

    TexasTaz New Member

    Do me a favor t-mug Login to your control panel go to the domain.tld in question in the menu on the left -> click on the records tab for me. See if yours looks like this if not try to make it look this way:

    IP-Adresse Hostname
    209.xxx.xx.xx ns1
    209.xxx.xx.xx mail
    209.xxx.xx.xx www

    CNAME
    Hostname Target
    pop3 mail.hosthobo.com
    smtp mail.hosthobo.com
    webmail www.hosthobo.com
    sql www.hosthobo.com

    MX
    Mailserver Hostname
    mail.hosthobo.com

    SPF
    Hostname
    hosthobo.com

    It is not only the Vhosts file you have to worry about you also have to have the dns match up properly the way I usually do it is domain.tld has an a record then I create an alias of www that points to the domain.tld then it doesn't matter what anything says one will resolve to the other and vice versa.

    I hope this helps,
    TexasTaz
     
    Last edited: Jul 16, 2007
  12. t-mug

    t-mug New Member

    Thank you TexasTaz,

    if I get the sharedip message, this means the http://www.domain.tld is resolved and for DNS is nothing more to do. If otherwise in the Vhost file you find NO entry ServerName www.domain.com:80 OR NO entry ServerAlias www.domain.de the whole shebang cannot work and Apache throws accurately the sharedip message.

    But I did you the favor, I looked in the RR's and all is OK there (after deleting some old test hostnames, which have surprisingly been not deleted after changing the value in the web tab "Basis" for this domain, but this is out of range here).
    I looked in the isp_isp_web table and there I found the entry as one would expect in case all goes well: field web_host contains "www" and field web_domain holds "domain.tld".

    Therefore my question would be rather: why is this record not written into the Vhosts_ispconfig.conf file like all the other records but this way, that the subdomain part of the domain name is eliminated? The only obvious difference I see is the SSL stuff in the same problem child record.
     
  13. TexasTaz

    TexasTaz New Member

    I see your point however the only time I had the problem you are describing was when I didn't have my content in the proper driectory.

    For instance my path is this /var/www/web1/web/
    Now when I didn't have content in there I got the Shared IP page also by default Apache will serve up the index.htm/html page before it will serve up the index.php page so in this case I had to - mv index.htm to index.php - and my site and dns resolved to the proper index.php for my site.

    See ya,
     
    Last edited: Jul 17, 2007
  14. t-mug

    t-mug New Member

    Please Till,

    only you can end this. What is happening, that the existing "www" in the web_host field of the isp_isp_web table is completely ignored? To change the entry manually in the Vhosts_ispconfig.conf file is useless as we know. It will be overwritten next time.

    And to be honest: deleting the domain and the users and all and start a new web to solve this - I'm afraid the confusion could possibly grow.

    Let me show you the ful entries for www.domain.tld in the Vhosts_ispconfig.conf file:

    Code:
    ######################################
    # Vhost: domain.tld:80
    ######################################
    #
    #
    <VirtualHost xx.xx.xx.xx:80>
    SSLCertificateChainFile /root/certificate/sub.ca.crt
    SSLCACertificateFile /root/certificate/ca.crt
    SuexecUserGroup nobody web13
    ServerName domain.tld:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web13/web
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl inde
    x.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /var/www/web13/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web13/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php3>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php4>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/var/www/web13/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web13/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web13/user/$1/web/$3
    </VirtualHost>
    #
    <IfModule mod_ssl.c>
    <VirtualHost xx.xx.xx.xx:443>
    SSLCertificateChainFile /root/certificate/sub.ca.crt
    SSLCACertificateFile /root/certificate/ca.crt
    SuexecUserGroup nobody web13
    ServerName domain.tld:443
    ServerAdmin [email protected]
    DocumentRoot /var/www/web13/web
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl inde
    x.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /var/www/web13/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web13/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php3>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php4>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    SSLEngine on
    SSLCertificateFile /var/www/web13/ssl/.domain.tld.crt
    SSLCertificateKeyFile /var/www/web13/ssl/.domain.tld.key
    Alias /error/ "/var/www/web13/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web13/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web13/user/$1/web/$3
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    </VirtualHost>
    </IfModule>
    #
    
    Maybe should I avoid using webs named "web13" ?? :)
    Thank you all.
     
  15. falko

    falko Super Moderator Howtoforge Staff

    Any errors in /home/admispconfig/ispconfig/ispconfig.log?

    Can you post the output of
    Code:
    ls -l /path/to/Vhosts_ispconfig.conf_directory
    and
    Code:
    ls -la /root/ispconfig
    ?
     
  16. t-mug

    t-mug New Member

    Hi Falko,

    Code:
    mug1:~# ls -l /etc/apache2/vhosts/
    total 356
    -rw-r--r-- 1 root root 11265 2007-07-17 01:55 Vhosts_ispconfig.conf
    -rw-r--r-- 1 root root 11283 2007-07-16 12:34 Vhosts_ispconfig.conf_16-07-07_12-34-36
    -rw-r--r-- 1 root root 11339 2007-07-16 12:34 Vhosts_ispconfig.conf_16-07-07_12-34-57
    -rw-r--r-- 1 root root 11361 2007-07-16 12:45 Vhosts_ispconfig.conf_16-07-07_12-45-09
    -rw-r--r-- 1 root root 11361 2007-07-16 12:45 Vhosts_ispconfig.conf_16-07-07_12-45-51
    -rw-r--r-- 1 root root 11361 2007-07-16 12:46 Vhosts_ispconfig.conf_16-07-07_12-46-12
    -rw-r--r-- 1 root root 11361 2007-07-16 12:47 Vhosts_ispconfig.conf_16-07-07_12-47-33
    -rw-r--r-- 1 root root 11733 2007-07-16 14:21 Vhosts_ispconfig.conf_16-07-07_14-21-48
    -rw-r--r-- 1 root root 11361 2007-07-16 14:22 Vhosts_ispconfig.conf_16-07-07_14-22-09
    -rw-r--r-- 1 root root 11361 2007-07-16 14:22 Vhosts_ispconfig.conf_16-07-07_14-22-30
    -rw-r--r-- 1 root root 11366 2007-07-16 14:55 Vhosts_ispconfig.conf_16-07-07_14-55-02
    -rw-r--r-- 1 root root 11361 2007-07-16 14:55 Vhosts_ispconfig.conf_16-07-07_14-55-26
    -rw-r--r-- 1 root root 11366 2007-07-16 14:55 Vhosts_ispconfig.conf_16-07-07_14-55-48
    -rw-r--r-- 1 root root 11361 2007-07-16 14:56 Vhosts_ispconfig.conf_16-07-07_14-56-09
    -rw-r--r-- 1 root root 11361 2007-07-16 15:03 Vhosts_ispconfig.conf_16-07-07_15-03-21
    -rw-r--r-- 1 root root 11361 2007-07-16 15:04 Vhosts_ispconfig.conf_16-07-07_15-04-45
    -rw-r--r-- 1 root root 11361 2007-07-16 18:08 Vhosts_ispconfig.conf_16-07-07_18-08-32
    -rw-r--r-- 1 root root 11361 2007-07-16 18:09 Vhosts_ispconfig.conf_16-07-07_18-09-05
    -rw-r--r-- 1 root root 11361 2007-07-16 18:09 Vhosts_ispconfig.conf_16-07-07_18-09-28
    -rw-r--r-- 1 root root 11361 2007-07-16 18:16 Vhosts_ispconfig.conf_16-07-07_18-16-42
    -rw-r--r-- 1 root root 11361 2007-07-16 18:19 Vhosts_ispconfig.conf_16-07-07_18-19-55
    -rw-r--r-- 1 root root 11361 2007-07-16 18:50 Vhosts_ispconfig.conf_16-07-07_18-50-01
    -rw-r--r-- 1 root root 11361 2007-07-16 19:45 Vhosts_ispconfig.conf_16-07-07_19-45-04
    -rw-r--r-- 1 root root 11361 2007-07-16 21:31 Vhosts_ispconfig.conf_16-07-07_21-31-49
    -rw-r--r-- 1 root root 11429 2007-07-16 22:21 Vhosts_ispconfig.conf_16-07-07_22-21-32
    -rw-r--r-- 1 root root 11361 2007-07-16 22:22 Vhosts_ispconfig.conf_16-07-07_22-22-53
    -rw-r--r-- 1 root root 11361 2007-07-17 01:43 Vhosts_ispconfig.conf_17-07-07_01-43-43
    -rw-r--r-- 1 root root 11361 2007-07-17 01:44 Vhosts_ispconfig.conf_17-07-07_01-44-04
    -rw-r--r-- 1 root root 11361 2007-07-17 01:55 Vhosts_ispconfig.conf_17-07-07_01-55-45
    -rw-r--r-- 1 root root  6146 2007-06-21 00:00 Vhosts_ispconfig.conf_21-06-07_00-00-32
    
    Code:
    mug1:~# ls -la /root/ispconfig
    total 108
    drwxr-xr-x  9 root root  4096 2007-07-17 01:55 .
    drwxr-xr-x  7 root root  4096 2007-07-15 13:00 ..
    -rwxr-xr-x  1 root root 41608 2007-06-10 00:21 cronolog
    -rwxr-xr-x  1 root root  9673 2007-06-10 00:21 cronosplit
    drwxr-xr-x 12 root root  4096 2007-06-10 00:06 httpd
    drwxr-xr-x 14 root root  4096 2007-06-10 00:21 isp
    -rw-r--r--  1 root root     8 2007-07-17 01:55 .old_path_httpd_root
    drwxr-xr-x  6 root root  4096 2007-06-10 00:02 openssl
    drwxr-xr-x  6 root root  4096 2007-06-10 00:14 php
    drwxr-xr-x  4 root root  4096 2007-07-15 23:59 scripts
    drwxr-xr-x  4 root root  4096 2007-06-10 00:21 standard_cgis
    drwxr-xr-x  2 root root  4096 2007-06-10 00:21 sv
    -rwx------  1 root root  9389 2007-06-10 00:21 uninstall
    
    Thanks for examine, regards
     
  17. t-mug

    t-mug New Member

    Falko,

    please wait a short while - I found warnings in the ispconfig.log; as a result the OLD config was written. I have to examine the stuff, I will report about this. Until then please stop making efforts. Thanks!
     
  18. t-mug

    t-mug New Member

    All is good now

    OK, Falko (1000 thanks) has given the hint: "look in the ispconfig.log" - almost nothing more to say. My posted Vhost file said (see above):
    Code:
    SSLCertificateFile /var/www/web13/ssl/[B].domain.tld.crt[/B]
    SSLCertificateKeyFile /var/www/web13/ssl/[B].domain.tld.key[/B]
    but the vhosts writing function expects in this folder either unhidden(!) files of the convention "host.domain.tld.???" or it tries to move *.crt, *.key and others to these names. Because I renamed the host from nothing to "www" in the past, it seems ispconfig got confused about this; and because there were at last (hidden!) files .domain.tld.??? only, nothing to move was found and warnings get logged, the operation failed and as a result the old version of the vhosts file was written as fallback. Exactly this is the reason why I was unable to get rid of the "domain.tld" in this vhosts file (instead of "www.domain.tld").

    Next time should I look in the log first before annoying you with annoying hosts ;)
    So thanks again.
     
  19. t-mug

    t-mug New Member

    Postnatal

    At the end: maybe you should prohibit writing empty hosts into the database. The ssl files became hidden because ispconfig wrote $host.$domain.$tld into the file system while $host was unexpectly and unevaluated empty - so .domain.tld.crt (and so on) were written and the problem began.
     
    Last edited: Jul 18, 2007

Share This Page