apache_2.0.nn-win32-x86-no_ssl.msi
(the nn
stands for the version number.
Download it. (Or, you can just use the one on the Perl CD that you got
in class.)cit042.dev
;
for server name, use www.cit042.dev
; use your
email address for the administrator’s email.http://127.0.0.1:8080
or
http://localhost:8080
. If you see the
Apache welcome page, congratulations; it’s up
and running.CTRL-C
in
the window that you opened in step 1 above.
Put your HTML files in the
C:\Program Files\Apache Group\Apache2\htdocs
directory. Let’s say you put file test.html
there.
You can then access it from the browser by typing
http://localhost:8080/test.html
in the URL
area.
C:\Program Files\Apache Group\Apache2\cgi-bin
directory. Your CGI files must have the location of Perl
on your system as their first line; instead of
#!/usr/bin/perl
you would put something like this:
#!C:/perl/bin/perl.exe
Let’s say you have put file report.cgi
into the cgi-bin
directory, and
test.html
into the htdocs
directory. To invoke the CGI script from the HTML file,
you would have a tag like this in your HTML:
<form name="myForm" method="get" action="../cgi-bin/report.cgi">
If you don’t want to have to type the
:8080
in the URL area, you can set
Apache to listen on the standard port (port 80). First,
stop Apache (if it’s running) by pressing CTRL-C in its
console window.
Next, edit file
C:\Program Files\Apache Group\Apache2\conf\httpd.conf
.
Look for a line that starts with
Listen 8080
(about line 120). Change that line to
Listen 80
, and save the file.
Look for a line that starts with ServerName
(about line 210)
and get rid of the :8080
at the end of that line.
Start Apache
again from the Start menu.
Now you can type http://127.0.0.1/
in the URL area
of your browser, and it should take
you to the main Apache page without having to use the
:8080
.
It is a good idea to keep CGI files in their own directory, but if you want to be able to run them from any directory at all, change the configuration file as follows:
Options Indexes FollowSymLinks
(near line 265), and add ExecCGI
to the end of the line.#AddHandler cgi-script .cgi
(near line 750) and get rid of the #
at the beginning of the
line.Save the configuration file and restart Apache.
Leave the rest of the configuration file alone
unless you really know what you’re doing. If
you want to see the Apache documentation, start the server
and go to http://127.0.0.1:8080/manual/
(or http://127.0.0.1/manual/
if you have
changed the configuration).