Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Apache Software

Configuring Apache From A Database? 6

nadachicken asks: "Has anyone found a module/solution to pull Apache configs from a database server? Currently I have a program that writes the flat file configs from the database but this seems like a waste of time if Apache could be rigged to pull the same info directly. I thought I had stumbled upon code to do this a while back, but I can't seem to find it again. If there is not such a package out there, any guess on how easy it would be to pull off?"
This discussion has been archived. No new comments can be posted.

Configuring Apache From A Database?

Comments Filter:
  • by Leknor ( 224175 ) on Sunday December 24, 2000 @04:38PM (#540874)
    If you have scripts to pull the config to a file then you've got all you need. Why add a dependency to the reliability / uptime to your web server? My database back end works very well but I really enjoy the fact that I can stop the database and still serve web pages (except the ones that pull from a DB) or I can stop sendmail and people can still check their existing mail. Anyway my point is that you have a good solution that sounds reliable and seems that it will work well and rather fail-safe. No need to mess up a good thing.

    Leknor

  • I can see one reason why you would want to do this, although i have no idea if that is why he would need to pull it off a DB..
    in case there are several machines running apache, and any settings have to be changed, if they can collect those settings from a datavase automatically once the setting is changed in the database, it would be a lot easier then going through each one and running the script, and making sure all changes were applied.
    just an idea..
  • by merlyn ( 9918 ) on Sunday December 24, 2000 @06:51PM (#540876) Homepage Journal
    mod_perl [stonehenge.com] can provide computed configuration files on the fly, directly from any database supported by DBI, for example, or even just computationally derived. There's examples of such in the mod_perl docs.
  • I too wondered if this was possible. So, I wrote a shared Apache module that I call mod_sql_conf. It accepts commands like SQLConfigHost, SQLConfigUser, SQLConfigPassword, SQLConfigDatabase, SQLConfigTable, SQLConfigFiled, SQLConfigWhere, SQLConfigOrderBy. Then when it finds the command SQLConfigLoad, it loads the text from the database and processes it as commands in the configuration file. It is still a beta version, as I'm the only one who has used it, and just to test it out. It was really just a proof-of-concept experiment for myself. I know it works on a Linux system. And right now it only works with MySQL, although it was created to be ported to other databases in the future with minimal work. I was planning on releasing this as an open source work under the GPL, but I just haven't got around to it.

    I am away from my home computer for another week or so, but I'd be happy to make the source available to you when I return after the new year.
  • well if your scripts work then it isn't a problem.

    Anyway, this is an issue of admin style and in the end I don't want others telling me how to run my boxes so I'll drop the argument here.

    Leknor

  • yeah sorta. the scripts do work fine, they just take a long time to write to disk. i have about 30,000+ lines of configs that need to be written to 20+ machines (hehe, don't ask:)) those machines then need to have apache read the configs back in. (it takes about two minutes for the whole process to take place). luckily its not that often that the entire server farm gets restarted and even less often that all of the configs get rewritten from scratch. it seems like that time could be cut in half if you cut that middle step out.

Don't panic.

Working...