You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by CUTMAN ~CW~ <cu...@hotmail.com> on 2003/12/27 12:40:34 UTC

[users@httpd] standing naked at the door of infinity with only a butterknife

Greetings all,

I'm setting up a non-production server to learn with.  I've done c/c++ 
programming over the years(mostly in Win32) and intentionally never used the 
connectivity technologies.  I've decided to do take that step now though.

I'd like to try my hand with various things from both sides of the server.. 
-as a server administrator as well as a website engineer.. -be set to 
eventually be able to participate in the open-source community.

To be honest I'm not even sure what would pique my interests but 
SOMETHING... I want to do something with the connectivity technologies.


The machine:
* Win-98SE box
* IE5.5-SP2 over cable internet

I'll be just running this server locally when i'm ready to start and stop 
the thing on various occasions.  The server won't run publically for any 
reason, but on ocassions I would have people from the outside take a visit.  
Also, the server will not be run 24/7 but only on occasion when I want to 
put it up.


The server-side:

Apache-2048 with cgi, and php.  I don't exactly know what I want here to be 
honest, but if that setup would let me start learning php and doing dynamic 
website content then great.  I'm interested to deal with the website 
engineering, but inevitably the server admin dealings will be required.

And because of my ignorance on the matter, I don't know whether Perl or 
MySQL is relevant,  or any of the huge list of mods available in Apache 
itself.

At this point I do not feel I will need to be dealing with SSL, encryption, 
compression, multiple-users, security or any of the other things I have no 
clue about.

If you are willing to offer any suggestions as to what I probably SHOULD 
approach here, then I would certainly appreciate the direction and offering. 
  On a minimum level I'd like to be able to mess with cgi through c 
consoles.  Also, php really seems it should be an obvious interest, but I 
can take things one-at-a-time as needed here.

Perhaps you can point me to a diagram of the relationships among a server 
such as this.  A revealing about the conceptual relationship of the 
components.  I am really at the beginning of a multi-faceted conglomeration 
of stuff that I am not familiar enough with.

What I'm looking for is a good basic starting point and a way to find out 
the general CONCEPTS that this scenerio will require.  I've been learning a 
great deal already about Apache, and I've installed MySQL, but the "click 
here, -then type this line" stuff doesn't get me what I need.  I've 
installed numerous variations of some combinations of stuff, and the more I 
do that the more I learn, but I'm missing the concepts enough to where even 
troubleshooting a problem leaves me scratching my head.

What is Perl?  I assume it's a programming language that uses scripts and 
are run by an interpreter(perhaps like the concept of BASIC).  I don't know 
a thing about Perl, but I think I've seen this used as a cgi, right?  I can 
do C.. -I'm familiar with C(comfortable with it too)..  I found the cgic 
library here: http://www.boutell.com/cgic/  Anybody know if I can just build 
mini console apps and they'll interface as the cgi under Apache?  Actually, 
I don't have a clue what I'm talking about, but this seems conceptually 
correct and logical too.

And php is strictly interpreted script, right?  -and so Apache runs and 
controls an interpreter for this?

See what I'm saying?  I don't understand all the relationships here..

If you can direct me toward any material or design concepts and the like, 
for this I would be undoubtedly endebted.  I need to find a path for 
learning about these things and hopefully taking them in an appropriate 
order.  Right off I would assume I just need to start with getting Apache 
running with cgi ability and that's all.  I can take each piece as it would 
come when I learn more and more things.  I guess I should be taking some 
kind of college courses or something but I'll be going at it alone.

I thank you for taking any time you are willing to offer for me.


-standing naked at the door of infinity with only a butterknife,
Scott

===========

The rest of this message is just further ranting but does reveal more of 
some of my assumptions, or lack of knowledge, about the whole dynamic 
website thing... -perhaps helpful or not.

I've read alot over the websites and I've just been forcing myself to skim 
the emails from the mailing lists so I can pick up on some of the issues.  
Currently I find alot of info about WHAT various things are or HOW TO 
implement certain things, but I'm not finding info on the WHY...

I've been playing with Apache and other programs quite a bit, not even sure 
of WHY I do the install `this way or that'.. -or WHY I am making settings 
such as `this or that'.

For example, on one occasion I installed these installations under the root 
of my c drive:

c:\apache
c:\php
c:\mysql
c:\perl
c:\bb2
c:\nuke

on another occasion:

c:\apache
c:\apache\php
c:\apache\mysql
c:\apache\perl
c:\apache\bb2
c:\apache\nuke

and yet another:

c:\apache
c:\apache\htdocs\php
c:\apache\htdocs\mysql
c:\apache\htdocs\perl
c:\apache\htdocs\bb2
c:\apache\htdocs\nuke

and then the latest thing that seems logical:

c:\apache
c:\php
c:\mysql
c:\perl
c:\apache\htdocs\bb2
c:\apache\htdocs\nuke

and have also have used a variety of combinations thereof.  I can't imagine 
in what cases it would or should make a difference, but I guess I feel 
SOMETHING does about it.

I realize approaching all things at once is not going to be effective, so 
I've tried to take simple approaches to just get one thing happening such as 
a php test script to run(which actually I have accomplished).  I've tried 
various tests from a variety of these installations and I have gotten 
various degrees of success on different occasions but mostly failures.  
Either I can't get to the database, or there will be `access denied' 
failures.  I don't know if I should start mysql or apache first, or even 
whether it makes a difference.  It seems like access problems could stem 
from MySQL, the Apache scheme OR php... -so I just continue to try to read 
and maybe stumble on another thing to try.

Upon trying to just start out with some `plug-in-play' type stuff I tried to 
get phpBB2 running, and I tried phpNuke as well.  I figured maybe this would 
be an easy task and at the very least I could have something running that I 
could then learn to operate... -give me some actual production.  I was 
successful in getting both of these installations to go up to initial set-up 
screen where you create an administrator, but any time after that I get 
`access denied'.  I don't know if I need proper rights to the mysql server 
or a specific database of the server.. -I just don't know here.  I thought 
perhaps Apache is preventing things from happening because it is using 
`rights' settings that do not allow anything to happen.  I can not tell 
whether I am having a problem with MySQL or Apache... -I mean I KNOW the 
problem, and that's that I just don't know enough of what I'm doing, so it's 
a user error or an admin error, but that's why I want to learn more.  And 
too, it would be nice if I could have some sense of accomplishment as I go 
along here.

I'd love to just open the whole thing wide open... -no security, no 
super-users, no users in fact.. it's only me, and anybody else who would 
drop by would be either a friend or someone who has come to help me in which 
case security isn't an issue... -plus I have a firewall so no activity will 
take place until I click "permit".

If any of you would be willing to give me some hints about some things or 
point me to some good resource that might be inline with some of these 
things I've mentioned I would surely appreciate it.  I'm just getting 
frustrated re-installing all these things and hoping for some different 
outcome if I do it in a different order..  -it's just not been very 
productive.  Thank you.

_________________________________________________________________
Check your PC for viruses with the FREE McAfee online computer scan.  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] standing naked at the door of infinity with only a butterknife

Posted by Brian Dessent <br...@dessent.net>.
CUTMAN ~CW~ wrote:

> If you are willing to offer any suggestions as to what I probably SHOULD
> approach here, then I would certainly appreciate the direction and offering.
>   On a minimum level I'd like to be able to mess with cgi through c
> consoles.  Also, php really seems it should be an obvious interest, but I
> can take things one-at-a-time as needed here.

I'd say your best bet would be to get one of the O'Reilly books and sit
down with a cup of coffee and start reading.  There are tons of them, so
I can't really recommend any one in particular, but I'd say anything
from the "In A Nutshell" series would do you well (e.g. _Webmaster in a
Nutshell_)  Browse on over to <http://web.oreilly.com> and see if any of
the titles jump out at you.  These books are "the industry standard" and
so for example if you want to learn Perl then "the camel book"
(_Programming Perl_) is the definitive reference.  Also note that there
are usually several degrees of coverage on each topic, for example the
"Programming Foo" titles tend to be very thorough and in depth, while
the "Learning Foo" or "Foo Cookbook" series are more geared at getting
you off and running if you have less background or desire to really read
a long book on the subject.  Don't be overwhelmed by the sheer number of
books, the majority of them are quite specialized.  Aim for the more
broad, introductory, or general titles.

The other resource you should check out is <http://www.onlamp.com>. 
LAMP is the common acronym for Linux-Apache-MySQL-PHP which powers a lot
of websites.  The site has a lot of tutorials and background information
that's suitable to beginners.  It's worth a browse.

In terms of the "How does it all fit together" part, here's my quick
overview.  Apache is the main server which coordinates all the
activities.  Apache itself typically does not do any actual processing,
although it can with some of its add-on modules.  But usually Apache is
either there to just serve static files from disk or to act as a gateway
(CGI) for some other language or application.  You can use almost any
conceivable language out there to do this.  The most popular are Perl
and PHP, which are both interpreted scripting languages.  They are
somewhat similar in that they share a lot of familiar ideas, but they
each have their own quirks and traits.  Other scripting languages that
are seeing more use are Python and Ruby, but really anything can be
used, including any compiled language.  You can read about the CGI
specification on the NCSA site, but essentially it amounts to stdout of
your application gets sent to the client (browser), and some information
is passed through environment variables and the command line arguments. 
It's really pretty straightforward, but that doesn't mean it's
necessarily best to re-invent the wheel.  By that I mean it's certainly
*possible* to write web apps in C but almost nobody would do that unless
they were absolutely forced to.  The reason is that while C is certainly
fast and efficient, it lacks a great deal of functionality that must
either be implemeted by you or a library.  Furthermore, scripting
languages don't need to be compiled so they are very simple to
distribute, install, and require little porting to be cross-platform. 
You would also be amazed at how much functionality has already been
written for you in Perl or PHP (see for example CPAN) in terms of
modules that you just drop in for whatever task you have to perform. 
The other issue is that C code can be riddled with security flaws (such
as buffer overruns) which is especially relevent to web apps since they
accept input directly from the end user's client, so they must be
hardened to those sorts of common errors.

So, that's CGI.  It's important to note that the CGI interface calls for
a new process to be created to service each request, and terminated when
that request ends.  This makes it inefficient for high-traffic sites, so
people have taken the core internals of popular scripting languages, and
implemented them as modules that run inside Apache.  Thus you have
mod_php and mod_perl, as well as mod_python, etc.  What this means is
that instead of having to spawn a new PHP process for each request, the
Apache process itself parses the code, runs it, and returns the result
to the user.  This is very efficient, and it's a crucial reason why
these scripting languages have been embraced by so many sites.  We'd
probably all be back to writing everything in C (as we did in the
mid-90s) for performance without these modules.  In fact, this is
exactly what has happened with Yahoo.  They wrote a giant infrastructure
around these custom C programs that they developed, starting way back in
the day when the web was young.  They've managed to maintain it and keep
it going, but they recently announced that they're going to ditch it all
in favor of PHP in the future, as it's just too costly for them to
maintain.

Finally, there's MySQL.  One aspect of web programming that differs from
'traditional' application developement is that web apps are
intrinsically multi-user.  Your app doesn't know whether it's the only
one running, or if there are 100 other requests also being handled at
the same time.  So, for example, if you wanted to store a little data on
disk you might just use a simple text file or something if you were
writing a traditional sinlge-user program.  But that doesn't work very
well at all with web apps, because you have to code around all the
possible scenarios of "Is someone else reading this file right now?" and
"What happens if I write to this file and someone else is trying to
write to it too?", etc.  So thus there's a general need for a data-store
that's both flexible and adept at handling the case of many processes
accessing the same data simultaneously.  MySQL gets a lot of use here
because it's free, but other databases are often used when MySQL is
inadequate.  PostgreSQL, Oracle, DB2, SAP, MSSQL, etc. are all
heavyweight alternatives to MySQL.  At the core they all do basically
the same thing -- but of course you get a lot more sophistication and
capability with the ones that cost megabucks.  Anyway, the SQL database
gets used for web stuff because it offers this flexible and robust
data-store capability.  Relational database theory is a very deep and
well-researched field so I can't really sum it up for you, but try
reading <http://eveandersson.com/arsdigita/books/sql/> for a good
background of what a database is and should do, and how that fits into
the web.

HTH,
Brian

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org