Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 43173 invoked from network); 11 Sep 2008 09:25:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 09:25:59 -0000 Received: (qmail 71371 invoked by uid 500); 11 Sep 2008 09:25:43 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 71352 invoked by uid 500); 11 Sep 2008 09:25:43 -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 71341 invoked by uid 99); 11 Sep 2008 09:25:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 02:25:43 -0700 X-ASF-Spam-Status: No, hits=3.3 required=10.0 tests=PLING_QUERY,SPF_PASS,URIBL_BLACK X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [212.85.38.174] (HELO popeye.combios.es) (212.85.38.174) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 09:24:44 +0000 Received: from [192.168.250.51] (p549EA485.dip0.t-ipconnect.de [84.158.164.133]) (authenticated bits=0) by popeye.combios.es (8.13.8/8.13.8/Debian-3) with ESMTP id m8B9L2wp031595; Thu, 11 Sep 2008 11:21:03 +0200 Message-ID: <48C8E2A6.6080502@ice-sa.com> Date: Thu, 11 Sep 2008 11:19:34 +0200 From: =?ISO-8859-1?Q?Andr=E9_Warnier?= User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: users@httpd.apache.org CC: Debian User List References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on popeye.combios.es X-Virus-Scanned: ClamAV 0.92.1/8214/Thu Sep 11 02:32:22 2008 on popeye.combios.es X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-94.6 required=2.5 tests=PLING_QUERY,RCVD_IN_PBL, RCVD_IN_SORBS_DUL,URIBL_BLACK,USER_IN_WHITELIST autolearn=no version=3.2.3 Subject: Re: [users@httpd] Re: cgi-bin stopped working in apache ?! please help SOLVED Zach Uram wrote: > On Tue, Sep 9, 2008 at 3:54 PM, Andr� Warnier wrote: >> Just a guess : >> >> 1) the new entry you have added to /etc/apache2/sites-available (and >> sites-enabled) is called e.g. "darcs", which for some reason precedes >> "default" in the directory. >> 2) in the apache.conf, there is something like >> Include /etc/apache2/sites-enabled/* >> 3) so now, when Apache starts, it "includes" the configuration of your new >> Virtual Host *before* it includes the "default" Virtual Host. >> 4) as a result, the default virtual host is no longer "default", but >> "darcs", and nothing works anymore like before. >> (It is the new default because it is now the first defined virtual host in >> your setup) >> >> >> Check : >> rename /etc/apache2/sites-available/darcs to >> /etc/apache2/sites-available/xxx (and the same for sites-enabled), and >> restart Apache. Does it work again ? >> >> Am I close ? >> >> Andr� > > Hi Andr�, > > I figured it out before I read your message but yes that seems to be > what happened. I have removed the other terms from > /etc/apache2/sites-available/darcs in ServerAlias so it now has: > > > ServerName darcs.jesujuva.org > ServerAlias darcs.jesujuva.org > DocumentRoot /var/www/darcs > > > I restarted apache and it works. Someone had recommended I add those > terms to ServerAlias and that is what screwed me up. This was the > first time I setup a virtual host so I must be careful what *advice* I > apply :-) BTW by ServerName it is the subdomain (ie. > http://darcs.jesujuva.org) and then what is the difference exactly > between that and ServerAlias? > In your above configuration, the ServerAlias is totally unnecessary, since it is the same as the ServerName. You would only need ServerAlias if that same virtual server could/should be accessed using different (valid DNS) hostnames, like ServerName darcs.jesujuva.org ServerAlias www.darcs-jesujuva.org ServerAlias www1.jesujuva.org etc.. (all of these names in DNS pointing to the same IP address of your server). Apart from the related tip from Kris about the various virtual server config files in /etc/apache2/sites-available and /etc/apache2/sites-enabled, here is what I do to insure that virtual servers are "included" in the correct order : # Include the "Generic" site definitions Include /etc/apache2/sites-enabled/.Generic NameVirtualHost *:80 # Include the "default server" site definitions Include /etc/apache2/sites-enabled/.default # Include the virtual host configurations: Include /etc/apache2/sites-enabled/[^.#]* The first 2 includes each include a specific file, which I name with a starting dot (.) (To make sure of the order in which those files are included) The final include then includes all the other files (through links in /etc/apache2/sites-enabled/), whose names do not start with a dot (because usually, apart from the default server, it does not matter in which order the virtual hosts are defined). Since you are new to Virtual Hosts, let me give you some more information/tips : 1) Everything you put in the Apache configuration file prior to the "NameVirtualHost" line, are parameters that act as default values for *all* your Virtual Hosts (including the default Virtual Host). So whenever a Virtual Host "needs" a parameter value, and it is not explicitly defined in his own section, it will use the default parameter value as defined before the "NameVirtualHost" line. After the "NameVirtualHost" line, what you define is individual "personalities" of your webserver, one personality per section. Any configuration parameter defined there, overrides the default specified in the main section above. 2) A VirtualHost is not a separate webserver. All Apache "children" are identical, and are able to "take the personality" of any of the Virtual Hosts, depending on the request that comes in. When a request comes in, it is always first given to the "main" Apache process. That one looks which "Apache child" is currently available, and passes the request to that one for processing. The "main" Apache process does not handle requests. It just gets all the requests, and passes them to children for processing. It also is the one who decides how many children run, when to start or kill one, etc.. The selected Apache child then looks at the "Host:" header line of the request to see to which VirtualHost the request "wants to talk", and it then "takes the personality" of that specific VirtualHost to process the request. If the child does not find a "Host:" line, or if the name given in the "Host:" line does not match any of the ServerName or ServerAlias directives in any of the sections, then the child takes the personality of the default VirtualHost to answer the request. The default VirtualHost has nothing special, it just happens to be the first section that Apache encounters when it loads its configuration file. I just felt like telling you the above because I have the impression that a misunderstanding of the above is the source of 90% of the problems encountered by people unfamiliar with Virtual Hosting in general. I hope it helps you. Andr� --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org