dBASE 2019 and Apache 24x - Configuration Guide
dBASE 2019 and Apache 24x - Configuration Guide
2019 Web
Application on
Apache 2.4.3 for
Windows®
Michael Rozlog
This write-up will cover how to configure Apache 2.4.3
for CGI communication on Windows® 10 operating
system.
dBase, LLC
Table of Contents
Getting Apache 2.4.x .................................................................................................................................. 2
1
Getting Apache 2.4.x
1. First, you need to download the latest version of Apache HTTPD project. For this
example I will be using httpd-2.4.23-x86-vc14.zip
Finding a Windows version of Apache 2.4.x is sometimes difficult. We have found that
ApacheHaus keeps things up to date and patches very frequently. It is recommended
that you use the latest version and use the VC14 or above C/C++ runtime from Microsoft.
https://www.apachehaus.com/cgi-bin/download.plx
This is the latest as of 2016 and is built for 32-bit operation and is compiled with Visual
C runtime from Microsoft 2014 edition.
2
a. There was no installer, therefore I copied the Apache24 directory to my C:\ and
will be using that as my base of my product
b. You must have the proper Microsoft C/C++ Runtime installed for this version of
Apache to work on a Windows 10 machine
Note: Binaries built on Visual C++ 2015 x86 do not run on Windows XP or
Windows Server 2003 These binaries were built with Visual Studio® 2015 x86, be
sure to install the required Visual C++ 2015 x86 Redistributable Package,
download from;
c. Now that I have copied the Apache24 directory to my root of C: I can now start
to manipulate it to work, as I desire.
3
I also recommend that you create a cmd.exe (Command Windows) to help interaction
with Apache. This can be easily done by clicking the File and selecting the command
windows.
However, before I kick off the Httpd.exe I want to change my port number for this
webserver.
4
I’m going to scroll down to the line that states: Listen 80
I’m going to change that port number to 80, so it should state Listen 8080
5
Scroll down to the ServerName line, it will say localhost:[port number] We need to
match our port number from above, in this case 8080.
ServerName localhost:8080
a. Now using the Command window we opened we can now type httpd.exe in the
window to kick off Apache:
6
You may get a Windows Firewall exception dialog. Since we are opening the port to
communicate the HTTP communication traffic we need to allow this… Press the Allow
access button.
7
Now we should test to see if our Apache webserver is up and running. Open a Browser
window and type the following:
I’m using the ApacheHaus build of the binaries so the return page looks like:
8
The big take-away is the It Works, meaning that Apache is responding.
b. There are additional commands that you can do with Apache when you start the
server:
You can shut down Apache by pressing Ctrl+C (It may take a few seconds)
httpd -k install
httpd -k start
9
Apache will then start and eventually release the command prompt window.
10
File #1: httpd-ahssl.conf
File #2: httpd-ssl.conf
b. Open both of these files and change the :443 to another port number in my case it
would be :444. Make sure to change each one of them to ensure proper start of
the httpd server/service.
c. Go to the Prior section under the a. section and try to get the httpd.exe service up
and running. Once that is running proceed to the next section.
4. First, stop the Apache Httpd.exe service running in your command window. This can
be done by pressing the ctrl-c
# documents. By default, all requests are taken from this directory, but
11
# symbolic links and aliases may be used to point to other locations.
f. After the </Directory> for the Document root we need to add the following
section:
<Directory “c:\apache24\cgi-bin”>
Options FollowSymLinks ExeCGI
AllowOverride None
AddHandler cgi-script .cgi .pl .exe
</Directory>
12
i. Type httpd in the command prompt, if it is running there should be no errors.
13
\Web
Classes // the class code is here
Samples
Source // sample source is here
cgi-bin // sample executables are here
htdocs // sample HTML is here
data // sample data is here
Param cParam1
myc = version(1)
oCGI.Connect()
ocgi.StreamBody()
catch (exception e)
oCGI.errorPage(e)
endtry
Quit
14
f. After that, do a File|Save As…
Saved it as MySimpleWeb.prg
15
h. After the Save now do a Compile and make sure it is in good shape.
16
In the Program Files pane on the left side we are going to right mouse click on
Program and select the Add Files to Project… option
Now check the ‘Web application’ option under Project tab. This puts the WEB
part in the BUILD command.
NOTE: When run, an application built using the WEB keyword will take
advantage of optimizations built into PLUSrun.exe, which allows it to
load faster and use fewer resources than a non-WEB application
No other options are needed, so you can click on the toolbar icon with the box
exe on it.
17
The project compiled and was output to a writable directory.
18
Copy the MySimple.exe and WEBCLASS.co to the c:\Apache24\htdocs
directory
19
b. Press the enter key
The simple executable only returns the runtime version back in a string. This is a
very simple hello world type application.
20