quote("ashley maher");
>I'm basing the setup on a config file I've used for apache 1.3 from an
>old server that has run for years.

BAD BAD BAD

>Ubuntu being debian based uses a file for each virtual host.

Yeah, and being Debian, the main concept of configuration is magic!

Everything you need to doodle around with is under
/etc/apache2/sites-available.

There you have a default file, keep that for whatever you want the
default to be. When you want to add a vhost, copy default to the same
directory, with a more rad name (like "awesome.example.org").

When you copy it, edit the new file to remove the first line (which will
be something like "NameVirtualHost *") -- this line tells Apache2 about
your little virtual hosting shenanigans, and you've already informed it
in the default file. Apache2 gets impatient being told things twice.

From there on it's the typical virtual hosts thang, you pop in
"ServerName awesome.example.org" to let it know what requests can get at
the loot, and bits like "ServerAlias www.awesome.example.org" for
whatever other hostnames can request it. These fit in between the
<VirtualHost> tags, of course.

No magic would be complete with static configs.. so to enable/disable
site configs you use a2ensite/a2dissite.

Assuming I named my file awesome.example.org, I would enable it's config
by using "a2ensite awesome.example.org" followed by a swift reload of
apache2 (/etc/init.d/apache2 reload). Same deal with a2dissite to
disable it's config.

 -Chris.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to