Professional Web Applications Themes

C-Language CGI-BIN Programming with MySQL - MySQL

Because I have some heavy number-crunching scientific applications, I'd like to program using the C language, CGI-BIN, and with MySQL (using its C-language interface). Is there anything I should know? For example, when Apache runs a CGI-BIN, is there anything special about the environment (memory limits, etc.)? Is the paradigm I proposed workable? Thanks, Dave....

  1. #1

    Default C-Language CGI-BIN Programming with MySQL

    Because I have some heavy number-crunching scientific applications, I'd like
    to program using the C language, CGI-BIN, and with MySQL (using its
    C-language interface).

    Is there anything I should know? For example, when Apache runs a CGI-BIN,
    is there anything special about the environment (memory limits, etc.)?

    Is the paradigm I proposed workable?

    Thanks, Dave.



    David Guest

  2. #2

    Default Re: C-Language CGI-BIN Programming with MySQL

    Some remarks,
    Do not use CGI-BINs cause they are vulnerable to some attacks. If you
    use mySQL directly with the Apache Server to do queries you will
    probably end up using PHP interface to communicate with mySQL Server.
    Do noy install the PHP plug-in as a CGI-BIN but as a module.

    Cheers,
    Dragomir Stanchev

    http://www.linkedin.com/in/dragomirstanchev
    http://www.student.informatik.tu-darmstadt.de/~stanchev/CV%20deutsch.pdf

    The|Godfather Guest

  3. #3

    Default Re: C-Language CGI-BIN Programming with MySQL

    "The|Godfather" <com> wrote in message
    news:googlegroups.com... 

    Do you have any URL's describing attacks. I'm curious. Thanks.



    David Guest

  4. #4

    Default Re: C-Language CGI-BIN Programming with MySQL

    The|Godfather wrote: 

    I agree with Dave. Some specific CGI-BIN's may be prone to attacks.
    But that is not a reason not to use CGI-BIN's. Please provide solid
    references (not rumors) supporting your statement.

    Many people use languages other than PHP to communicate with MySQL - and
    believe it or not, those people are running under Apache. They use
    languages such as Perl or Python, for instance.

    And believe it or not, there are actually people using C/C++ with Apache
    to do cpu-intensive work.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  5. #5

    Default Re: C-Language CGI-BIN Programming with MySQL

    David T. Ashley wrote: 

    Dave,

    Yes, it's workable. You can access MySQL quite easily from C/C++. From
    the Apache end it all depends on what language you're going to use for
    the server-side scripting.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  6. #6

    Default Re: C-Language CGI-BIN Programming with MySQL

    David said: [/ref]
    like [/ref]

    David:

    I program in the xHarbour language (a C-based language). Several members
    of our users group (www.xharbour.org and www.xharbour.com) use the Harbour
    language to create executables (.exe's) for usage as CGI-Bin. I tried this
    once myself a year or so ago (but only using localhost to train myself).

    Harbour applications are compiled into 'C' functions, then those
    functions are further compiled into .obj code, and then linked into an
    executable. The Harbour language probably contains all the
    number-crunching stuff you'll ever need. But, *in addition*, it is has a
    native high-speed facility to use databases of a wide variety (because of
    Replaceable Data Drivers - RDDs). I believe that C-librairies can be linked
    into and be used with a Harbour app (but *may* have to be re-compiled). You
    can either build your own xHarbour compiler (from downloade C-source code or
    download the binary compiler (harbour.exe) from the users group.

    Of the several choices of C-Compiler that can be used, my choice is
    Borland's *free* Command Line Tools, which contains BCC 5.5 -- there are
    other C compilers available also which are just as good (apparently).

    The most widely used RDD in Harbour is similar to the FoxPro-type of
    database (i.e., like the old style dBase databases). Much more modern of
    course. So, the access from the Server (i.e., your xHarbour .exe) your
    Database is extremely fast -- certainly much faster than SQL access.

    Since, I'm *not* a guru, but simply an application programmer, I suggest
    you join the Users' Forum, and 'smell around' for awhile. Anybody that came
    up thru the past 15-20 years of xBase programming will be delighted at the
    progress of this language -- all open source too.

    btw, the xHarbour language (eXtended Harbour) is a big step forward over
    the original Harbour language (both of these were began in 2001 and are
    advancing very fast !

    Please excuse the sales pitch !

    Good Luck !

    -Mel Smith


    Mel Guest

  7. #7

    Default Re: C-Language CGI-BIN Programming with MySQL

    "David T. Ashley" <com> wrote: 

    I don't see the link from "number-crunching scientific applications"
    to using CGI. Heavily frequented web applications don't use CGI because
    it spawns a new process per request. More common is the ->fastCGI
    approach. With Apache you can even use one of the many extensions - or
    write your own. The Apache API is quite straightforward. Implementing
    a content handler is not much harder than writing a CGI app.

    Additionally: why not PHP or Perl? Do you do numbercrunching in the
    web app? If yes - most numbercrunching stuff is done in a C library
    function and just called from the script interpreter. I.e. if you do
    some big-integer arithmetics in a Perl script using Math::GMP, all
    the cpu consuming things will be done in libgmp. Writing the glue code
    in C would gain you next to nothing.
     

    Read it up in the Apache docs. Some things are configurable.


    XL
    --
    Axel Schwenke, Senior Software Developer, MySQL AB

    Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
    MySQL User Forums: http://forums.mysql.com/
    Axel Guest

Similar Threads

  1. Any good MySQL programming magazines?
    By RiseOfThePhoenix in forum MySQL
    Replies: 1
    Last Post: June 2nd, 10:24 AM
  2. Is PHP the easier web programming language?
    By Marta in forum PHP Development
    Replies: 15
    Last Post: December 16th, 11:11 AM
  3. Replies: 0
    Last Post: May 5th, 06:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139