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 6A76710738 for ; Wed, 4 Dec 2013 08:07:44 +0000 (UTC) Received: (qmail 95537 invoked by uid 500); 4 Dec 2013 08:07:39 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 95048 invoked by uid 500); 4 Dec 2013 08:07:34 -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 95038 invoked by uid 99); 4 Dec 2013 08:07:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 08:07:33 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.128.178] (HELO mail-ve0-f178.google.com) (209.85.128.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 08:07:26 +0000 Received: by mail-ve0-f178.google.com with SMTP id c14so11902879vea.9 for ; Wed, 04 Dec 2013 00:07:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=oV3X8JJW4D6N35kQExn9gFzRQYHb3Z1Wa/8yAcB42Cc=; b=OYhK7Dj+jX0sPkdcrWYcCO1fW0UvYoJQUo1OqhlEzdPtuXGH09+pBRvuKAJ/fx1n1W klVFf1y9raZSSisYTirgrH4KGGyw0tdYMGQk4vwujnaXgwBcRTrXi05eIm5Xg9qA2EAm 3uCAdCEqP2wEtOhBj4gjsyqw2Hn2nYckpfF4gYSTki102dkrFO3PR3pdXzPE3XJcjBO7 JmU5OZNg74bkiq7KP3LIjKwH9gokPGdiVrZSsDJEiXoND8LCau+F3vqxGQ8N9NlDG57g CjP1ZqrJ9CkumiSh3l+HUAzH4h49AOPOX5pPciZWDjOnpcm/VcEHdZJs0sy5lzkJTmYZ c2KQ== X-Gm-Message-State: ALoCoQn9qF8jxWRsef02AZpwBJ/xhGcNFsA00qTQLJV23q73IUGBqmgZ36XLU5qlqNTlVoyVAGqN MIME-Version: 1.0 X-Received: by 10.220.11.7 with SMTP id r7mr59133888vcr.12.1386144425177; Wed, 04 Dec 2013 00:07:05 -0800 (PST) Received: by 10.220.167.68 with HTTP; Wed, 4 Dec 2013 00:07:05 -0800 (PST) Date: Wed, 4 Dec 2013 09:07:05 +0100 Message-ID: From: Niels Rymenams To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=001a11c3e47c12847a04ecb0e6a1 X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Configure 2 virtuals hosts: 1 for a specific subdomain and 1 for as a catch-all --001a11c3e47c12847a04ecb0e6a1 Content-Type: text/plain; charset=ISO-8859-1 Hi, I'm sorry for the n00b question, but this is the first time that I need to configure Apache myself and I can't seem to get my configuration right. I want to set up a webserver hosting a site (/home/user/www/website) under a subdomain: website.example.org Although I want to catch all other requests to the webserver on the domain and/or subdomains: example.org, host.example.org, www.example.org, ... I have a default Ubuntu 12.10 installation and have copied the default configuration in /etc/apache2/sites-available to user-site. I modified both (only the first few lines defining the ServerName/ServerAlias and DocumentRoot) using the Apache documentation. [Configurations are below this e-mail] When surfing to www.example.org I see the catch-all website, but any other subdomain goes to the main website. Any suggestions on what I'm doing wrong? Kind regards, Niels R. ------ This is the default configuration (acting as the catch-all): ServerAdmin webmaster@example.org ServerName www.example.org ServerAlias example.org *.example.org DocumentRoot /var/www Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 ------ This is the user-site configuration: ServerAdmin website@example.org ServerName website.example.org DocumentRoot /home/user/www/website Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 --001a11c3e47c12847a04ecb0e6a1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

I'm sorry for the n00b question= , but this is the first time that I need to configure Apache myself and I c= an't seem to get my configuration right.

I wan= t to set up a webserver hosting a site (/home/user/www/website) under a sub= domain: website.example.org
Although I want to catch all other requests to the webserver on the do= main and/or subdomains: example.org, host.example.org, www.example.org, ...

I have a default Ubuntu 12.10 installation and have cop= ied the default configuration in /etc/apache2/sites-available to user-site.= I modified both (only the first few lines defining the ServerName/ServerAl= ias and DocumentRoot) using the Apache documentation.
[Configurations are below this e-mail]

When s= urfing to www.example.org I see the = catch-all website, but any other subdomain goes to the main website.

Any suggestions on what I'm doing wrong?
=
Kind regards,
Niels R.

--= ----

This is the default configuration (acting as = the catch-all):

<VirtualHost *:80>
=A0 =A0 =A0 =A0= ServerAdmin webmaster@example.org=
=A0 =A0 =A0 =A0 ServerName www.example.org
=A0 =A0 =A0 =A0 ServerAlias=A0example.o= rg=A0*.example.org

=A0 =A0 =A0 =A0 DocumentRoot /var/www
=A0 =A0 =A0 =A0 <= ;Directory />
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Options FollowSy= mLinks
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 AllowOverride None
=A0 =A0 = =A0 =A0 </Directory>
=A0 =A0 =A0 =A0 <Directory /var/www= />
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Options Indexes FollowSymLi= nks MultiViews
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 AllowOverride None=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Order allow,deny
=A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 allow from all
=A0 =A0 =A0 =A0 </Director= y>

=A0 =A0 =A0 =A0 ScriptAlias /cgi-bin/ /usr/l= ib/cgi-bin/
=A0 =A0 =A0 =A0 <Directory "/usr/lib/cgi-bin&= quot;>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 AllowOverride None
=A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<= /div>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Order allow,deny
=A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 Allow from all
=A0 =A0 =A0 =A0 </D= irectory>

=A0 =A0 =A0 =A0 ErrorLog ${APACHE_LOG_DIR}/error.log

=A0 =A0 =A0 =A0 # Possible values include: debug, in= fo, notice, warn, error, crit,
=A0 =A0 =A0 =A0 # alert, emerg.
=A0 =A0 =A0 =A0 LogLevel warn

=A0 =A0 =A0 =A0 CustomLog ${APACHE_LOG_DIR}/access.log = combined

=A0 =A0 Alias /doc/ "/usr/share/doc/= "
=A0 =A0 <Directory "/usr/share/doc/">
=A0 =A0 =A0 =A0 Options Indexes MultiViews FollowSymLinks
=A0 =A0 =A0 =A0 AllowOverride None
=A0 =A0 =A0 =A0 Order den= y,allow
=A0 =A0 =A0 =A0 Deny from all
=A0 =A0 =A0 =A0 A= llow from 127.0.0.0/255.0.0.0 ::= 1/128
=A0 =A0 </Directory>

</VirtualHost>

---= ---

This is the user-site configuration:

<VirtualHost *:80>
=A0 =A0 =A0 =A0 Ser= verAdmin=A0website@example.org
=A0 =A0 =A0 =A0 ServerName=A0we= bsite.example.org

=A0 =A0 =A0 =A0 DocumentRoot= /home/user/www/website
=A0 =A0 =A0 =A0 <Directory />
=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Options FollowSymLinks
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 AllowOverride None
=A0 =A0 = =A0 =A0 </Directory>
=A0 =A0 =A0 =A0 <Directory /home/ni= els/www/forum>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Options Indexes= FollowSymLinks MultiViews
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 AllowO= verride None
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Order allow,deny
=A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 allow from all
=A0 =A0 =A0 =A0 </Director= y>

=A0 =A0 =A0 =A0 ScriptAlias /cgi-bin/ /usr/l= ib/cgi-bin/
=A0 =A0 =A0 =A0 <Directory "/usr/lib/cgi-bin&= quot;>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 AllowOverride None
=A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<= /div>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Order allow,deny
=A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 Allow from all
=A0 =A0 =A0 =A0 </D= irectory>

=A0 =A0 =A0 =A0 ErrorLog ${APACHE_LOG_DIR}/error.log

=A0 =A0 =A0 =A0 # Possible values include: debug, in= fo, notice, warn, error, crit,
=A0 =A0 =A0 =A0 # alert, emerg.
=A0 =A0 =A0 =A0 LogLevel warn

=A0 =A0 =A0 =A0 CustomLog ${APACHE_LOG_DIR}/access.log = combined

=A0 =A0 Alias /doc/ "/usr/share/doc/= "
=A0 =A0 <Directory "/usr/share/doc/">
=A0 =A0 =A0 =A0 Options Indexes MultiViews FollowSymLinks
=A0 =A0 =A0 =A0 AllowOverride None
=A0 =A0 =A0 =A0 Order den= y,allow
=A0 =A0 =A0 =A0 Deny from all
=A0 =A0 =A0 =A0 A= llow from 127.0.0.0/255.0.0.0 ::= 1/128
=A0 =A0 </Directory>

</VirtualHost>

--001a11c3e47c12847a04ecb0e6a1--