Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old May 13th, 2001, 09:23 PM
JennyW JennyW is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 15 JennyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache beginner - I need help

Hi my name is Jenny,
I'm a very new beginner to Apache.
I downloaded Apache 1.3.19 on my computer so I could practice inserting very simple CGI scripts on my website.

I've got some problems.

I'm running Apache from a console window (I'm using Windows 98). Apache is up and running and I can see my successful http://localhost/ page.

But now what do I do? How can I learn to insert CGI scripts? I've been looking all over the Apache .pdf help files, but I haven't been able to find assistance.

Thanks for reading,
Jenny

Reply With Quote
  #2  
Old May 13th, 2001, 09:32 PM
cka cka is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Ontario, Canada
Posts: 498 cka User rank is Corporal (100 - 500 Reputation Level)cka User rank is Corporal (100 - 500 Reputation Level)cka User rank is Corporal (100 - 500 Reputation Level)cka User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
CGI is a broad term. You can write CGI scripts in numerous languages (Perl, PHP, Shell/batch files, etc.) In order to run those CGIs, you need their script processors (perl scripts (typically end in .pl or .cgi) require you to have Perl installed, PHP CGIs require you to install php, etc.) There's a few settings in your conf\httpd.conf file for Apache's CGI-BIN directory, so you might want to go over those.
__________________
To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

Reply With Quote
  #3  
Old May 14th, 2001, 09:51 AM
chronoton chronoton is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Kenju
Posts: 26 chronoton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Tricky Windoze

Apache can´t use all its features under windows. Thats a pity but a fact. There is some perl Binary for Win32s

http://www.perl.com/CPAN/ports/win32/Standard/x86/

Install it and READ the Manual of perl.
There you´ll find HOW to install it.

With Perl you can use cgi-bin more or less good.
Remember, that most ready made perl scripts
are written for unix systems, so that you have to change
pathnames / = \ ...

After all PHP is also possible with Win32s

Binary on php.net


Have Phun

Reply With Quote
  #4  
Old May 14th, 2001, 10:30 AM
JennyW JennyW is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 15 JennyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi all,

So even if I have Apache running on my computer I still need Perl to run CGI scipts?

Chronoton,
Is this the file I should be downloading?
DB_File-1.54-bin-v3-x86-mswin32-bc.zip
I don’t understand why I this file?

Thanks for the replies Chronoton and cka.
Jenny

Reply With Quote
  #5  
Old May 14th, 2001, 10:52 AM
chronoton chronoton is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Kenju
Posts: 26 chronoton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Nope Jenny :

This is your file :

http://www.perl.com/CPAN-local/port...indist04-bc.zip

And yes, you NEED Perl to run cgi-bin.

Apache won´t handle that alone,
still mod_perl needs perl in Backend *smile

Reply With Quote
  #6  
Old May 14th, 2001, 11:51 AM
JennyW JennyW is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 15 JennyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
Ok, so this...

http://www.perl.com/CPAN-local/port...indist04-bc.zip

...is Perl?

Or is it a piece of the puzzle to make Perl work?

When Perl is on my PC does Apache find it on its own? How does Apache know where Perl is?

Thanks,
Jenny

Reply With Quote
  #7  
Old May 14th, 2001, 12:19 PM
chronoton chronoton is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Kenju
Posts: 26 chronoton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
*smile

-- snip --

Ok, so this...

http://www.perl.com/CPAN-local/port...indist04-bc.zip

...is Perl?

Or is it a piece of the puzzle to make Perl work?


-- snap --

No Jenny, this is perl, normally you won´t need anything more than that binary. Unzip and then Setup it...

Thats all..

Reply With Quote
  #8  
Old May 14th, 2001, 01:30 PM
JennyW JennyW is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 15 JennyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

Alright, so I’ll download that and give it a shot!

Thanks chronoton, your help is really appreciated.

Jenny

Reply With Quote
  #9  
Old May 14th, 2001, 07:50 PM
JennyW JennyW is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 15 JennyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It's me again!

How can I insert CGI scripts into Perl and test them?

I have Perl installed and I have Apache 1.3.19 running in a console window (Windows 98) on my computer.

I have no idea where to start. I’ve looked through the Perl .html help docs, but I can’t find any info. for beginners, like myself, who know very little about Perl.

Thanks,
Jenny

Reply With Quote
  #10  
Old May 15th, 2001, 06:43 AM
chronoton chronoton is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Kenju
Posts: 26 chronoton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well...

I´m not really fimilar with Win32s Installations of Apache.
But usually you should have a so called document root.

There you´ll find a directory called cgi-bin

Put some very very easy cgi script into that path.
You´ll find tons of scripts on

www.hotscripts.com

After that, open your webbrowser and try the following :

http://localhost/cgi-bin/nameofyoutestscript.cgi

Look , what will happen ?

Reply With Quote
  #11  
Old May 15th, 2001, 09:07 AM
JennyW JennyW is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 15 JennyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hiee,
I know where my CGI-bin is within my Apache folder.

When I save or create my CGI scripts, do I do so through Notepad (or another text editing application)?

What extensions do I give the scripts?

I know I need Apache running, but do I need Perl running when I check these scripts on the http://locahost ?

Thanks,
Jenny

Reply With Quote
  #12  
Old May 17th, 2001, 05:10 AM
chronoton chronoton is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Kenju
Posts: 26 chronoton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hey Jenny,

may I repeat myself...

but you NEED apache AND PERL running,
because apache gives the request perl
to handle it.

The File extension is .cgi

Reply With Quote
  #13  
Old May 17th, 2001, 08:07 AM
JennyW JennyW is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 15 JennyW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hiee chrono,

Yes, I know Apache needs to be running. But how do I make Perl run?
I heard Perl doesn’t run, it is just called upon when a .cgi script requests it.

I put the following .cgi script in the Apache/cgi-bin folder.

I tested the following script in my IE browser (http://127.0.0.1/cgi-bin/simple.cgi), but was unsuccessful.
The script is called simple.cgi

#!perl
print "Content-type: text/html\n\n";
print "Not Hello, again!\n";

Is the #!perl line the problem?
Should that line display the exact path to perl.exe like this...
#!c:/program files/perl/bin/perl

Do you know what could be wrongy?

Thanks,
Jenny

Reply With Quote
  #14  
Old May 19th, 2001, 01:34 PM
z-lite z-lite is offline
wuz here
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2001
Location: FL
Posts: 648 z-lite User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via AIM to z-lite
lol, JennyW, I think you are going to drive them mad. After Apache and Perl have been installed successfully, when a .cgi, .pl, or any other script file is called, Perl will answer and do its thing(anyone correct me if im wrong). In *nix servers, you need to tell Apache where the script interpreter is located, such as /usr/bin/perl or something. But in Windows, the path is automatically given. I am not a perl person yet but the way that 2 line code looks, it looks fine and nothing is wrong.(again, anyone correct if im wrong)
__________________
z-lite was here

Reply With Quote
  #15  
Old May 19th, 2001, 01:45 PM
z-lite z-lite is offline
wuz here
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2001
Location: FL
Posts: 648 z-lite User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via AIM to z-lite
Here, open up notepad then copy and paste the below code:

print "Content-type: text/html\n\n";
print "Hello World!";

save it as hello.pl into the cgi-bin folder and open up IE and type the path to the hello.pl, such as http://127.0.0.1/cgi-bin/hello.pl and see if 'Hello World!' shows up. If not, Apache is not configured to use Perl for scripting OR there was an unsuccessful installation.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Apache beginner - I need help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump