LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Is it possible to control apacheīs alias using mysql and not .conf files? (https://www.linuxquestions.org/questions/linux-networking-3/is-it-possible-to-control-apache%B4s-alias-using-mysql-and-not-conf-files-425454/)

stormrider_may 03-16-2006 01:36 PM

Is it possible to control apacheīs alias using mysql and not .conf files?
 
I want to know if itīs possible to make apache work with mysql. Actually, i want to make the .conf file be tables on mysql.
Like

---------------------------------------
|value1 | values2 |
---------------------------------------
|DirectoryIndex | index.php index.htm |
---------------------------------------

This is supposed to be a mysql query :eek:


Another question: When i reload apache, it stops working?

rch 03-17-2006 05:57 AM

Apache can work with mysql(that I assume you already know).
You can use aliasing too with mysql,
I am giving you the code ,but
what you could try is - try to include a httpd.include (for a particular alias) ,then put your values in mysql table, and using PHP edit the httpd.include file.
For more information about httpd.include(which is seperate from httpd.conf , the global option ,read the apache manuals)
Robin

stormrider_may 03-17-2006 07:33 AM

the problem is that this is a heavy traffic site which make lots of alias.
Sure i can do like you said, i can even use, for example, shell_exec() on php.
But i wouldn't put my hands on fire for this. I think mysql would be better.
Do you know a mod that can do this?

rch 03-18-2006 03:25 AM

well you can use exec or shell_exec to modify the file but if you want to modify the file using Mysql I don't think that it is possible.(in fact how can a database modify another file) - if you prefer you can write a cgi(maybe in perl) which does the work for you.
Robin

stormrider_may 03-20-2006 05:49 AM

But after i change it. Do i always have to reload apache? Is there someway to make it dynamic?

rch 03-20-2006 06:46 AM

use cron or similiar tool to restart apache -it will just take seconds
if your server is mission critical or requires 24 hr uptime,
then you can try using vhosts(each with seperate configuration file)
one of them will be running while you configure your another vhost.
if you are having trouble setting up vhosts try a simple tool called plesk(do some googling)

stormrider_may 03-20-2006 06:51 AM

during those seconds my server will be unavaible?

rch 03-20-2006 07:12 AM

yep, so i suggested another solution too.
robin

stormrider_may 03-20-2006 07:15 AM

do you know a way to host lots of phpbb using just one copy?


All times are GMT -5. The time now is 08:08 AM.