Click to See Complete Forum and Search --> : What scripting language to be used or rather make an executable (for Apache)?


luftwaffe
May 12th, 2003, 11:36 AM
Hello,

I have the following theorethical question and wait for some response from more experienced people in the field.

I have decided to make a website on my own. I consider to use either a linux distribution or windows to run apache. What I would like to do is some stuff what involves some access to a MySQL database. I wrote extensions to IIS and I seek something similar, namely to build a connection to the SQL server only once and then have instances of the page called as many times as request comes to avoid overhead of building a database connection each time. Heard about server extension (C++) but I did not manage to find a good tutorial on this. I am also interested if it can be done either by PHP, I red about mod_php (perl and mod_perl are also good). So, is it possible to do that way: start apache, load the stuff made, establish connection to the database and then as soon as request comes just process without establishing and closing connections?

Thanks. :)

lord loh
May 22nd, 2003, 05:36 AM
A stand alone EXE can be executed as a cgi from apache...

And Php does support what it calls a persistant connection with a database...I never had the need to use it...

And about perl, I dont know...

One excellent way to do what you want is to write a second server which will keep a hot connection with the DB and return data of queries that you pass to it...so your script will have to connect to this DB proxy server instead of the DB server...

This is feseable only if the DB server takes a longer time to establish a connection than a proxy server....

OR BETTER and TOUGHER,
Write your own Appliation server using MySQL as the DB back end...and in this case you will have to rack your head on HTTP rfcs....

There exists a HTTP server called JigSaw from http://www.w3c.com written in Java you may be able to modify it...
Or for that matter you can modify PHP or write an extention to apache to use MySQL and together (Apache and MySQL) to act as an application server...

Sorry to give all hypothetical solutions but hope they help...