Domain change does not get written correctly to VHosts file

Discussion in 'General' started by PavementPounder, May 28, 2010.

  1. PavementPounder

    PavementPounder New Member

    Hi,

    I came across this issue by accident. I was adding a subdmain of an already added domain, say wiki.olddomain.com, where olddomain.com already exists. This is all fine except that I was not watching what I was doing and the wiki.olddomain.com was actually suppose to be wiki.newdomain.com, where newdomain.com is also an existing site. If you change it (in the domain section of ISP Site panel) to what it was suppose to be wiki.newdomain.com then it only gets changed for www.wiki.newdomain.com and NOT for wiki.newdomain.com. If you go to wiki.newdomain.com it will not correctly work, whereas www.wiki.newdomain.com will.

    Upon looking at the VHosts file you can see the ServerAlias has not been changed to the new domain.

    Code:
    ######################################
    # Vhost: www.wiki.newdomain.ca:80
    ######################################
    #
    #
    <VirtualHost 216.234.161.148:80>
    ServerName www.wiki.newdomain.com:80
    ServerAdmin webmaster@wiki.newdomain.com
    DocumentRoot /var/www/web16/web
    ServerAlias wiki.olddomain.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ErrorLog /var/www/web16/log/error.log
    Alias /stats "/var/www/web16/web/webalizer"
    Alias /error/ "/var/www/web16/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/web16/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web16/user/$1/web/$3
    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
      RewriteRule .* - [F]
    </IfModule>
    </VirtualHost>
    #
    #
    #
    
    Upon further investigation you can see that in the db_ispconfig database the table isp_isp_domain the domain_domain column still has the old entry.

    If I change this entry to wiki.newdomain.com instead of wiki.olddomain.com will it break anything?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. PavementPounder

    PavementPounder New Member

    My problem is different. It's not that the VHosts file is not getting written, it does get updated, it's just that the ServerAlias directive gets written incorrectly. If I add and remove options such as PHP I can see that the VHosts file gets updated, although the ServerAlias directive always gets written incorrectly.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The server alias directive is the co-domain of the website. Please change the co-domain in the ispconfig interface to what you need.
     
  5. PavementPounder

    PavementPounder New Member

    Thanks,

    That solved the problem.
     

Share This Page