Gentoo Archives: gentoo-dev

From: "Robin H.Johnson" <robbat2@g.o>
To: gentoo-dev@g.o
Cc: Stuart Herbert <stuart@g.o>, Donny Davies <woodchip@g.o>
Subject: Re: [gentoo-dev] [GLEP] Web Application Installation. Plotting a VHOST config tool.
Date: Wed, 06 Aug 2003 04:37:45
In Reply to: Re: [gentoo-dev] [GLEP] Web Application Installation by Stuart Herbert
1 On Wed, Aug 06, 2003 at 03:44:44AM +0100, Stuart Herbert wrote:
2 Content-Description: signed data
3 > On Wednesday 06 August 2003 3:16 am, Robin H.Johnson wrote:
4 > > Where do you see -vhosts fiting into having multiple instances of a
5 > > webapp on a single host ?
6 >
7 > Personally, I don't. If you want multiple instances of a webapp on a single
8 > host, the webapps need to be installed with +vhosts.
9 >
10 > -vhosts would be strictly single copy single domain scenario.
11 Ok, so if -vhosts, we install to /usr/share/webapp/(whatever) and
12 automatically run the webapp-config tool ?
14 if +vhosts, we install to /usr/share/webapp/(whatever) and the
15 administrator is left to run the rest himself.
17 > > > Btw, talked to Woodchip on IRC tonight, and he seemed happy enough
18 > > > with us moving the default -vhosts DocRoot from /home/httpd. So I'm
19 > > > gonna strongly advocate that the default -vhosts DocRoot moves to
20 > > > /var/www/localhost/public_html in the near future.
21 > > Sounds good.
22 As part of the planning, and a good first step
23 I'm plotting out a config tool for adding vhosts. All comments welcome
24 as this is intended to be a good outline of what the tool must do etc
25 before I write it (borrowing heavily from my exist custom scripts for
26 the purpose).
28 Stuart: once before you asked why I didn't use dynamic vhosts.
29 Two reasons behind it. Firstly, I want seperate log files for each
30 vhost, and secondly I have a lot of apache configuration directives that
31 vary per server (funky mod_rewrite stuff mainly to make variable
32 handling in php interesting). Based on this, I strongly believe that
33 'simple' vhosts are the best way to go in general.
35 Looking at the current /home/httpd:
36 We have:
37 htdocs cgi-bin error icon
39 All of these can go into the the /var/www/localhost/ quite easily.
41 /var/www/<vhost>/{error,icon} symlink back to the default host usually
42 (anybody wanting to use them changes them as needed).
44 I feel the name 'htdocs' belies the meaning of the directory more
45 accurately, but I'm looking for input on that item.
47 In my personal setup, I have:
48 /etc/apache2/conf/vhosts/${FQDN#*.}/${FQDN}
49 /var/www/${FQDN#*.}/${FQDN}/{htdocs,cgi-bin}
50 /var/log/apache2/${FQDN#*.}/${FQDN}/
51 Then I do:
52 "include /etc/apache2/conf/vhosts/" in my main apache config :-).
54 But I don't think we really need a hashed setup do we? make it a config
55 option because I don't know who will want it.
57 Rough outline of tool:
59 vhost-config must do three things:
60 - creates directories (copies a skeleton directory for the most part).
61 - create apache vhost config files.
62 - HUP apache so it reads in the new config without stopping.
64 Proposed rough usage:
65 vhost-config [opts]
67 opts:
68 -s server
69 which server to use this with, defaults to apache, mostly a moot point
70 until more virtual/httpd exists.
71 -u owner
72 user owner of all files, defaults root for security.
73 -g group
74 group owner of all files, defaults to root for security.
75 -p perms
76 initial permissions, defaults to 644 (OR'd with 111 for directories).
77 -G
78 shortcut for having group writable permissions (effective does OR 020).
79 -i
80 symlink /var/www/localhost/icons to provide icons. (default)
81 -I [dir]
82 copies /var/www/localhost/icons to a new directory. Optionally provides
83 a different directory to take them from.
84 -e
85 symlink /var/www/localhost/error to provide error pages. (default)
86 -E [dir]
87 copies /var/www/localhost/error to a new directory. Optionally provides
88 a different directory to take them from.
89 -k directory
90 specify a different skeleton directory (defaults to /etc/vhost-skel/)
91 -H
92 HUP apache on completion if everything is good to go.
93 -h
94 don't HUP apache at all.
95 -f file
96 path to alternative config file (default is /etc/vhost-config.conf).
98 /etc/vhost-skel/ might contain:
99 htdocs/ = maybe a simple index.html ?
100 cgi-bin/ = empty
101 icons/ = symlink to /var/www/localhost/icons
102 error/ = symlink to /var/www/localhost/error
103 conf/ = [treated specially] ${server}.conf that is used for creating the initial config,
104 templates of some sort (I'm leaning to M4 as all my existing stuff is in
105 it, and it's good for templating like this).
107 After vhost-config has generated all of the nessicary stuff, it should
108 HUP the apache server if everything is in order.
110 There is one check that is outside the scope of the tool, namely the
111 existance of DNS for the specified hostname. If the admin creates a
112 vhost that does not yet have DNS or name resolution relative to the
113 system, we should display a warning.
115 I'd repeat again for good measure, this email is strongly based off the
116 present capabilites of my private vhost setup scripts, plus the features
117 I as a developer, sysadmin and user want in a new revision. However I
118 strongly feel that more input is needed as well.
120 --
121 Robin Hugh Johnson
122 E-Mail : robbat2@××××××××××××××.net
123 Home Page :
124 ICQ# : 30269588 or 41961639
125 GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85