[99888] in RedHat Linux List

home help back first fref pref prev next nref lref last post

RE: Getting to know CGI through httpd/Apache

daemon@ATHENA.MIT.EDU (Ed Lazor)
Tue Nov 17 12:58:08 1998

From: "Ed Lazor" <elazor@hcs.state.or.us>
To: <redhat-list@redhat.com>
Date: Tue, 17 Nov 1998 09:56:02 -0000
In-Reply-To: <3.0.1.32.19981117072758.0068fc64@pop.microtec.net>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com


I'm just learning about this but here's my understanding...

If you want to have a web server, you setup apache.  

If want to have database support, you run something like MySQL
or PostgreSQL.  

If you want to communicate from your web server to your database 
server, I've seen a couple of options.

The first would be to do CGI programming with Perl or C.  This
requires that you pickup a module - a sort of "plugin" for the
scripting / programming language that you're using that is 
designed for the database you're using.  The module gives you
a standard interface for communicating to the database.  

  apache <--> CGI (perl or C) <--> module  <--> database server

Another method I found is a module / plugin that goes directly
into the apache web server called PHP3.  

  apache <--> module <-->  database server

Since PHP3 is built into the web server, you're able to integrate
your scripts into your web pages.  Basically, the server reads the
web page, interprets the commands, gets the info from the database
server and then sends it as part of your web page.  

Since I'm so new to this, I'm honestly not sure what all of the 
benefits would be of going either way.  So far I'm personally
leaning towards the PHP3 solution because it seems to be the
easiest.  I also remembering reading somewhere that the PHP3
solution is supposed to be a lot faster and create less load on
the server because you're not constantly having to spawn CGI 
processes.

Relevant links:

MySQL:  http://www.mysql.com
PostgreSQL:  http://www.postgresql.org
PHP3:  http://www.php3.com
Devshed:  http://www.devshed.com/resource/advanced/mysql/index.html

The last link of Devshed is an online tutorial that will lead you
through the basics.  In their examples, they are using Apache, MySQL,
and PHP3.  I'm still uncertain as to whether I'll ultimately use
MySQL or PostgreSQL.  PostgreSQL was much easier to install than MySQL.
I also had some concerns about the way the MySQL setup was designed
which leads me to wonder if I'll continue running into those issues.
MySQL seems to have a lot more user support and documentation than
PostgreSQL.  I also read somewhere that MySQL is the fastest database
server around - not sure if that's true or not.  I'm going to keep
playing with both options and looking to see what others have to say
about their experiences before completely deciding on which way I'm 
going to go.

Hope this helps shed some light a little at least :)

-Ed


-----Original Message-----
From: aromes@microtec.net [mailto:aromes@microtec.net]
Sent: Tuesday, November 17, 1998 3:28 PM
To: redhat-list-request@redhat.com
Subject: Getting to know CGI through httpd/Apache


Hi,
I ve been readind interesting books about CGI, but despite the fact that I
understand the concept [CGI is a 3rd part program that adds additional
functionalities to web requests, such as dynamic web and so on..], I m
really dying to practise it:
I ve installed a local home httpd/Apache server on my redhat 5.0/kernel
2.0.32 box, and things seem to work well at the basic. A "lynx
http://localhost" or of my own IP gives me back what I was expected.
DocumentRoot and ServerRoot are declared as /home/httpd and in that same
path I have index.html (my personal web page) and a directory CGI-BIN. 
Now, I would really like to start testing the first steps functionalities
of using CGI and dont know how to. I ve looked 
in man pages, online docs ..they give U good elements on CGI-programming,
but still ..I didnt find docs that really cover 
preactical exples such as: 
OK, say you want the CGI script /home/httpd/apache/CGI-BIN/boboni-cgi
to call the database HOWARD for your web server Apache. So you go in
httpd.conf and add " ADD CGI_REQUESTS /home/httpd/apache/CGI-BIN/boboni-cgi
 to /etc/httpd/apache" ..etc..

This kind of clear steps to follow are hard to find..
Thanks
Marc


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
		http://www.redhat.com http://archive.redhat.com
         To unsubscribe: mail redhat-list-request@redhat.com with 
                       "unsubscribe" as the Subject.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
		http://www.redhat.com http://archive.redhat.com
         To unsubscribe: mail redhat-list-request@redhat.com with 
                       "unsubscribe" as the Subject.


home help back first fref pref prev next nref lref last post