Menu

#3978 break the default apache ports.conf

1.560
open
5
2011-08-25
2011-08-25
Anonymous
No

Adding two virtual servers (one listening on port 80 and the other on 443 of a specific address) seems to break the default apache ports.conf file and generates errors in the apache log.

OS = Ubuntu 10.04.3

My goal is to have apache listen on a specific address for a particular website (http & https).

Attached file has copies of files and errors.

Discussion

  • Jamie Cameron

    Jamie Cameron - 2011-08-25

    I think that is just a warning - the apache config you attached should work just fine.

    Is Apache not serving the correct web content?

     
  • Corey Boyle

    Corey Boyle - 2011-08-25

    No, only the first virtual server (port 80) will work. If I comment out the "#NameVirtualHost *:80
    #NameVirtualHost 192.168.76.31" lines, both begin to work and the errors go away.

    # If you just change the port or add more ports here, you will likely also
    # have to change the VirtualHost statement in
    # /etc/apache2/sites-enabled/000-default
    # This is also true if you have upgraded from before 2.2.9-3 (i.e. from
    # Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
    # README.Debian.gz

    #NameVirtualHost *:80
    #NameVirtualHost 192.168.76.31
    Listen 80

    <IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
    </IfModule>

    <IfModule mod_gnutls.c>
    Listen 443
    </IfModule>

     
  • Corey Boyle

    Corey Boyle - 2011-08-25

    Could it have something to do with the "Add name virtual server address (if needed)" option when adding a new virtual server. It was checked by default, so I left it checked.

    Is that why it's putting "NameVirtualHost *:80" & "NameVirtualHost 192.168.76.31" in the ports.conf file?

     
  • Jamie Cameron

    Jamie Cameron - 2011-08-26

    Yes, the NameVirtualHost line will be added when you check that box..

     
  • Corey Boyle

    Corey Boyle - 2011-08-28

    just added a new host, and it added that line to the /etc/apache2/apache2.conf this time

    perhaps that box should not be checked by default?

     
  • Jamie Cameron

    Jamie Cameron - 2011-08-28

    It depends on your intention .. if you really want to have multiple name-based sites on the same IP, a NameVirtualHost directive needs to be added.

    If you are primarily interested in web hosting, you may also want to look at Virtualmin, which is a Webmin add-on that knows more about each domain and so is smarter about adding the NameVirtualHost directive.

     

Log in to post a comment.