[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Apache config



Steve Tickle <steve.tickle [at] softhome.net> writes:

> Morning all,
>
> I now have access to a Debian box (3.0r1) which is destined to be a
> webserver. I've never meddled too much with apache in the past so we
> could be in for some fun here. Currently, I'm exploring what needs to
> be done to set up sub-domains eg something.domain.com,
> somethingelse.domain.com.

Apache 1.3 or 2.0?

In any case, you're looking for the "Virtual Host" directives.

Something like:

<VirtualHost *>
        ServerName something.domain.com
         
        DocumentRoot /var/www/something.domain.com/
        ....
</VirtualHost>

<VirtualHost *>
        ServerName somethingelse.domain.com
         
        DocumentRoot /var/www/somethingelse.domain.com/
        ....
</VirtualHost>

(Debian's apache2 configuration splits the separate virtual hosts into
their own files, I suspect other distributions do as well)

> To date, I haven't discovered any coverage of this in the apache docs
> so I would appreciate it if someone could point me in the right
> direction.
> I'm also a bit of a numpty when it comes to DNS matters, so what would
> be necessary (if anything) to ensure requests for *.domain.com get to
> the right place.

You're doing your own DNS?

When you register your domain name, you'll have to provide addresses
of (at least) two DNS servers.  Make sure those point to your
primary/secondary DNS.  There's a number of places that provide free
secondary DNS, (if you don't have a second server) I use twisted4life:

http://www.twisted4life.com/index.php

Setting up DNS is a little...  weird.  Probably I'd suggest using
BIND9 (yeah yeah yeah, Bind has more security flaws, but it's no
longer the stinking cesspit of security failures it once was, and is
easier to use/more flexible than most others).

You'll want to add to /etc/bind/named.conf.local something like:

  zone "domain.com" {
          type master;
          allow-query { any; };
 
          file "/etc/bind/db.domain";
  };

and then create a "zone file" for domain.com and put it in
/etc/bind/db.domain, with data something like:

$TTL 43200
@       IN      SOA     ns.domain.com. hostmaster.domain.com. (
                        2003060601 ; serial
                        8H        ; refresh (seconds)
                        2H        ; retry (seconds)
                        4W        ; expire
                        1D )      ;minimum
                NS      ns
                NS      ns1.twisted4life.com.
                MX      10 ns
ns              A       xxx.xxx.xxx.xxx
www             CNAME   ns
somethingelse   CNAME   ns

(Really, you should read the docs, but hey :)



-- 
Eric E. Moore

Attachment: pgp00001.pgp
Description: PGP signature