How to install CXP with Apache Web Server

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

How to install CXP with Apache Web Server

#1 Post by rdonnay »

These instructions are specifically for Wamp Apache. This is the version of Apache that installs with Wamp Server. Wamp Server includes Apache, PHP and MySQL because this is one of the most popular installations for a variety of applications, including PhpBB3, the Donnay Software Web Forum. However, with minor modifications, these instructions apply to any installation of Apache.

If you follow these installation instructions step-by-step, you should get up and running very quickly.

1. Install Xbase++ 2.0 on a workstation or your server. It is not necessary to have the complete Xbase++ installation on your server. All that is needed on the server is the CXP20 folders.

2. After the Xbase++ 2.0 installation is complete, locate the following folder: C:\Program Files (x86)\Alaska Software\cxp20

3. Create a new folder on your server named C:\cxp20, then copy the entire C:\Program Files (x86)\Alaska Software\cxp20 folder, including sub-directories to the new C:\cxp20 folder on your server.

4. Locate the following folder on your workstation or server: C:\inetpub\wwwroot. If you installed CXP when you installed Xbase++ 2.0, then the installation program will have copied some CXP files to this folder. The file cxpinfo.cxp will be installed to c:\inetpub\wwwroot only if IIS is installed.

5. Locate the following folder on your server: C:\wamp\www. This is the root folder for Apache. It is defined
in the httpd.conf file of Apache as the root folder with the DocumentRoot entry. If you not using WAMP, then it will be defined as a different location.

6a. Copy all *.CXP files in the C:\inetpub\wwwroot folder to the C:\wamp\www folder on your server.
If there is a c:\inetpub\wwwroot\cxp-application folder it does NOT need to be copied to your server. This folder is automatically maintained by CXP. That folder does not even exist if the cxpinfo.cxp page was not executed previously.

6b. Copy the c:\inetpub\wwwroot\websamples folder to the c:\wamp\www folder on your server. The websamples provide a source of information illustrating usage and filling gaps where the documentation is weak.

7. Download the following file from the Apache website: http://www.apache.org/dist/httpd/binari ... 32-x86.zip then extract the mod_fcgid.so file into the C:\wamp\bin\apache\apache2.2.22\modules folder on the server. This is the module that handles FastCGI.

8. Run the C:\cxp20\bin\apachecfg.exe with the following parameters: -i -c=C:\wamp\bin\apache\apache2.2.22 -n=c:\cxp20\bin\cxp-worker.exe. This will create a backup of your c:\wamp\bin\apache\apache2.2.22\conf\httpd.conf file and will add new entries that will enable the CXP system and FastCGI. Hint: apachecfg.exe -h prints the usage of the tool.

9. Stop and restart your wampApache service. Note: this may not be necessary if Apache is already running because apachecfg.exe normally restarts the service. It will only be necessary if you had to make additional modifications to your httpd.conf file (which is not recommended).

10. Open a web browser on your server and navigate to http://localhost/cxpinfo.cxp. This should show your first CXP page. After you confirm that everything is running ok, then navigate to http://localhost/websamples/index.cxp to run the sample selection.

NOTE: If you did not get Apache from the WAMP installation, then the Apache system will have a different installation folder on your server and may also be a different version. The above instructions are for WAMP Apache 2.22.22.
Just modify the instructions to accommodate your directory structure.

KNOWN ANOMOLIES:

When calling the CXP page from the web browser, Apache is case sensitive.
This would not work: DD787.Cxp
This would work: DD787.cxp

The CXP page cannot be given the same name as the root directory.
This will cause an Internal Error: localhost/dd787/dd787.cxp
This will work: localhost/dd787/rsvp787.cxp
The eXpress train is coming - and it has more cars.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: How to install CX/P with Apache Web Server

#2 Post by skiman »

Hi Roger,

I'm wondering why you want to use the CX/P instead of Xb2net? What are the advantages of this? What could be acoomplished that can't be done by Xb2net.

The main advantage of XB2Net is the quick and easy installation. No struggle with Apache or IIS.

Maybe Alaska showed some fantastic things in Arizona? Which makes CX/P the way to go?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to install CXP with Apache Web Server

#3 Post by rdonnay »

Chris -

I like to learn new ways to do things.
I have always been a strong supporter and user of Xb2.Net but I now want to learn more, and even simpler approaches.

I have been working with httpEndPoint and WebHandler from Xbase++ 2.0. It can handle many of the small projects that I currently use Xb2.Net for. In fact, I was able to convert my website from an Xb2.Net application to using Xbase++ 2.0 only and no other web server. I did this in one weekend. I will post the source code for the website when it is completed. I still have a few more hours of work to do.

As far as CXP is concerned, it now rivals PHP and ASINET as a development platform for large and robust web applications. I already had Apache installed and running on my server. It was simple to add CXP support, so now I can run code written in PHP or Xbase++.

I am only getting started with this, but I expect to also have a CXP version of my website completed soon. It's time for a major redesign. I want to use more JQuery too.

You will see the advantages over time as I post CXP code snippets here on the forum.

What I like most about CXP pages is that they are "dynamic". Just like PHP and ASP pages, they don't require recompiling and linking your application whenever you make small (or even large) changes to your CXP source code. This is done automatically by cxp-worker.exe. When the web server receives a request to load a *.CXP file, it calls cxp_worker.exe via fastCGI. If the file date/time has changed since it was last loaded, it will be automatically recompiled and relinked into a .DLL. Thus, .CXP files can be updated as simply and quickly as .HTM files, even remotely, and then deployed to the server.

Here are a bunch of Web Samples created by Alaska Software.
They reside in my c:\www\wamp\websamples folder as lots of .CXP files.

http://bb.donnay-software.com/websamples/index.cxp
The eXpress train is coming - and it has more cars.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: How to install CXP with Apache Web Server

#4 Post by skiman »

Hi Roger,

It looks as I have to check this. I'm impressed with the samples. I didn't had the time to check them, but now it all makes sense.

I did some testing with AngularJS the last months, in combination with webservices. With the CXP, there is no need for webservices, and the CXP contains all the logic. This way it is a lot easier to 'read' the source code, and to see what happens.

This looks very exiting, and could give a boost to a lot of developers who needs a webbased application.

Looks as the long wait on Xbase++ 2.0 could be rewarded now. :)

Thanks for your tests and your trigger to think about this.
Best regards,

Chris.
www.aboservice.be

User avatar
PedroAlex
Posts: 230
Joined: Tue Feb 09, 2010 3:06 am

Re: How to install CXP with Apache Web Server

#5 Post by PedroAlex »

Roger.

http://bb.donnay-software.com/websamples/index.cxp

this is what I need.
Excellent work.

I'll watch this new topics.

Thank you
Pedro
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to install CXP with Apache Web Server

#6 Post by rdonnay »

I found these anomolies today.

When calling the CXP page from the web browser, Apache is case sensitive.
This would not work: DD787.Cxp
This would work: DD787.cxp

The CXP page cannot be given the same name as the root directory.
This will cause an Internal Error: localhost/dd787/dd787.cxp
This will work: localhost/dd787/rsvp787.cxp
The eXpress train is coming - and it has more cars.

Post Reply