How to Configure and Publish an Alpha Anywhere Application to a server Using HTTP Publishing

Description

A step-by-step guide to configuring the Alpha Anywhere Application Server and publishing profile to publish your Alpha Anywhere Application using HTTP publish.

Discussion

This tutorial describes how to configure the Alpha Anywhere Application Server for HTTP publishing and how to create the corresponding publishing profile to publish a web application using HTTP Publish.

For publishing an application to the Alpha Anywhere Application Server for IIS, see Publishing to IIS. For Alpha Cloud, see Publishing to Alpha Cloud.

HTTP Publishing Requirements

To publish to a remote server using HTTP publishing, the following conditions must be met:

  • The Alpha Anywhere Standard Application Server is installed and running on the remote server.
  • Access to the remote server to configure the Application Server to allow HTTP publishing (if the Application Server has not been previously configured.)

Configure the Application Server to Allow HTTP Publishing

Before you can create an HTTP Publishing profile, the Alpha Anywhere Application Server must first be configured to allow HTTP Publishing. This section requires that the Alpha Anywhere Application Server is installed on the server and that you have access to modify the server's settings.

These instructions can also be used to configure the Development Server to allow HTTP publishing.

For additional details, watch the video "Configuring the Web Application Server for HTTP Publish" listed in Appendix C: Videos.

  1. Open the Server Settings.

    If you are using the development server, open the Development Server Settings. In the Alpha Anywhere Development environment, navigate to the Web Projects Control Panel. Open the Web menu and select Development Server.

    If you are using the Alpha Anywhere Application Server, launch the Application Server if it is not already running. Then, double-click the system tray icon to open the Server Settings dialog. Alternatively, you can right-click the system tray icon and select Configure Server from the context menu to open the Server Settings.

    Opening the Server Settings for the Development Server.
    Opening the Server Settings for the Alpha Anywhere Application Server.
  2. Navigate to the HTTP Publish Settings. Click the Other tab.

    The HTTP Publish settings are on the Other tab in the server settings.
  3. Before HTTP Publish can be configured, HTTP Publish must first be enabled. Check the Allow HTTP Publish? check box.

    Enable HTTP Publish by checking the "Allow HTTP Publish?" checkbox.
  4. To continue with HTTP publish configuration, the changes need to be saved. Click the Save button.

    After enabling HTTP Publish, the settings must be saved before you can configure HTTP Publish permissions.
  5. Click OK to close the confirmation dialog.

    Confirmation dialog shown if the server is running.
    Confirmation dialog shown if the server is stopped.
  6. Next, optionally specify the folder where the data should be published on the server. If this value is left blank, data will be published in the same directory as the configuration XML file for the server.

    The HTTP Data Folder is where data, such as DBF tables, is published.
  7. Next, you need to configure the HTTP Publish Permissions. The HTTP Publish Permissions control who can and cannot publish to the server. You can also specify file restrictions to disallow certain file types from being published to the server.

    Click the Set HTTP Publish Permissions button to open the Configure HTTP Permissions dialog.

    The HTTP Publish Permissions define the location and types of files that can be published.
  8. In the Configure HTTP Permissions dialog, click Enter New User to create a new user account.

    In order to publish using HTTP, a user profile must be created.
  9. Enter the User name. The User Name must be between 6 and 40 characters in length and may only contain Numbers and Letters.

    Define the User Name for the new user profile.
  10. Enter the Password for the user account. The password must be between 6 and 20 characters in length and only contain letters and numbers. The Password must also contain one lowercase letter, one uppercase letter, and a number.

    Define a password for the new user profile.
  11. Next, you need to assign the Folder permissions for the User account. Click the Add link to add folder permissions.

    At least one folder must be specified for a user profile.
  12. The Folder permissions define the folders files can be published to by the user account using HTTP publish. A user account can have access to any directory in the webroot or one or more specific folders. In addition, you can also explicitly deny publishing to specific folders or the entire webroot by unchecking the Allow Publish? checkbox for the selected folder.

    For this example, we will create a user with full access to the webroot. Select <webroot> from the dropdown box. Make sure Allow Publish? is checked and click OK.

    A folder can be configured to allow or deny publishing to the location.
    See Appendix A: Configuring User Publishing Permissions for tips on defining user access.
  13. The user profile is now configured to allow publishing to the server's webroot, including any folder in the webroot. Click OK to save the User profile.

    A completed user profile that allows publishing to the webroot.
  14. In addition to configuring user publishing permissions, you can also restrict the types of files published using HTTP publishing. Click the Restricted File Types link to open the Restricted File Types dialog.

    File types can be restricted by specifying "Restricted File Types".
  15. In the Restricted File Types dialog, you can define a set of file types that cannot be published to the server. Select the file types from the list provided or add your own types using the Add Type link. Files that are restricted from HTTP publishing cannot be uploaded to the server.

    Optionally, select on or more file extensions, adding your own as desired, to restrict from HTTP publishing. Click OK to save the settings.

    The Restricted File Types dialog.
  16. Click OK to save the HTTP Publish Authorization configuration.

    Save the HTTP Publish configuration.
  17. If the Application Server is running, you must restart the server to apply the new HTTP Publish configuration. Click the Restart Server button to restart the server.

    If the server is not running, you must start the server in order to publish a web application to the server using HTTP publish. Click Start Server to start the server.

    Close the Server Settings dialog when the server has finished starting or restarting.

    Start or restart the server. The Server must be running in order to publish an application using HTTP Publish.

Now that the Alpha Anywhere Application Server is configured to allow HTTP Publishing, you can create a publishing profile to publish your web application to the server.

Configure the Publishing Profile

The Publishing Profile describes where web application files will be published in the Application Server's webroot, either locally or on a server. During the publishing process, the project files for the web application are compiled and copied to the webroot for the Application Server. This section describes how to configure a project to publish an application to a server running the Alpha Anywhere Application Server that has been configured to allow HTTP publishing.

This tutorial is also available as a video titled, "Creating an HTTP Publishing Profile". Visit Appendix C: Videos for more information.
The Alpha Anywhere Application Server must be running in order to validate credentials while creating the HTTP Publish profile.
  1. From the Web Projects Control Panel, open the Web menu and select Project Settings... to open the Web Project Profiles dialog.

    Open the Web Project Profiles dialog.
  2. Click Add New Profile to create a new publishing profile.

    Create a new profile.
  3. Select HTTP and click Next

    Select "HTTP" to create an HTTP Publish profile.
  4. Enter the Server URL. The server URL should be an http or https address. If the server uses a port other than port 80 (http) or port 443 (https), you must include the port number in the URL.

    Enter the Server URL.
  5. Click Test URL to test the URL. If the test fails, check to make sure the Alpha Anywhere Application Server is running and test the URL again.

    Success! The URL specified for the server is correct.
  6. Next, enter the User Name, Password, and Target folder. This is user name and password for the user account you created in Configure the Application Server to Allow HTTP Publishing.

    The Target Folder is the location in the server's webroot where the files will be published. If no folder is specified, files will be published directly to the webroot.

    Specify the HTTP publish credentials and target folder.
    The user must have permissions to publish to the specified target folder. If no folder is specified, the user must have permissions to publish to the server's webroot.
  7. Test the HTTP Login credentials to verify they are correct. Click the Test HTTP Login button. If the test fails, verify that the user has permissions to publish to the specified target folder. Re-enter the user credentials and run the test again.

    Success! The specified user credentials are correct.
    Test HTTP Login does not validate if the user has permissions to publish to the specified Target Folder.
  8. Click Finish to create the HTTP publishing profile.

  9. When prompted, enter a name for the profile. Choose a name that identifies this profile as a publishing profile to the server.

    Name the HTTP publishing profile.
  10. Next, you need to configure any Aliases, Alpha DAO connection strings, Named Resource Providers, and Web Socket Settings that are required by the web application.

    Select the publishing profile you just created.

    Configuring the new HTTP Publish profile.
  11. If your web application uses Aliases for paths and connection strings, you must define the published Aliases that will be used by the web application. Aliases are defined relative to the server file system. Click the button for Aliases to define the paths relative to the server for published Aliases. This is where you can define the [PathAlias.ADB_Path] alias for the data folder.

    Define Path and Connection Aliases for the Web Project.
  12. If your web application uses any Named Alpha DAO connection strings, you must define the AlphaDAO Connection strings the server will use. In a typical development environment, Named AlphaDAO connection strings will reference a database running on the development system. When published, the Named AlphaDAO connection strings must be modified to reference the production database that will be used by the published application. If your application uses DBF databases, the Named AlphaDAO connection strings must reference the published DBF files on the server.

    Connection strings are defined relative to the server. Click the button for the Named AlphaDAO connection strings property to define the connection strings that will be used by the web application when published to the server.

    Define the published connection string for Named AlphaDAO connections used by your web application.
    You MUST define the published connection string for any Named AlphaDAO connection strings used by your application.
  13. If your application uses Named Resource Providers, define the Named Resource Providers relative to the server. Click the button for the Named Resource Providers property to define the named resources.

  14. If your application uses Web Sockets, configure the Web Socket Setting for the publishing profile. Click the button for the Web Socket Settings property to define the web socket settings for the server.

  15. Define or adjust any other settings required in the publishing profile. You can come back to the Web Project Profiles dialog at any time to make adjustments if you find that a setting is missing or incorrect.

  16. Click OK to save your changes and close the Web Project Profiles dialog.

  17. If your application uses Named Alpha DAO connection strings and you did not define the published connection strings in the Publishing Profile, you may see the error message below. Click Edit AlphaDAO Connection Strings Now to define the connection strings for the Named Alpha DAO connection strings used by your application. Your published application may fail to work if you do not define the published connection string for the Named AlphaDAO connection strings.

    If your application does not use any of the Named AlphaDAO connection strings to connect to data sources, you can ignore this message.

    Opening the Publish Web Project dialog.
    Named AlphaDAO connection strings must be defined to reference the production data source in a published application.

Now that you have configured the publishing profile, the next step is to publish your application and open it in a web browser.

Publish Your Application

Alpha Anywhere web applications are deployed using the Publish Web Project dialog. Applications can be published locally on your development machine or to a server. In addition to deploying your project, publishing is also a useful tool for testing your application. Testing can be done locally on the development machine or on a server. The following instructions explain how to publish to the server using the publishing profile you just created.

  1. From the Web Projects Control Panel, click Publish on the toolbar.

    Open the Publish Web Project dialog.
  2. The Publish Web Project dialog is used to configure what is published to the destination defined by the publishing profile.

    Select the publishing profile you created from the Select profile dropdown. Select the All files in project option to publish all files in the project. Check the boxes for Publish Web Project files and Publish new or modified files only.

    If your application uses Reports defined in the Control Panel - not as separate .a5rpt files - check the box for Publish Workspace Library (contains SQL Report definitions).

    If your application has functions defined on the Control Panel (this is separate from the Web Projects Control Panel, check the box for Compile functions into an .AEX file?.

    Publish Web Project settings
  3. If your application uses Web Security, publish the Web Security files. Select Publish Data Tables -- Publish security tables. from the Publish Web Security Data dropdown box.

    You only need to publish the Web Security tables once to your server. Once the tables have been published, choose Ignore -- Do not publish security data. on subsequent publishes to the server.
  4. If the server is a testing server to which you will be making frequent changes, optionally check Save these settings as your Quick Publish settings. You can Quick Publish your project by clicking the Quick publish project link below the left column on the Web Projects Control Panel.

    Quickly publish a project using the Quick Publish project link on the Web Projects Control Panel in the left-hand column.
  5. Click the Publish button to being publishing the web project to the server.

  6. Alpha Anywhere will display the list of files to publish in the Files to be Published dialog. This dialog is for informational purposes only. While you can edit the text in the dialog, it does not change the files published to the server.

    Click OK to continue.

    List of files to be published
  7. Alpha Anywhere will display a notice when publishing is complete. Click OK to close the notice.

    Notification that publishing is complete

Viewing Your Published Application

To view your published application, open the web browser and type in the address for a page that was published. The address is a combination of the Base URL and page name.

The Base URL for an application published using HTTP Publish is a combination of the Server URL and the Target Folder.

For example, if the Server URL is http://www.myapp.com and the web project was published to a Target Folder called app1 in the webroot, the Base URL for the published application would be:

http://www.myapp.com/app1

If the target web server doesn't use port 80 (http) or 443 (https), you must also remember to include the port number (which should already be included in the Server URL for the HTTP Publish profile.) The image below is an example of a Server URL that contains a port number.

The configuration shown is for connecting to the Development server for HTTP publishing. The Development server is configured to listen on port 8080. The Server URL for connecting to the Development server is http://localhost:8080.

The HTTP publishing configuration also includes a Target Folder, HttpPublishTest.

The Server URL and Target Folder compose the Base URL for the published application.

Both the Server URL and Target Folder are combined to form the Base URL for the application: http://localhost:8080/HttpPublishTest. Using the Base URL, you can access the pages published to the server from a web browser. For example, if you wanted to view the published "testPage.a5w" for the web application, you would open a web browser and type the following into the address bar:

http://localhost:8080/HttpPublishTest/testPage.a5w
Viewing the published testPage.a5w on the server.

You can also specify a page open in the default web browser after publishing completes in the Publish Web Project dialog. Check the box for Launch browser after files are published and select the page to display from the Page to show dropdown box. When Alpha Anywhere finishes publishing the application, the web browser will be launched and the specified page will be shown.

Launch browser after files are published.

Appendix

 Appendix A: Configuring User Publishing Permissions

HTTP Publishing Permissions define what folders a User has permissions to upload or "publish" files from Alpha Anywhere. A user can be granted full access to the entire webroot or individual folders in the webroot. Users can also be expressly denied publishing permission to specific folders or the entire webroot.

Configuring folder permissions.
  •  Granting Full Access

    This user has permissions to publish to any directory in the server's webroot using HTTP publish.
  • A user account has full publishing access if they have permissions to publish to the webroot. To configure access to webroot publishing, you must add the webroot folder with Allow Publish enabled. The configuration is listed below:

    Folder Setting
    Value
    Folder
    <webroot>
    Allow Publish?
    Checked (enabled)
  • A user that has permissions to publish in the server webroot can create new directories when publishing an application to the server.

  •  Granting Restricted Access

    This user can only publish files to the "example" directory on the server.
  • Granting restricted publishing permissions can be done by specifying one or more specific folders in the webroot. For example, if you wanted to restrict a user account such that they could only publish to a directory called "AppB" in the webroot, you would configure the folder settings as follows:

    Folder Setting
    Value
    Folder
    AppB
    Allow Publish?
    Checked (enabled)
  • The folder does not need to exist on the server when specifying publishing permissions. The folder will be created when files are published to the server.

    Restricting publishing to specific folders both prevents you from overwriting applications that may have been published to other directories on the application server and guarantees that files will only be published to a specific directory in the webroot. A user account that has access to an explicit folder cannot publish to any other folder in the server's webroot.

  •  Denying Access

    This user cannot publish any files to the server.
  • In addition to restricting publishing to one or more folders in the webroot, you can also deny publishing to any folder on the server by disabling Allow Publish? for a folder or the entire webroot. For example, the following configuration denies publishing to any folder on the server:

    Folder Setting
    Value
    Folder
    <webroot>
    Allow Publish?
    Unchecked (disabled)
  • Disabling publishing is useful if you want to temporarily disable publishing for a user account without losing authentication information.

 Appendix B: Testing Connection Strings on the Server

The Alpha Anywhere Standard Application Server can be used to create and verify the published connection string(s) needed by the application. On the Other tab in the Application Server Settings, the Open the Connection String Builder Genie link opens a dialog that can be used to create and test a connection string on the server to verify the connection string is valid before adding it to the publish profile. To learn more, see How to Test Connection Strings on the Application Server.

 Appendix C: Videos

Configuring the Web Application Server for HTTP Publish

When publishing applications to a server, you can choose to use FTP or HTTP to do the file transfer work. The HTTP Publish option provides more options than FTP, including the ability to restrict who can publish to the server and restrict the types of files that can be uploaded. This video explains how to configure the Alpha Anywhere Application Server to allow HTTP publishing.

2016-03-02

Creating an HTTP Publishing Profile

A Publishing Profile defines how web applications are published to a server. There are several ways an application can be published to a server, including HTTP. This video explains how to create an HTTP Publishing profile in Alpha Anywhere to publish a web application to a server configured to allow HTTP publishing.

2016-03-02

See Also