Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F81F117C9 for ; Thu, 7 Aug 2014 21:20:37 +0000 (UTC) Received: (qmail 91765 invoked by uid 500); 7 Aug 2014 21:20:29 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 91730 invoked by uid 500); 7 Aug 2014 21:20:29 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 91720 invoked by uid 99); 7 Aug 2014 21:20:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 21:20:29 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLYTO_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of spammymatt94@yahoo.com designates 98.138.120.51 as permitted sender) Received: from [98.138.120.51] (HELO nm44.bullet.mail.ne1.yahoo.com) (98.138.120.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 21:20:24 +0000 Received: from [127.0.0.1] by nm44.bullet.mail.ne1.yahoo.com with NNFMP; 07 Aug 2014 21:19:54 -0000 Received: from [98.138.101.131] by nm44.bullet.mail.ne1.yahoo.com with NNFMP; 07 Aug 2014 21:16:53 -0000 Received: from [98.139.212.152] by tm19.bullet.mail.ne1.yahoo.com with NNFMP; 07 Aug 2014 21:16:52 -0000 Received: from [98.139.212.193] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 07 Aug 2014 21:16:52 -0000 Received: from [127.0.0.1] by omp1002.mail.bf1.yahoo.com with NNFMP; 07 Aug 2014 21:16:52 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 293812.11381.bm@omp1002.mail.bf1.yahoo.com Received: (qmail 71010 invoked by uid 60001); 7 Aug 2014 21:16:52 -0000 X-YMail-OSG: ezOpzVEVM1nlgQr8QbpvTFoWhAtChfwXkKj_mEmIahUqCB. Kz7X1FJVdrzMzHlU5ZWV2JkIEejfbsb9t5bUqzzzuLarxMsOtstNJSB1uZ7z 0t4NL9q5tZJxxvsMuTJxP3nYIUEGBCd2fg_Asd2mayRN.96aAvLfmAcqmQvw qgmEDHW_PLj_aH2ZQzAhx.cNzBMNrEDxSyrDayMzynmbKPmsF9d6kc17g4Ef bDsqLoi3l2ZeylDOfoYHt8HwYRbPF9Vn4SnTB9I_svfq4BXzVtTtoQnMy4rU fnRUcNlkCz0PnQGpteEbF93Q.mR5Y_u2tmGeliAAkZ1xdN6tYKEOr7ORZ3Ej g15X5FygQQ7EPNg1kWAK91k8GJwfVbqZklGGzI3aYMku2RunXjPOqiMloV4f o_5GzccGpg1T18_zKOx3IHh6KuARX_0tlLV1X0qJ.y13seej_w1K6n7LICmc nNgT.DDXIE2UytZse21_ARljHrKL8h0Aw684uRJLc2VoMtgGuemAuCInQPsR EK4XJfQqx6n8PDqZx1lbg.JsiudVqUoMFYQwFxie04wjyzI6evFdQu5qULVg pQK0u_etDhCYTkYR7AZsdE4U7SgSkyxF215AcZYTkWRDTCCQkRsIbTQj410U Nfw-- Received: from [75.70.80.142] by web142603.mail.bf1.yahoo.com via HTTP; Thu, 07 Aug 2014 14:16:52 PDT X-Rocket-MIMEInfo: 002.001,RnJhbmssCgpJIGRvbid0IHRoaW5rIHlvdSB1bmRlcnN0b29kIHdoYXQgSSB3YXMgdHJ5aW5nIHRvIHNheS7CoCBNeSBjb21wbGFpbnQgd2FzIHRoYXQgaW4gdGhlIHByZS1wYWNrYWdlZCBjb25maWd1cmF0aW9uIG1hZGUgd2l0aCB0aGUgdWJ1bnR1IGRpc3RyaWJ1dGlvbiwgdGhlIGRlZmF1bHQgdmhvc3QgY29uZmlndXJhdGlvbiBpcyBwbGFjZWQgaW4gYSBmaWxlIHByZWZpeGVkIHdpdGggdGhlIHN0cmluZyAwMDAgd2hpY2ggY2F1c2VzIGl0IHRvIGJlIGxvYWRlZCBmaXJzdC7CoCBJIHJlbmFtZWQgaXQgdG8BMAEBAQE- X-Mailer: YahooMailWebService/0.8.198.689 References: <1407316826.25864.YahooMailNeo@web142603.mail.bf1.yahoo.com> <1407340722.45386.YahooMailNeo@web142601.mail.bf1.yahoo.com> Message-ID: <1407446212.99419.YahooMailNeo@web142603.mail.bf1.yahoo.com> Date: Thu, 7 Aug 2014 14:16:52 -0700 From: M Busche Reply-To: M Busche To: Francois Gingras , "users@httpd.apache.org" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-908725958-183223418-1407446212=:99419" X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Order of applicatoin of sites-enabled configs ---908725958-183223418-1407446212=:99419 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Frank,=0A=0AI don't think you understood what I was trying to say.=A0 My co= mplaint was that in the pre-packaged configuration made with the ubuntu dis= tribution, the default vhost configuration is placed in a file prefixed wit= h the string 000 which causes it to be loaded first.=A0 I renamed it to hav= e a prefix 999, so that it was loaded (and processed) last.=A0 I think we a= re in complete agreement.=A0 My original query was to find out whether ther= e was something I was confused about, or alternatively an explanation as to= why-on-earth the people who put together the ubuntu distribution would set= things up that way.=0A=0AMatt=0A=0A=0A=0AOn Thursday, August 7, 2014 3:40 = AM, Francois Gingras wrote:=0A =0A=0A=0A=0ABad= idea. Use the default vhost behaviour to define what vhost will=0A be u= sed for unknown hostnames not matching any ServerName /=0A ServerAlias d= irective. The default *:80 vhost must be defined first.=0A=0AYou can even u= se ServerName or ServerName in the default vho= st.=0A=0AFrank=0A=0A=0A=0A=0AOn Wed, Aug 6, 2014 at 11:58 AM, M Busche wrote:=0A=0AOoops!=A0 Somehow I missed the "in= alphabetical order" the first time I read that.=A0 Thanks for making me re= ad that again!=0A>=0A>After playing with this last night, it looks to me li= ke Apache stops as soon as it finds a virtual host with a matching ServerNa= me (or ServerAlias).=A0 In my case I have two VirtualHosts the first for my= official website name (ServerName www.mattbusche.org) and the second (my d= efault) has no ServerName entry, but uses a "ServerAlias *" to match everyt= hing else and includes a Redirect www.mattbusche.org to send all requests t= hrough such non-standard names back to the official name for my website, ww= w.mattbusche.org.=A0 In that way requests to both mattbusche.org and 75.70.= 80.142 get directed back to www.mattbusche.org.=A0 But to get it to work, I= had to rename the default config so it was named alphabetically AFTER my m= ain config.=A0 For this reason I find the choice of numbering the default c= onfig with 000 strange, since you can't number anything before that, but (a= t least in my case and I would presume in most cases) you want a default to= be chosen last.=A0=0A>=A0I was getting an infinite redirect until I rename= d the default configuration 999-default.conf.=0A>=0A>=0A>Here are my actual= working conf files:=0A>=0A>100-www.mattbusche.org.conf:=0A>=0A>=0A>=A0=A0=A0 ServerName www.mattbusche.org=0A>=A0=A0=A0 ServerAdmin= [my email address]=0A>=A0=A0=A0 DocumentRoot /var/www=0A>=A0=A0=A0 ErrorLo= g ${APACHE_LOG_DIR}/error.log=0A>=A0=A0=A0 CustomLog ${APACHE_LOG_DIR}/acce= ss.log combined=0A>=0A>=0A>=0A>999-default.conf:=0A>=0A>=0A>=A0=A0=A0 ServerAlias *=0A>=A0=A0=A0 Redirect permanent / = http://www.mattbusche.org/=0A>=0A>=0A>=0A>This is what worked= for me.=A0 Am I missing something?=A0 Or am I using the system in dark and= twisted ways that would make good church-going apache experts faint?=0A>= =0A>=0A>BTW, I haven't made this change on my live server yet -- this is al= l on my test environment -- so don't be befuddled if you don't see my live = machine redirecting as I claim here.=0A>=0A>=0A>Thanks,=0A>Matt=0A>=0A>=0A>= =0A>=0A>=0A>On Wednesday, August 6, 2014 5:08 AM, Eric Covener wrote:=0A>On Wed, Aug 6, 2014 at 5:20 AM, M Busche wrote:=0A>=0A>=0A>=0A>> Hi,=0A>> I notice that the default= virtual host configuration file name is 000-default.conf.=A0 I presume the= convention of starting virtual host configuration file names with a three = digit number governs the order in which the configurations are applied.=A0 = Can someone point me to the apache docs web page that explains this?=0A>>= =0A>=0A>This is a layout determined by whoever packaged your server and=0A>= created your default configuration. Check out their README.=A0 It just=0A>b= oils down to the Include directive:=0A>http://httpd.apache.org/docs/2.2/mod= /core.html#include=0A>=0A>-------------------------------------------------= --------------------=0A>To unsubscribe, e-mail: users-unsubscribe@httpd.apa= che.org=0A>For additional commands, e-mail: users-help@httpd.apache.org=0A>= =0A> ---908725958-183223418-1407446212=:99419 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Frank,

I= don't think you understood what I was trying to say.  My complaint wa= s that in the pre-packaged configuration made with the ubuntu distribution,= the default vhost configuration is placed in a file prefixed with the stri= ng 000 which causes it to be loaded first.  I renamed it to have a pre= fix 999, so that it was loaded (and processed) last.  I think we are in complete agreement.  My original query was to find out whether the= re was something I was confused about, or alternatively an explanation as t= o why-on-earth the people who put together the ubuntu distribution would se= t things up that way.
Matt=


On Thursday, August 7, 2014 3:40 AM, Francois Gingra= s <francois.gingras@gmail.com> wrote:



=0A Bad idea. Use the default vhost behaviour to de= fine what vhost will=0A be used for unknown hostnames not matching any S= erverName /=0A ServerAlias directive. The default *:80 vhost must be def= ined first.
=0A
=0A You can even= use ServerName <ip> or ServerName <random=0A hostname> in t= he default vhost.
=0A
=0A Frank<= br clear=3D"none">


On Wed, Aug = 6, 2014 at 11:58 AM, M Busche <spammymatt94@yahoo.com.= invalid> wrote:
=0A
Ooops!  Somehow I missed the "in alphabetical ord= er" the first time I read that.  Thanks for making me read that again!=
=0A=0A
=0AAfter playing with this last= night, it looks to me like Apache stops as soon as it finds a virtual host= with a matching ServerName (or ServerAlias).  In my case I have two V= irtualHosts the first for my official website name (ServerName www.mattbusche.org) and the second (my default) has no ServerName ent= ry, but uses a "ServerAlias *" to match everything else and includes a Redi= rect www.mattbusche.org to send all requests through such= non-standard names back to the official name for my website, www.mattbusche.org.  In that way requests to both mattb= usche.org and 75.70.80.142 get directed back to www.m= attbusche.org.  But to get it to work, I had to rename the default= config so it was named alphabetically AFTER my main config.  For this= reason I find the choice of numbering the default config with 000 strange,= since you can't number anything before that, but (at least in my case and = I would presume in most cases) you want a default to be chosen last. <= br clear=3D"none">=0A=0A I was getting an infinite redirect until I re= named the default configuration 999-default.conf.
=0A
=0A
=0AHere are my actual working conf fil= es:
=0A
=0A100-www.mattbusche.org.conf:=
=0A
=0A<VirtualHost *:80>
=0A    ServerName www.mattbusche.o= rg
=0A    ServerAdmin [my email addres= s]
=0A    DocumentRoot /var/www
=0A    ErrorLog ${APACHE_LOG_DIR}/error.log
=0A    CustomLog ${APACHE_LOG_DIR}/access.log co= mbined
=0A</VirtualHost>
=0A
=0A
=0A999-default.conf:
= =0A
=0A<VirtualHost *:80>
=0A&nbs= p;   ServerAlias *
=0A    Redire= ct permanent / http://www.mattbusche.org/
=0A</VirtualHost>
=0A
=0A
=0AThis is what worked for me.  Am I missing something?&= nbsp; Or am I using the system in dark and twisted ways that would make goo= d church-going apache experts faint?
=0A
=0A
=0ABTW, I haven't made this change on my live serve= r yet -- this is all on my test environment -- so don't be befuddled if you= don't see my live machine redirecting as I claim here.
= =0A
=0A
=0AThanks,
= =0AMatt
=0A

=0A
=0A
=0A
=0AOn Wednesday, August 6, 2014 5:08 AM, Er= ic Covener <covener@gma= il.com> wrote:
=0AOn Wed, Aug 6, 2014 at 5:20 AM, = M Busche <spammymatt94@yahoo.com.invalid> wrote:
= =0A
=0A
=0A
=0A> H= i,
=0A> I notice that the default virtual host configu= ration file name is 000-default.conf.  I presume the convention of sta= rting virtual host configuration file names with a three digit number gover= ns the order in which the configurations are applied.  Can someone poi= nt me to the apache docs web page that explains this?
=0A= =0A>
=0A
=0AThis is a layout determi= ned by whoever packaged your server and
=0Acreated your d= efault configuration. Check out their README.  It just
=0Aboils down to the Include directive:
=0Ahttp://httpd.apache.org/docs/2.2/mod/core.ht= ml#include
=0A
=0A-----------------= ----------------------------------------------------
=0AT= o unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
=0AFor additional commands, e-mail: users-help@httpd.apache.org=
=0A
=0A
=


<= /div>
---908725958-183223418-1407446212=:99419--