HTTP NameVirtualHost not Working?

Discussion in 'Installation/Configuration' started by Outbreaker, Sep 25, 2022.

  1. Outbreaker

    Outbreaker Member

    Hi,
    I enabled the "HTTP NameVirtualHost" on my IPv4 and IPv6, and if i understand this option correctly then if i enter my Server IP i should be redirect to the ISPConfig. But nothing is changed if i enable this option i still get the Default Apache page if i enter my Server IP. :eek:
    Menu: System -> Server IP addresses -> Click on a Server -> HTTP NameVirtualHost
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    NameVirtualHost works perfectly fine, but it is not related to what you think it is. NameVirtualHost in Apache means that you can have multiple domains on the same IP. This is standard today and it's use is even deprecated by Apache. NameVirtualHost is used as the default by Apache for more than 10 years anyway, so it does not matter if you tick that box, Apache always uses NameVirtualHost functionality on any system, which just means you do not need a dedicated IP address for each website.

    Today, one would always use * in website IPv4 address field. Accessing a name-based virtual host is easy though even if you have not set up correct DNS records yet, you can simply use the hosts file, which exists on Windows, Linux and mac: https://www.faqforge.com/linux/serv...ess-a-namebased-website-without-a-dns-record/
     
    Outbreaker likes this.
  3. TonyG

    TonyG Active Member

    PMJI : As noted elsewhere, I'm migrating to 3.2.8 but in my existing 3.2.2 the IPv4 address cannot be set to *, and unchecking NameVirtualHost does not remove that directive from ispconfig.vhost. I trust this is all resolved in current releases and this is just for folks like me who haven't been updating. HTH
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The IP can be set to * in 3.2.2 too. This option exists for about 10 to 15 years in ISPConfig since the early 3.0 versions and works fine in any release, I use it on all of my servers.

    If you can not select * in the website, then the reason for your issue might be:

    a) You did not enable this feature under System > Server config > web > Enable IP wildcard (*)
    Newer releases have an option there, older ones have it always active).
    b) You locked the site via client protection and are not logged in as admin.
    c) There is another error in that site, like wrong settings in apache directives, which block vhost modifications for the site in general so any change gets reversed because apache fails to start otherwise.

    And as mentioned hundreds of times in the forum already, never mix * and IP on a server. Either all sites must use * or all sites must use the IP, never mix it.

    Disabling this checkbox does remove only the NameVirtualHost line for the unselected IP address, it will not remove all of them. As mentioned in my post above, it does not matter anyway as apache sets all your IP addresses to be NameVirtualHosts, no matter if the lines are there. So if the lines are there or not, it will not make any difference in the way your system works on recent Apache versions. They get just added for compatibility will ancient apache releases and do not matter or hurt on current versions.
     
  5. TonyG

    TonyG Active Member

    To be clear, the OP said "System -> Server IP addresses -> Click on a Server -> HTTP NameVirtualHost". In that field, the IP cannot be set to * on my system. In websites, yes, *, certainly.

    RE disabling the checkbox: Yeah, I know there's no difference and I don't care that it's there or why. I just said the line isn't removed. Specifically sites-available/ispconfig.vhost, NameVirtualHost:8080. TY
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not enter * there as * is a wildcard and this field is for entering an IPv4 address only. The first poster nowhere claims to enter * under "System -> Server IP addresses -> Click on a Server -> HTTP NameVirtualHost". Trying to enter the wildcard * there makes no sense at all as this is used for all kinds of things incl. network configuration on some older systems and configuring * as IPv4 address in your network card is not really useful. The field where you select * for a website is the IPv4 field in website settings and if this option is available is controlled via System > server config > web settings.
     

Share This Page