ServerAlias - how to specify Apache2 ServerAlias directive using ISPConfig

Discussion in 'Installation/Configuration' started by Ripper, Jun 25, 2007.

  1. Ripper

    Ripper New Member

    The Apache ServerAlias directive points calls for domain names to aliases of the specified domain. It is commonly used to direct calls for both yourdomainname.ext and www.yourdomainname.ext to the same site files to accomodate either entry in the browser.

    Using the gui ISPConfig to configure a site and DNS, ISPConfig defaults the setting (found in in the file: /etc/apache2/vhosts/Vhosts_ispconfig.conf) to specify only one ServerAlias directive, yourdomainname.ext.

    I have tried adding the directive and values in the ISPConfig box defining Apache directives, but longer names get truncated. Left blank, the ServerAlias directive defaults to: ServerAlias yourdomainname.ext

    Can somebody tell the world (and me) where the ISPConfig option is that will configure both yourdomainname.ext and www.yourdomainname.ext in the Apache ServerAlias directive variables?

    Directive should appear like this in the virtual configuration file:

    ServerAlias yourdomainname.ext www.yourdomainname.ext

    Thanks.
     
    Last edited: Jun 25, 2007
  2. mlz

    mlz New Member

    Take a look at co-domains. That's basically what they are if you don't forward or anything kinky like that.
     
  3. Ripper

    Ripper New Member

    Naming Conflict

    Tried to add both www.domain.ext and servername.ext to co-domains but the ServerName variable seems to get in the way. My previous manual configuration (prior to ISPConfig) was setup such that, in order for it to work on both www.domain.ext and domain.ext, the ServerName is set to www.domain.ext and the Server Alias is: ServerAlias domain.ext www.domain.ext

    ISPConfig apparently recognizes the ServerName www.domain.ext as conflicting with the attempted use of the same name in co-domains feature. ...or, am I missing something? When I manually enter the ServerAlias it works fine until I touch it again with ISPConfig. Then it reverts.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    To set this up in ISPCnofig, create:

    a website with:

    hostname: www
    domain: domain.ext

    and add to this website a co domain with:

    hostname:
    domain: domain.ext

    There is no need to add www.domain.ext as co-domain too as it is configured by ISPConfig automatically.
     
  5. 3StrikesDesign

    3StrikesDesign New Member

    In theory that would work great if you did not plan on setting up any additional sub-domains as full sites on the same server. However when you have a co-domain configured for just domain.ext you can not create any other domains with that name in it or you get an error telling you the name is already in use.
     

Share This Page