default vhost

Discussion in 'Installation/Configuration' started by 8omas, Mar 22, 2011.

  1. 8omas

    8omas Member HowtoForge Supporter

    I read a lot of post in here about setting the default vhost file of apache but I cannot conclude to anything specific.
    So I did this:
    I renamed the default file to default.old (in case I need it later) in /etc/apache2/sites-available and I made a symlink of one of my vhost (eg xyz.com.vhost) to default. (ln -s xyz.com.vhost default)

    Now I have the default vhost that I want (and not the first available when someone try to access by ip or by unknown subdomain), but I don't know if the above action interfere somehow with ISPConfig.

    Does the ISPConfig uses the default vhost (the default file) for some particular reason?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    It is used for webmail and phpmyadmin. Changing the default vhost might disable webmail and phpmyadmin and all other webbased software that you might have installed with the package manager of your linux distribution.
     
  3. 8omas

    8omas Member HowtoForge Supporter

    Ok. So which is the best way to define the default vhost?
    For the record, with the above change, I have no problem with webmail and phpmyadmin. I did the change after I have installed them
     
  4. 8omas

    8omas Member HowtoForge Supporter

    I followed your advice and left default untouched.

    The trick I did is to make a symbolic link to my desired host:
    Code:
    ln -s /etc/apache2/sites-enabled/001-mydesired.vhost /etc/apache2/sites-enabled/mydesired.vhost
    This vhost comes first and after the 000-default and 000-ispconfig
     
  5. suther

    suther Member

    I think I have an problem, which goes in the same direction, hope somebody can give me a hint:

    If I do load "default-ssl" with a2ensite default-ssl, it appears in /etc/apache/sites-enabled as:
    ...default-ssl -> ../sites-available/default-ssl
    Problem is, it appears at last entry in the directory (cause of the missing prefix-number) and never be the default-ssl (each 443-config in front of this enry will be catched in previous)

    But If I load the "default" (means Port 80) it appears at 000-default -> /etc/apache2/sites-available/default.

    So what may the problem that there is no 000- added as prefex for the defaul-ssl

    Distribution is: Debian Wheezy
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Just change the name of the ssl default vhost symlink in the sites-enabled folder and restart apache.
     
  7. suther

    suther Member

    Yes, I have done this. But I wonder why this happend.
    But anyway... if once configured, it should be worked for all the time :)
     

Share This Page