Forum Moderators: mack
Have you looked into Apache's tutorial on Dynamic Content with CGI [httpd.apache.org]? Also, you may be better served by posting in the Apache Forum [webmasterworld.com] here at WebmasterWorld.
[webmasterworld.com...]
I've red that manual once more time and it works!
Nice job. You should post your directive here for future readers so they can learn from your experiences. That's the beauty of a forum -- take some, give some back, my friend ;)
Please tell me just one another thing. How do I connect and work with PostgreSQL and MySQL databases in my C++ scripts
I'm not sure about PostgreSQL, but for MySQL you are probably best off emloying the MySQL C++ API [dev.mysql.com].
Of course I do, but I needed to make it run all to become little bit familiar with this topic :o) So, here it is:
I use Debian Linux, so I've downloaded necessary packages from [debian.org...] (cgicc and libc with all depending packages) and because my server has no direct connection to internet I used
dpkg -i here_comes_all_packages_being_installed_separated_by_space
to install them. On my old Debian Woody I also had to upgrade gcc (there was some strange error during compilation fo cgicc but with new compiler it works well)
To make Apache serve executables as CGI, I should add this line into my httpd.conf:
ScriptAlias /cpp/ /home/apache/cpp/
So I place my compiled (the only howto about compilation of my cpp scripts I found at [yolinux.com...] ) scripts into /home/apache/cpp/ directory and view them at [192.168.1.100...]
Another problem was using PostgreSQL (I have no time to play also with MySQL and I use primarily Postgres, so I gived up any attempts to install MySQL) in my C++ scripts. Once again I used dpkg to install libdbi and libpgsql with all dependant packages. Detailed howto about compiling scripts, which use Postgres I found at [pgsqld.active-venture.com...] , but they forgotten mention one thing. Script was successfuly compiled, but when run, it presented me with strange error about missing libpq.so.3. So I've also had to add library path (/usr/local/pgsql/lib - the one, which can be determined by "pg_config --libdir" command) into my /etc/ld.so.conf and then run ldconfig command, which takes no parameters, probably only -v for long listing of libraries.
After all this done, finally it works as I need...