Received: (qmail 27973 invoked by uid 501); 16 Oct 2000 14:53:35 -0000 Message-Id: <20001016145335.27972.qmail@locus.apache.org> Date: 16 Oct 2000 14:53:35 -0000 From: Michael Long Reply-To: mlong@infoave.net To: submit@bugz.apache.org Subject: Modify http://www.apache.org/docs/vhosts/examples.html to deal with port-based name virtualhosts X-Send-Pr-Version: 3.110 >Number: 6697 >Category: documentation >Synopsis: Modify http://www.apache.org/docs/vhosts/examples.html to deal with port-based name virtualhosts >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: apache >Arrival-Date: Mon Oct 16 08:00:09 PDT 2000 >Closed-Date: Thu Oct 19 11:59:38 PDT 2000 >Last-Modified: Thu Oct 19 11:59:38 PDT 2000 >Originator: mlong@infoave.net >Release: 1.3.14 >Organization: >Environment: all >Description: Modify http://www.apache.org/docs/vhosts/examples.html Add example for doing name-based virtual hosting with multiple ports since this isn't very intuitive. (ie If you don't define the ports with NameVirtualHost it won't work) NameVirtualHost 1.2.3.4:80 NameVirtualHost 1.2.3.4:8080 ServerName www.site1.com DocumentRoot /web/https-site1/ ServerName www.site1.com DocumentRoot /web/https-site1-8080/ ServerName www.site2.com DocumentRoot /web/https-site2/ ServerName www.site2.com DocumentRoot /web/https-site2-8080/ >How-To-Repeat: This solves issue in PR#6695 >Fix: Incorporate documentation change >Release-Note: >Audit-Trail: State-Changed-From-To: open-feedback State-Changed-By: fanf State-Changed-When: Thu Oct 19 02:05:20 PDT 2000 State-Changed-Why: Yes, this is a good suggestion, thanks! We'll add it to the documentation if you write a complete entry like the others in vhosts/examples.html and provide us with a diff. From: Michael Long To: fanf@apache.org Cc: apbugs@apache.org Subject: Re: documentation/6697: Modify http://www.apache.org/docs/vhosts/examples.html to deal with port-based name virtualhosts Date: Thu, 19 Oct 2000 08:19:31 -0400 Well I can honestly say this is the first time anyone has asked me to create a patch for a web page. But anyway here it is: *** temp.html Thu Oct 19 08:04:17 2000 --- temp.html.new Thu Oct 19 08:09:26 2000 *************** *** 3,9 **** VirtualHost Examples ! VirtualHost Examples !
  • Using _default_ vhosts !
  • Migrating a named-based vhost to an IP-based vhost
  • Using the ServerPath directive --- 36,43 ---- *************** *** 51,57 ****
  • Setup: The server machine has a primary name server.domain.tld. There are two aliases (CNAMEs) www.domain.tld and ! www.sub.domain.tld for the address server.domain.tld.

    Server configuration: --- 53,60 ----

  • Setup: The server machine has a primary name server.domain.tld. There are two aliases (CNAMEs) www.domain.tld and ! www.sub.domain.tld for the address ! server.domain.tld.

    Server configuration: *************** *** 93,99 **** The server machine has one IP address (111.22.33.44) which resolves to the name server.domain.tld. There are two aliases (CNAMEs) www.domain.tld and ! www.sub.domain.tld for the address 111.22.33.44.

    Server configuration: --- 96,103 ---- The server machine has one IP address (111.22.33.44) which resolves to the name server.domain.tld. There are two aliases (CNAMEs) www.domain.tld and ! www.sub.domain.tld for the address ! 111.22.33.44.

    Server configuration: *************** *** 179,185 **** address (192.168.1.1).

    The server can be made to respond to internal and external ! requests with the same content, with just one VirtualHost section.

    --- 183,190 ---- address (192.168.1.1).

    The server can be made to respond to internal and external ! requests with the same content, with just one ! VirtualHost section.

    *************** *** 201,206 **** --- 206,250 ---- Now requests from both networks will be served from the same VirtualHost + +

  • Setup 4: + You have multiple domains going to the same IP and also want + to serve multiple ports. This isn't very intuitive as most + "guesses" at configuring this will result in the non-standard + ports going back to the first virtualhost. By defining the + ports in the "NameVirtualHost" tag, you can allow this to + work. If you try using without the + NameVirtualHost name:port or you try to use the Port + directive, your configuration will not work. + +

    Server configuration: + +

     +     ...
     +     NameVirtualHost 1.2.3.4:80
     +     NameVirtualHost 1.2.3.4:8080
     +
     +    
     +     ServerName www.site1.com
     +     DocumentRoot /web/https-site1/
     +    
     +
     +    
     +     ServerName www.site1.com
     +     DocumentRoot /web/https-site1-8080/
     +    
     +
     +    
     +     ServerName www.site2.com
     +     DocumentRoot /web/https-site2/
     +    
     +
     +     
     +      ServerName www.site2.com
     +      DocumentRoot /web/https-site2-8080/
     +     
     +     
    +
    *************** *** 306,314 **** </VirtualHost> The main server can never catch a request, because all IP addresses ! (apart from localhost) of our machine are in use for IP-based virtual hosts. The web server can only be reached on the first address ! through port 80 and the proxy only on the second address through port 8080. --- 350,360 ---- </VirtualHost> The main server can never catch a request, because all IP addresses ! (apart from localhost) of our machine are in use for ! IP-based virtual hosts. The web server can only be reached on the first address ! through port 80 and the proxy only on the second address through port ! 8080. *************** *** 322,328 **** The server machine has three IP addresses (111.22.33.44, 111.22.33.55 and 111.22.33.66) which resolve to the names server.domain.tld, ! www.otherdomain1.tld and www.otherdomain2.tld respectively. The address 111.22.33.44 should we used for a couple of name-based vhosts and the other addresses for IP-based vhosts. --- 368,375 ---- The server machine has three IP addresses (111.22.33.44, 111.22.33.55 and 111.22.33.66) which resolve to the names server.domain.tld, ! www.otherdomain1.tld and ! www.otherdomain2.tld respectively. The address 111.22.33.44 should we used for a couple of name-based vhosts and the other addresses for IP-based vhosts. *************** *** 409,416 ****
    • Setup 1: ! Catching every request to any unspecified IP address and port, ! i.e., an address/port combination that is not used for any other virtual host.

      Server configuration: --- 456,465 ----

      • Setup 1: ! Catching every request to any unspecified IP address and ! port, ! i.e., an address/port combination that is not used for any ! other virtual host.

        Server configuration: *************** *** 433,439 **** You can use AliasMatch or ! RewriteRule to rewrite any request to a single information page (or script).

        --- 482,489 ---- You can use AliasMatch or ! RewriteRule to rewrite any request to a single information page (or script).

        *************** *** 464,470 ****

      • Setup 3: ! We want to have a default vhost for port 80, but no other default vhosts.

        Server configuration: --- 514,521 ----

      • Setup 3: ! We want to have a default vhost for port 80, but no other default ! vhosts.

        Server configuration: *************** *** 484,496 ****


        !

        Migrating a name-based vhost to an IP-based vhost

        • Setup: The name-based vhost with the hostname ! www.otherdomain.tld (from our name-based example, setup 2) should get its own IP address. To avoid problems with name servers or proxies who cached the old IP address for the name-based vhost we want to provide both variants --- 535,549 ----
          !

          Migrating a name-based vhost to an IP-based ! vhost

          • Setup: The name-based vhost with the hostname ! www.otherdomain.tld (from our name-based example, setup 2) should get its own IP address. To avoid problems with name servers or proxies who cached the old IP address for the name-based vhost we want to provide both variants *************** *** 529,540 ****
            !

            Using the ServerPath directive

            • Setup: ! We have a server with two name-based vhosts. In order to match the correct virtual host a client must send the correct Host: header. Old HTTP/1.0 clients do not send such a header and Apache has no clue what vhost the client tried to reach (and serves the request from --- 582,595 ----
              !

              Using the ServerPath ! directive

              • Setup: ! We have a server with two name-based vhosts. In order to match the ! correct virtual host a client must send the correct Host: header. Old HTTP/1.0 clients do not send such a header and Apache has no clue what vhost the client tried to reach (and serves the request from *************** *** 574,580 **** ... </VirtualHost> ! Due to the ServerPath directive a request to the URL http://www.sub1.domain.tld/sub1/ is always served from the sub1-vhost.
                --- 629,636 ---- ... </VirtualHost> ! Due to the ServerPath directive a request to the URL http://www.sub1.domain.tld/sub1/ is always served from the sub1-vhost.
                --On Thursday, October 19, 2000 9:05 AM +0000 fanf@apache.org wrote: > [In order for any reply to be added to the PR database, you need] > [to include in the Cc line and make sure the] > [subject line starts with the report component and number, with ] > [or without any 'Re:' prefixes (such as "general/1098:" or ] > ["Re: general/1098:"). If the subject doesn't match this ] > [pattern, your message will be misfiled and ignored. The ] > ["apbugs" address is not added to the Cc line of messages from ] > [the database automatically because of the potential for mail ] > [loops. If you do not include this Cc, your reply may be ig- ] > [nored unless you are responding to an explicit request from a ] > [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ] > > > Synopsis: Modify http://www.apache.org/docs/vhosts/examples.html to deal > with port-based name virtualhosts > > State-Changed-From-To: open-feedback > State-Changed-By: fanf > State-Changed-When: Thu Oct 19 02:05:20 PDT 2000 > State-Changed-Why: > Yes, this is a good suggestion, thanks! We'll add it > > to the documentation if you write a complete entry like > > the others in vhosts/examples.html and provide us with a > > diff. > > > Michael Long Senior Systems Analyst Info Avenue Internet Services, LLC State-Changed-From-To: feedback-closed State-Changed-By: fanf State-Changed-When: Thu Oct 19 11:59:37 PDT 2000 State-Changed-Why: Committed (with minor modifications). Thanks! >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]