On Thu, 3 Feb 2000, Michael J. Wirthlin wrote:

> > Another option is to have several instances of
> > Midgard running. This method has the advantage
> > that it really separates content of different sites
> > (or site groups), but it also is a bit expensive
> > on performance.
> > 
> 
> Any suggestions on how to do this? How would I run multiple instances of
> Midgard? (i.e. is it a setting in the httpd.conf or what?)

No, this would be multiple instances of Apache running. Different
configuration files, serving different IP/port combinations.

> >Another possibility is to have several databases served by one DBMS.
> >This 'physically' separates Midgard deployments so unrelated clients
> >have no way of accessing each others' content. One DBMS, one Apache
> >installation.
> >
> >Emile
> 
> And this idea - any suggestions on how to get several databases served
> by one DBMS?

Sure. In case of MySQL: there is one server active, and you create
multiple databases on that.

The script below will add new setups like this. The script is extremely
rough around the edges, and not robust at all. I'd rather see people
read it as pseudocode than actually use this, but it describes what to
do.

This script would be called with 5 parameters:
1: the password of the MySQL root user
2: the servername to set up
3: the user for the account
4: the database password of the user
5: the email address of the account owner

The username would be used as both the database name and the name
of the administering user. The script assumes that the directory
/home/<username>/www will be/has been created by other means.

#!/bin/sh
# addhost dbrootpwd servername user dbpasswd email

echo mysqladmin -u root -p$1 create $3
echo mysql -u root -p$1 $3 < midgard.sql

echo "INSERT INTO user (Host,User,Password) VALUES ('localhost','$3',Password('$4')); 
INSERT INTO db (Host,User,Db,Select_priv,Insert_priv, Update_priv,Delete_priv) VALUES 
('localhost','$3','$3','Y','Y','Y','Y'); FLUSH PRIVILEGES;" | mysql -u root -p$1 mysql

echo "update host set name='$2';" | mysql -u root -p$1 $3

>>/etc/httpd/conf/httpd.conf
cat<<EOCONF
<VirtualHost _default_:80>
MidgardEngine on
ServerName $2
ServerAdmin $5
DocumentRoot /home/$3/www
MidgardDatabase $3 $3 $4
</VirtualHost>
EOCONF

emile


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to