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

Re: RFC: new network config (was: Re: network configuration)



[ cc-ed to debian-admintool because it's relevant to there too ]

On Fri, Feb 05, 1999 at 12:31:20AM +0100, Wichert Akkerman wrote:

> * IP aliases

for ip aliases, the config file should have fields for more than just
the IP address, and scripts which use it should ignore anything they
don't need.

the file could be used by /etc/init.d/network to bring up the alias
interfaces and could also be used by either apache or an apache
httpd.conf generator to generate virtual hosts (the "user" field would
be used to specify where log files and htdocs directories are).

e.g. a config file like this:

    #IP:domain:username:CGI?:Analog?
    x.x.x.x:www.foo.bar:foobar:Y:Y

alternatively, instead of hard-coded specific fields like CGI? and
Analog?, a generic "flags" field could be used, like so:

    #IP:domain:username:flags,...
    x.x.x.x:www.foo.bar:foobar:cgi,php,mod_perl,analog,vpop,grand_frobnicator

it could be used in /etc/init.d/network like so:

    ALIASES=$(grep -v "#\|^$" /etc/virtual-hosts.conf | cut -f1 -d:)
    i=0
    for j in $ALIASES ; do
        ifconfig eth0:$i $j up
        i=$(( $i + 1))
    done

and it could also be used to generate something like this for httpd.conf:

    <VirtualHost www.foo.bar>
        ServerName www.foo.bar
        ServerAdmin foobar@somewhere.com
        DocumentRoot /home/foobar/public_html
        User foobar

        ScriptAlias /cgi-bin/shared/ /usr/lib/cgi-bin/
        ScriptAlias /cgi-bin/ /home/foobar/cgi-bin/

        Alias /perl/ /home/foobar/mod_perl/
        <Location /perl>
            SetHandler perl-script
            PerlHandler Apache::Registry
            Options ExecCGI
        </Location>

        ErrorLog /home/foobar/www_logs/error.log
        CustomLog /home/foobar/www_logs/access.log combined
        # old stuff...obsolete since i started using CustomLog
        #TransferLog /home/foobar/www_logs/access.log
        #RefererLog /home/foobar/www_logs/refer.log
        #AgentLog /home/foobar/www_logs/agent.log
    </VirtualHost>

and also be used to generate ~foobar/analog.conf:

    # Configuration file for analog 2.0
    # default options defined in /etc/analog.conf
    #
    HOSTNAME "www.foo.bar"
    LOGFILE /home/foobar/www_logs/access.log.0

other relevant daemons (e.g. proftpd, or a hacked popd or MTA which took
note of the IP address to determine which passwd file to use, or where
the mail spool belongs for that vhost) could also use this file.

the idea is to consolidate a short form of all the vital information for
configuring several different (but related) subsystems into one easily
edited and easily parsed file.


BTW, a GUI or curses/dialog/whiptail type interface could fairly easily
be grafted on top of a plain text file like this.


i do stuff like this already in a semi-automated fashion, both at
home and at work (i'm system admin for an ISP). it works well, and is
certainly a lot easier than manually creating all the required config
files and directories.

one thing that's useful to mention is that any generator scripts should
check to see whether any files they want to create already exist and
skip that virtual host if they do (unless --force is used). this allows
customisation of a particular host after it has been auto-generated.


I am more than willing to write the code to do this. the above are my
ideas, stuff that has proven useful to me in the past...ideas or sample
code from other people who need similar functionality are very welcome.


> * static routes

/etc/gateways should be used for this. just because routed uses it
doesn't mean anything else shouldn't....in fact, that's a good reason
for using the same file.

it's reasonably well documented and many people already know how to use
it.

> * preferably also things like arcnet
> 
> Anything less will mean people would still need to setup things manually.

there should *always* be the capability to set things up manually.

craig

--
craig sanders


Reply to: