Gossamer Forum
Home : Products : DBMan : Customization :

dbman working across virtual hosts

Quote Reply
dbman working across virtual hosts
In the very near future, I will be installing the SQL DBman on one of my clients servers. My questions is this - I would like to install one main dbman and have all of the virtual hosts read from the main db.cgi. I will be making different html.pl's etc for each one of the virtual hosts. My problem is that I am not totally sure how to go about making the virtual host look to a directory outside of its root for the cgi. I do not want to install tons of copies of DBman (there will be literally hundreds of them) because that would make things really hard to work with with that amount of files - it would also fill up the server's hard drive pretty quickly. So if anyone has any suggestions or needs more info, please let me know.

Thanks a bunch!


------------------
Jason
Extreme mtb
http://extreme.nas.net
Quote Reply
Re: dbman working across virtual hosts In reply to
Ok, I'll give you the short answer and we'll see how we go from there. To use the same copy across your virtual hosts, you will need to set up an Alias or ScriptAlias for the directory you want to use. If you don't know what Alias's and ScriptAlias's are, now's a good time to look at your hosts docs...

To set up dbMan, you will have to adjust the config file a bit too. For instance, you would define your $db_dir_url using the SERVER_NAME environment variable, instead of a domain name. Like this:

$db_dir_url = "http://$ENV{'SERVER_NAME'}/dbman";

And the rest of the variables for files used by dbMan would have to be set to the proper paths to the files.

Finally, your html.pl files. I would suggest that you have a directory with all the html.pl files stored in it, and you name them according to the domain names, eg.:

domain1.com.pl
domain2.com.pl

and then, in the config file, instead of:

require $db_script_path . "/html.pl";

you would have:

require "/path/to/html/dir/$ENV{'SERVER_NAME'}.pl";

The problem with this is that SERVER_NAME could be "domain.com" or "www.domain.com", but no doubt someone here could supply a valid regular expression to get rid of the "www.".

I hope this gets you started on your journey anyway. (And this was the short answer! Smile)

Cheers,
adam
Quote Reply
Re: dbman working across virtual hosts In reply to
Thanks a ton for you suggestions! I have already used "aliases" in 2 instances and they have saved tons of time. Once I get the dbman, I'll let you know how your instructions work out. Thanks again!



------------------
Jason
Extreme mtb
http://extreme.nas.net