Setting up the WebDev Application Server on a Windows 2012 Cloud Server

Setting up the WebDev Application Server on a Windows 2012 Cloud Server

In Part one you setup a Windows 2012 Cloud Server on Rackspace, then in Part two you installed HyperSQL and an SCM database. Now its time to install the WebDev WAS (Web Application Server). Remember there is a similar serious of articles for Linux servers on my site.

Note: I ran into some performance issues with WebDev and Windows 2012. Be sure to read the summary article at http://www.thenextage.com/wordpress/linux-and-windows-2012-webdev-cloud-servers-the-summary/ and especially the comments at the end, before deciding if you want to build a 2008 or 2012 Windows server.

Install the WAS Sever

When you purchase the WAS server (You can find the US distributor here), you have to purchase either the Windows or the Linux version. Naturally since you are setting up a Windows server, you will want to purchase the Windows version. The zip file contains a PDF file with instructions, the install application. I used both the PDF instructions that came with the install, the WebDev cookbook that Tim from WinDev US was kind enough to provide to wxlive.us, a whole lot of Google and a few chickens and candles to complete the setup.

Copy the install files to the server. Just as you did with the HyperFileSQL install, use FTP to upload the install to the server.

Remember that FTP users home folder is the document root directory of the webserver, so use File Explore to navigate to C:Apache24htdocs then run the install. Since you are working on a 64 bit server, selected the install from the US64 directory.

The install will now launch and the license screen will be displayed, accept it and click next.

Accept the default install location on the next screen and click next.

When asked allow it to create the directory.

Next you need to provide your serial number. Sorry I took the screen shot before keying mine in 🙂

Choose Complete on the next screen and click next.

Take the default location for the AWP Manager and press next.

The next screen will tell you all about the requirements for using IIS 7. Since you are using Apache, and have your Uncle Pete along as a guide, just click next.

The next screen gives you a choice of web servers to install. Select Apache and click next. Don’t worry about it saying its not found you are going to handle that on the next screen.

Because you are using a “right out of the oven” version of Apache, WebDev doesn’t recognize it on its own, so you need to give it a little information. Set the type of Apache setup to Other. The configuration file is located at C:Apache24confhttpd.conf, the executeable is at C:Apach24binhttpd.exe and select the service name from the drop down, which is Apache2.4. Then click next.

The next screen is asking about Secure Remote Management. Which allows you to setup the WebDev Administrator to use an SSL connection. That’s outside the scope of this article so just click next.

The next screen is asking about hosting sites created in older versions. If you had previously setup WebDev WAS 16 for instance you would have the choice of leaving both 16 and 17 active, or disabling 16 and hosting the 16 sites in 17. Since this is a new server go ahead and check Host sites in earlier version and click next.

The next screen wants to know if you want to install the HyperFileSQL ODBC drivers. Unless you will be accessing HyperFileSQL files with software on the server that was written with a product that does not have native HyperFileSQL support, you shouldn’t need them. Click next.

The next screen gives a summary of the setup options. Click next and the install will begin.

During the install you will see a command prompt window popup a few times that is the installer communicating with Apache. The install will take a few minutes when completed you will get a final options windows. Uncheck everything except: Display an icon on desktop, Display icons in Start menu, Install the service WebDev administrator.

Because you decided (well Uncle Pete told you to) go out on the bleeding edge with Windows 2012 and Apache 2.4, there is a little more configuration work to be down. The Directory directives for permissions have been changed in Apache 2.4. You can read all the gory details for yourself (like I had to!) here. What use to be written the config file as:

Order allow,deny
Allow from all

is now written as

Require all granted

And naturally WebDev is still writing the old style statements. Apache still supports the old statements for backwards compatibility, but it appears that only helps you if you use the old statements for the entire configuration of Apache. Since you installed a fresh Apache 2.4. The first set of directory directives, to lock everything down by default, are formatted like this

<Directory />
   AllowOverride none
   Require all denied
</Directory>

It seems that Require all at that level is causing the old style directives to be ignored later in the configuration file. So you have a couple of choices, you could change all of the directory directives to use the old style statements, but Apache changed them for a reason, and it seems so wrong to go backwards. The other option is to edit the WebDev generated portion of the file and change it to the new style statements.

You already edited the Apache configuration file once in the first article, this will be done the same way. Open C:Apache24confhttpd.conf with notepad. The if you scroll to the bottom of the file you will see where the WebDev portion of the file begins.

In that section replace any of the old statements with the new style statements. Some of the sections will have both lines like this

Order allow,deny
Allow from all

other sections will have only the one line like this

Allow from all

In either case replace the lines with the one line that reads like this

Require all granted

Here is the entire WebDev section of the config file after the changes have been made.

ScriptAlias /WD110AWP/ "C:/WebDev17/AWP/"
<Directory C:/WebDev17/AWP/>
    Require all granted
</Directory>
ScriptAlias /WD120AWP/ "C:/WebDev17/AWP/"
ScriptAlias /WD140AWP/ "C:/WebDev17/AWP/"
ScriptAlias /WD150AWP/ "C:/WebDev17/AWP/"
ScriptAlias /WD160AWP/ "C:/WebDev17/AWP/"
ScriptAlias /WD170AWP/ "C:/WebDev17/AWP/"
AddType application/WebDev17-awp .awp
Action application/WebDev17-awp /WD170AWP/WD170Awp.exe virtual
AddType application/WebDev17-awws .awws
Action application/WebDev17-awws /WD170AWP/WD170Awp.exe virtual
<Files WDADMINWEB170>
    ForceType application/WebDev17-awp 
    Require all granted
</Files>
<Files WDAdminWeb170>
    ForceType application/WebDev17-awp 
    Require all granted
</Files>
<Files WDADMINHF170>
    ForceType application/WebDev17-awp 
    Require all granted
</Files>
<Files WDAdminHF170>
    ForceType application/WebDev17-awp 
    Require all granted
</Files>
<Files WDADMINSAAS170>
    ForceType application/WebDev17-awp 
    Require all granted
</Files>
<Files WDAdminSaaS170>
    ForceType application/WebDev17-awp 
    Require all granted
</Files>
Alias /WDADMINWEB170_WEB/ "C:/WebDev17/WDAdminWeb/WDADMINWEB170_WEB/"
<Directory C:/WebDev17/WDAdminWeb/WDADMINWEB170_WEB/>
    Require all granted
</Directory>
Alias /WDADMINHF170_WEB/ "C:/WebDev17/WDADMINHF/WDADMINHF170_WEB/"
<Directory C:/WebDev17/WDADMINHF/WDADMINHF170_WEB/>
    Require all granted
</Directory>
Alias /WDADMINSAAS170_WEB/ "C:/WebDev17/WDSAAS/WDAdminSaaS170/WDADMINSAAS170_WEB/"
<Directory C:/WebDev17/WDSAAS/WDAdminSaaS170/WDADMINSAAS170_WEB/>
    Require all granted
</Directory>
Alias /WDSAAS170_WEB/ "C:/WebDev17/WDSAAS/WDSaaS170/WDSAAS170_WEB/"
<Directory C:/WebDev17/WDSAAS/WDSaaS170/WDSAAS170_WEB/>
    Require all granted
</Directory>

You have to restart the Apache service for the changes to take effect. You could go through the Server Manager and get to the GUI interface for Services and restart it from there. Or a faster method is to open powershell and issue the command

Restart-Service Apache2.4


To test the server you can open up the following address in your browser (replacing the server name with your server name or IP address)

http://webdevwin.thenextage.com/WD170AWP/WD170AWP.exe/version

Which will display the version information of the server, verifying the installation.

Before you go much further, switch back over to the server and use file explorer to delete the setup file from the web directory.


 

Configuring the WAS Server

Its now time to do some configuration of the server. To reach the WebDev Administator and test the installation the address is  http://webdevwin.thenextage.com/WDAdminWeb170 (your domain will naturally be different). Which will bring up the Administrator page At this point you have not changed the Admin login information, so the Username is “Admin” as well as the password. Which will log you into the administrator. Oddly the Site is not coming up defaulted to French like it did for the Linux server, guess I will need to go back and figure out why! The first step is to set the Admin password, so click on the Accounts button, then selected the admin account from the list of accounts, and press the Edit button. At the bottom of the User edit screen you will be able to reset the password. Enter the current password “admin” and then the password you desire and then click the Modifier button. That will popup a confirmation window. And that will give us a final confirmation that the password was changed. If you made a type on the passwords you will get a different message and you will have to correct your entries.

Adding a WebDev User and uploading your first site.

Setting up a user for each site, makes it easier to manage and deploy sites. For testing purposes and to see how deployment works, you are going to upload the eBusiness example provided with WebDev. So the first step is to create some directories in the C:WebDev17 folder. Using File Explorer create an “ebusiness” folder under C:WebDev17, then in the ebusiness folder create three more folders named:  site, webservice, data Now log into the WebDev Administator, click on accounts, and added a new account. Name it ebusiness, the same as the site. This creates the WebDev account and opens up a form that will allow you to make changes. You will notice that the directories you just created are specified on this screen as well. Change the maximum number of connections for all sites in this account to an appropriate value and press the Apply button. The account is now created and you are return the the Account Management Page. Now you need to create an FTP user. So run the FileZilla Administrator Interface that you set up in the first article. And choose Edit -> Users. The click Add and name the user ebusiness. (See a theme developing here?) In the next screen Enable the password field and set it to your desired password. Now switch to Shared Folders in the Left Pane, and Click Add under the Shared Folders list and add the home folder as C:WebDev17ebusiness. Be sure to turn on all of the file and directory permissions. Click OK to save the user. You can use an FTP client to test the setup now if you wish. That use should log in and see the 3 directories you just created. You are now ready to deploy the site, Run WebDev on your development machine, and open the eBusiness example. Then from the Workshop menu, chose “Deploy the Site” and from that sub-menu chose “Deploy the site remotely” This will launch a wizard to deploy the site. You can take the defaults on the first page and click next. The next page lets you select the elements to include, select everything and click next. Since this project uses an component you are given the option to include it, go ahead and select it and click next. Next is Languages, click next The next screen allows you to provide some Copyright information, change as you desire and click next. The next screen gives you the opportunity to make a backup copy of the project as a snapshot of the deployment. Skip that step and click next. When you click next, the library will be created and then a second wizard will launch for deployment. Chose “Deploy the WebDev site on a remote WebDev Application Server” and click next. The next screen needs the address for the server and the account that you just created. The account information is the same for both the WebDev and the FTP account. More than likely Active FTP will not work for you, as any NAT translation or firewall between you and the server will interfere, so click on the “Avanced parameters” button, then on the Advanced tab, set the FTP transfer mode to Passive FTP. You can now click the “Test the parameters” button and you should get a confirmation message. It took me two days to get the confirmation message, but through the magic of the web, here’s the message! After clicking the OK on the confirmation, click the green check mark to return to the main wizard screen, and click next. Which will bring up the Deployment parameters settings, change as you desire and click next. Next will list the files that will be transferred, click next. Next is settings for Automatic data modification. Set as you desire. I will resist giving my opinion about automatic data modification. (Must resist giving opinion, must resists). Ok, I managed to resist, so click next. Next is setting parameters for the site, change as desired and click next. Then you are given an option to generate a statistical file for the site, click next. And finally you reach the done screen, so click the green check mark. The site will now be transfered and activated. This can take a few minutes. The progress screen will provide some feedback about what is going on. When completed the progress window will change to Setup Completed and give you a link to test the site. If you are wondering what those warnings are my friend Google translate says they are telling you that there are not enough connections for this users for the site. (Which is because the user is setup with 100 connections but the default taken when creating the site was 150) And that you should change your setting or contact your administrator for more connections. And the line there is letting you know that the max is 100 connections. All important information and if this were a production site you would want to put some thought into the connections allowed, but for now you can move on. Remember that issue with Apache 2.4 and the Directory permissions. Well its back! When launching a site for the first time WebDev adds a few lines to the Apache configuration file. So just like before edit the C:Apahce24confhttpd.conf file and make those same “Allow from all” to “Require all granted” changes. You have to restart the Apache service for the changes to take effect. So open powershell and issue the command

Restart-Service Apache2.4

You can now test the site by opening up a browser and going to the servers address followed by the project name (http://webdevwin.thenextage.com/eBusiness in my case), go ahead and log in and play around a little.

Setting up Virtual Host for Apache

If the question hasn’t already crossed your mind, I am sure it will shorty. What’s with that long address and how to I change that?

Webdev did create a shorter URL for you when it published the site, which in this case is http://webdev.thenextage.com/eBusiness. That is the address to the server, followed by the project name, which remember is case sensitive. That’s shorter but still not perfect if you want to have an actual domain pointing to the site.

Viturtual Host is part of that answer. Virtual Host allow Apache to serve several websites from one server and IP address. The first step is to setup a DNS entry to point to the server. In this case I am adding a sub-domain pointer, but the steps would be very similar to host multiple domains as well.  From the Rackspace Control Panel, edit the DNS settings and add a new CNAME record.

After adding that entry going to http://ebusiness.thenextage.com would take you to the same webpage as webdev.thenextage.com. Which is the “Uncle Pete is a Cool Cat” test page from the first article. To have that address point to a different website, you need to make some changes to the Apache configuration. The Apache configuration file is fairly large, which makes difficult to edit, so you are going to create a separate configuration file to manage the virtual host settings. To do this edit the open the C:Apache24confhttpd.conf file with with notepad and you will find a line that reads

#Include conf/extra/httpd-vhosts.conf

And Remove the # so that the line will be active. Then save the file. Now open C:Apache24confextrahttpd-vhosts.conf with notepad and add these entries to it. Here is a copy of my file

<VirtualHost *:80>
    ServerName webdevwin.thenextage.com
    ServerAlias webdevwin.thenextage.com
   DocumentRoot "c:/Apache24/htdocs"
</VirtualHost>
<VirtualHost *:80>
    ServerName ebusiness.thenextage.com
    ServerAlias ebusiness.thenextage.com
    DocumentRoot "c:/Apache24/htdocs"
</VirtualHost>

Each Virtual Host has its own section, the first Virtual Host listed will be the default if no matches are found. ServerName is what will be search for in the Http request. If it finds a match, any Apache setting in that Virtual Host section take place. This is where you would normally put myfirstdomain.com in one Virtual Host entry, and myseconddomain.com in the second Virtual Host entry.

ServerAlias is the alias for the domain. If you are doing a full domain setup, ServerName would have myfirstdomain.com and ServerAlias would have http://www.myfirstdomain.com

DocumentRoot is where Apache will try to load the home page for the site.

After restarting Apache, you would now be able to navigate to http://ebusiness.thenextage.com/eBusiness , or if you were setting up a true domain, http://www.myfirstdomain.com/eBusiness. Getting closer but still not there. And once you start navigating the site you will still see all the ugly URLs of WebDev. If the URL’s don’t bother you then you could setup a Virtual Host like this entry

<VirtualHost *:80>
    ServerName z.thenextage.com
    ServerAlias z.thenextage.com
    DocumentRoot "C:/Apache24/htdocs"
    RedirectMatch ^/$ http://z.thenextage.com/eBusiness
 </VirtualHost>

With that setup if someone type http://z.thenextage.com then it will automatically redirect them to http://z.thenextage.com/eBusiness, and then once there the normal WB URLs will take place such as http://z.thenextage.com/EBUSINESS_WEB/UK/product.awp?P1=90&AWPIDA05683F4=5805BD122682602C2BD68DF278D4527375C47D5A

You can make it appear like your entire site just uses your primary domain name. This is accomplished with using a frameset. There are SEO considerations with framesets and there may also be issues if your website links to any external websites, many detect a frame set being used and block the link, but those are topics for another article. If you SEO and external linking issues, then you can create a index.html file like the following

<HTML><HEAD>
<META NAME="description" CONTENT="http://ebusiness.thenextage.com/eBusiness">
<META NAME="keywords" CONTENT="">
</HEAD>
<FRAMESET border=0 rows="100%,*" frameborder="no" marginleft=0 margintop=0 marginright=0 marginbottom=0>
<frame src="http://ebusiness.thenextage.com/eBusiness" scrolling=auto frameborder="no" border=0 noresize>
<frame topmargin="0" marginwidth=0 scrolling=no marginheight=0 frameborder="no" border=0 noresize>
</FRAMESET>
</HTML>

That file sets up a frame set and host the website inside the frame set, so as the URL changes on the pages, they are not displayed because that is the internal frame. The key to the file is the webaddress entered after the <frame src= , that should be the address to launch your site. Edit the C:Apache24confextrahttpd-vhosts.conf and change the DocumentRoot for the ebusines.thenextage.com entry to point to a new directory under the web root, like this:

DocumentRoot "c:/Apache24/htdocs/ebusiness"

Which means that anytime someone attempts to navigate to http://ebusiness.thenextage.com, Apache will launch C:/Apache24/htdocs/ebusiness/index.html. So create the C:/Apache24/ebusiness directory and place the index.html file outlined above in it.

Don’t forget to restart the Apache service after making changes to the config. Now if you navigate to http://ebusiness.thenextage.com, the website comes up, and as you move through the pages the address remains the same.

If you have been paying attention, you may have noticed that you now have two domains (x.thenextage.com and ebusiness.thenextage.com) both launching the same website. You could add a bit of fancy code to your site to change the logos and style based on the URL address and have the appearance of two sites, but only one code base to maintain. Again a good topic for a future article.

Note: The linux version of this article discussing launching converting the website to HyperFileSQL Client/Server and launching a second site. Most of those steps are identical so I won’t repeat them here. If you have any trouble just let me know.

Summary

So there we have it, you have a Windows 2012 Cloud Server at RackSpace, with HyperFileSQL Client / Server and Webdev, running and ready for you to create the next Facebook, Instagram, or whatever. Just be sure to remember you good ole’ Uncle Pete, when you cash in for billions.

8 thoughts on “Setting up the WebDev Application Server on a Windows 2012 Cloud Server

  1. Congratulations on your very good instructions that are very rare for webdev. I managed to install webdev on apache 2.4 thanks to your instructions. My problem is that whenever I try to debug my project from the webdev ide, before it shows the webpage, it tries to reconfigure the server and it reverts the correct settings entered by me to the settings with the old format. ( Allow order etc…) So the server works until I restart the apache server and it loads the newly configured wrong settings. So I have to change them again and restart apache. Is there a way to disable automatic server configuration every time I debug the project? Thank you very much and keep up the good work!

    Like

    1. Sorry I have never done remote debugging on any of my servers, so I have not experienced this. For my production enviroments I have settled on using Apache 2.2 for now. 2.4 doesn’t offer me enough to make it worth the hassles of WebDev not knowing about the new keyword format. Hopefully they will support 2.4 sometime soon.

      Like

    1. I am not sure I understand the question. If you host (or you are using pcSoft Cloud hosting) I would assume they provide you the license, but you need to check with them.

      If you are creating a true virtual server then you would need a license.

      Like

  2. Congratulations Pete, Excellent stuff …

    I posted the reference of your material on the official forum of PCSoft here in Brazil

    Adriano Boller

    Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s