Under 'Activity controls,' tap Web & App Activity. Turn Web & App Activity on or off. When Web & App Activity is on: You can check the box next to 'Include Chrome history and activity from websites and apps that use Google services.' When this box is checked, you can control whether app activity from your device is saved. This very simple app just sends audio from the mic to the speaker, plug it into your computer or whatever using a 3.5mm male to male headphone jack and you get a free mic. It isn't possible to make a lag free mic on Android yet, but it's good enough for emergency use. Glide turns spreadsheets into beautiful, easy-to-use apps, without code. Pick a spreadsheet or start with a template, customize your app, then share it instantly with anyone. Start today for free!
This chapter provides instructions on how to use the Coherence*Web WebInstaller to install Coherence*Web for Java EE applications on a variety of different application servers.
Before Proceeding:
Consult the 'Supported Web Containers' to see if you must perform any application server-specific installation steps.When deploying Coherence*Web on WebLogic Server you now have two options:
Use the WebInstaller approach described in this chapter
Use the SPI-based installation for WebLogic Server 11gR1 or later. See Chapter 2, 'Using Coherence*Web with WebLogic Server.'
Coherence*Web can be enabled for Java EE applications on several different Web containers. To do this, you must run the ready-to-deploy application through the automated Coherence*Web WebInstaller before deploying it. The automated installer prepares the application for deployment. It performs the installation process in two discrete steps: an inspect step and an install step. For more information on what the installer does during these steps, see 'How the Coherence*Web Installer Instruments a Java EE Application'.
The installer can be run either from the Java command line or from Ant tasks. The following sections describe the Java command line method. For Ant task-based installation, see 'Coherence*Web WebInstaller Ant Task'.
All of the Web containers listed in 'Supported Web Containers' that can be installed with the WebInstaller share the same general installation instructions. These instructions are described in 'General Instructions for Installing Coherence*Web Session Management Module'.
A few of the Web containers, such as Caucho Resin, and WebLogic 10.x, require extra, container-specific steps that you must complete before starting the general installation procedure. The following sections describe application server-specific installation steps.
Complete the following steps to install the Coherence*Web Session Management Module into an Oracle WebLogic 10-10.2 server:
From within the Coherence library directory, extract the coherence-web.jar
from the webInstaller.jar
:
This command extracts the coherence-web.jar
file into a subdirectory named web-install
. Use the following commands to move the coherence-web.jar
file up one level into the library directory:
On Windows:
On UNIX:
For each WebLogic 10.x installation that will be running in the server cluster, update the libraries using the following command:
For example, on Windows:
Follow the instructions described in 'General Instructions for Installing Coherence*Web Session Management Module' to complete the installation. Use the value WebLogic/10.x
for the server type.
Complete the following steps to install the Coherence*Web Session Management Module into a Caucho Resin 3.1.x server:
From within the Coherence library directory, extract the coherence-web.jar
from the webInstaller.jar
:
This command extracts the coherence-web.jar
file into a subdirectory named web-install
. Use the following commands to move the coherence-web.jar
file up one level into the library directory:
On Windows:
On UNIX:
For each Resin installation that will be running in the server cluster, update the libraries using the following command:
For example, on Windows:
Follow the instructions described in 'General Instructions for Installing Coherence*Web Session Management Module' to complete the installation. Use the value Resin/3.1.x
for the server type.
Complete the following steps to install Coherence*Web for a Java EE application on any of the Web containers listed under 'Supported Web Containers'.
If you are installing Coherence*Web for a Java EE application on an Apache Tomcat Server, see also 'Enabling Sticky Sessions for Apache Tomcat Servers' for additional instructions.
If you are installing Coherence*Web for a Java EE application on IBM WebSphere Server, see also 'Decoding URL Session IDs for IBM WebSphere 7.x Servers' for additional instructions.
To install Coherence*Web for the Java EE application you are deploying:
Make sure that the application directory and the .ear
file or .war
file are not being used or accessed by another process.
Change the current directory to the Coherence library directory (%COHERENCE_HOME%lib
on Windows and $COHERENCE_HOME/lib
on UNIX).
Make sure that the paths are configured so that Java commands will run.
Complete the application inspection step by running the following command. Specify the full path to your application and the name of your server found in Table 1-1 (replacing the <app-path>
and <server-type>
with them in the command line below):
The system will create (or update, if it already exists), the coherence-web.xml
configuration descriptor file for your Java EE application in the directory where the application is located. This configuration descriptor contains the default Coherence*Web settings for your application recommended by the installer.
If necessary, review and modify the Coherence*Web settings based on your requirements.
You can modify the Coherence*Web settings by editing the coherence-web.xml
descriptor. Appendix A, 'Coherence*Web Context Parameters,' describes the Coherence*Web settings that can be modified. Use the param-name
and param-value
subelements of context-param
to enable the features you want. The following list provides some examples of different settings:
The setting inTable 3-1 will cluster all ServletContext
('global') attributes so that servers in a cluster share the same values for those attributes, and also receive the events specified by the Servlet Specification when those attributes change:
Table 3-1 Settings to Cluster ServletContext Attributes
Parameter | Value |
---|---|
|
|
|
|
The setting in Table 3-2 allows an application to enumerate all of the sessions that exist within the application, or to obtain any one of those sessions to examine or manipulate:
Table 3-2 Settings to Enumerate All Sessions in the Application
Parameter | Value |
---|---|
|
|
|
|
The setting in Table 3-3 enables you to increase the length of the HttpSession
ID, which is generated using a SecureRandom
algorithm; the length can be any value, although in practice it should be small enough to fit into a cookie or a URL (depending on how session IDs are maintained.) Increasing the length can decrease the chance of a session being purposefully hijacked:
Table 3-3 Settings to Increase Length of HTTPSession ID
Parameter | Value |
---|---|
|
|
|
|
By default, the HttpSession
ID is managed in a cookie. If the application supports URL encoding, set the option described in Table 3-4 to enable it:
Table 3-4 Settings to Support URI Encoding
Parameter | Value |
---|---|
|
|
|
|
Complete the Coherence*Web application installation step by running the following command, replacing <app-path>
with the full path to your application:
The installer requires a validcoherence-web.xml
configuration descriptor to reside in the same directory as the application.
Deploy the updated application and verify that everything functions as expected, using the lightweight load balancer provided with the Coherence distribution. Remember that the lightweight load balancer is not a production-ready utility, in contrast to the load balancer provided by WebLogic Server.
Enabling Sticky Sessions for Apache Tomcat Servers
If you want to employ sticky sessions for the Apache Tomcat Server, you must configure the jvmRoute
attribute in the server's server.xml
file. You can find more information on this attribute at this URL:
Decoding URL Session IDs for IBM WebSphere 7.x Servers
If set to true
, the coherence-session-urldecode-bycontainer
context parameter allows the container to decode the URL. This context parameter must be set to false
if you are installing Coherence*Web for a Java EE application on release 7.x of the IBM WebSphere application server. Instead of the WebSphere application server, Coherence*Web will handle the decoding of session IDs.
The Coherence*Web WebInstaller, when run for the WebSphere 7.x application server type, will automatically set this parameter to false
unless you explicitly set it to true
.
The Coherence*Web WebInstaller Ant task enables you to run the installer from within your existing Ant build files.
This section contains the following information:
To use the Coherence*Web WebInstaller Ant task, add the task import statement illustrated in Example 3-1 to your Ant build file. In this example, ${
coherence.home
}
refers to the root directory of your Coherence installation.
Example 3-1 Task Import Statement for Coherence*Web WebInstaller
The following procedure describes the basic process of installing Coherence*Web into a Java EE application from an Ant build.
Build your Java EE application as you normally would.
Run the Coherence*Web Ant task with the operations
attribute set to inspect
.
Make any necessary changes to the generated Coherence*Web XML descriptor.
Run the Coherence*Web Ant task with the operations
attribute set to install
.
If you are performing iterative development on your application (such as modifying JSPs, Servlets, static resources, and so on), use the following installation process:
Run the Coherence*Web Ant task with the operations
attribute set to uninstall
, the failonerror
attribute set to false
, and the descriptor
attribute set to the location of the previously generated Coherence*Web XML descriptor (from Step 2 above).
Build your Java EE application as you normally would.
Run the Coherence*Web Ant task with the operations
attribute set to inspect
, install
and the descriptor
attribute set to the location of the previously generated Coherence*Web XML descriptor (from Step 2 above).
To change the Coherence*Web configuration settings of a Java EE application that has Coherence*Web installed, use this procedure:
Run the Coherence*Web Ant task with the operations
attribute set to uninstall
and the descriptor
attribute set to the location of the Coherence*Web XML descriptor for the Java EE application.
Change the necessary configuration parameters in the Coherence*Web XML descriptor.
Run the Coherence*Web Ant task with the operations
attribute set to install
and the descriptor
attribute set to the location of the modified Coherence*Web XML descriptor (from Step 2).
Table 3-5 describes the attributes that can be used with the Coherence*Web WebInstaller Ant Task.
Table 3-5 Coherence*Web WebInstaller Ant Task Attributes
Attribute | Description | Required? |
---|---|---|
app | Path to the target Java EE application. This can be a path to a WAR file, an EAR file, an expanded WAR directory, or an expanded EAR directory. | Yes, if the |
backup | Path to a directory that holds a backup of the original target Java EE application. This attribute defaults to the directory that contains the Java EE application. | No |
descriptor | Path to the Coherence*Web XML descriptor. This attribute defaults to | No |
failonerror | Stop the Ant build if the Coherence*Web installer exits with a status other than 0. The default is | No |
nowarn | Suppress warning messages. This attribute can be either | No |
operations | A comma- or space-separated list of operations to perform; each operation must be one of | Yes |
server | The alias of the target Java EE application server. | No |
touch | Touch JSPs and TLDs that are modified by the Coherence*Web installer. This attribute can be either | No |
verbose | Show verbose output. This attribute can be either | No |
Inspect the myWebApp.war
Web application and generate a Coherence*Web XML descriptor called my-coherence-web.xml
in the current working directory:
Install Coherence*Web into the myWebApp.war
Web application using the Coherence*Web XML descriptor called my-coherence-web.xml
found in the current working directory:
Uninstall Coherence*Web from the myWebApp.war
Web application:
Install Coherence*Web into the myWebApp.war
Web application located in the /dev/myWebApp/build
directory using the Coherence*Web XML descriptor called my-coherence-web.xml
found in the /dev/myWebApp/src
directory, and place a backup of the original Web application in the /dev/myWebApp/work
directory:
Install Coherence*Web into the myWebApp.war
Web application located in the /dev/myWebApp/build
directory using the Coherence*Web XML descriptor called coherence-web.xml
found in the /dev/myWebApp/build
directory. If the Web application has not already been inspected (that is, /dev/myWebApp/build/coherence-web.xml
does not exist), inspect the Web application before installing Coherence*Web:
Reinstall Coherence*Web into the myWebApp.war
Web application located in the /dev/myWebApp/build
directory, using the Coherence*Web XML descriptor called my-coherence-web.xml
found in the /dev/myWebApp/src
directory:
Coherence comes with a light-weight software load balancer; it is intended only for testing purposes. The load balancer is very easy to use and is very useful when testing functionality such as session management.
Start multiple application server processes on one or more server machines, each running your application on a unique IP address and port combination.
Open a command (or shell) window.
Change the current directory to the Coherence library directory (%COHERENCE_HOME%lib
on Windows and $COHERENCE_HOME/lib
on UNIX).
Make sure that paths are configured so that Java commands will run.
Start the software load balancer with the following command lines (each of these command lines makes the application available on the default HTTP port 80
).
For example, to test load-balancing locally on one machine with two application server instances on ports 7001
and 7002
:
To run the load-balancer locally on a machine named server1
that load balances to port 7001
on server1
, server2
, and server3
:
Assuming the above command line, an application that previously was accessed with the URL http://server1:7001/my.jsp
would now be accessed with the URL http://server1:80/my.jsp
or just http://server1/my.jsp
.
Note:
Make sure that your application uses only relative re-directs or the address of the load-balancer.Table 3-6 describes the command line options for the load balancer:
Table 3-6 Load Balancer Command Line Options
Option | Description |
---|---|
backlog | Sets the TCP/ IP accept backlog option to the specified value, for example: |
random | Specifies the use of a random load-balancing algorithm (default). |
roundrobin | Specifies the use of a round-robin load-balancing algorithm |
threads | Uses the specified number of request/ response thread pairs (so the total number of additional daemon threads will be two times the specified value), for example: |
During the inspect step, the Coherence*Web WebInstaller performs the following tasks:
Generates a template coherence-web.xml
configuration file that contains basic information about the application and target Web container along with a set of default Coherence*Web configuration context parameters appropriate for the target Web container. See Appendix A, 'Coherence*Web Context Parameters' for descriptions of all possible parameters.
If an existing coherence-web.xml
configuration file exists (for example, from a previous run of the Coherence*Web Installer), the context parameters in the existing file are merged with those in the generated template.
Enumerates the JSPs from each Web application in the target Java EE application and add information about each JSP to the coherence-web.xml
configuration file.
Enumerates the TLDs from each Web application in the target Java EE application and adds information about each TLD to the coherence-web.xml
configuration file.
During the install step, the Coherence*Web WebInstaller performs the following tasks:
Creates a backup of the original Java EE application so that it can be restored during the uninstall step.
Adds the Coherence*Web configuration context parameters generated in Step (1) of the inspect step to the web.xml
descriptor of each Web application contained in the target Java EE application.
Unregisters any application-specific ServletContextListener
, ServletContextAttributeListener
, ServletRequestListener
, ServletRequestAttributeListener
, HttpSessionListener
, and HttpSessionAttributeListener
classes (including those registered by TLDs) from each Web application.
Registers a Coherence*Web ServletContextListener
in each web.xml
descriptor. At run time, the Coherence*Web ServletContextListener
propagates each ServletContextEvent
to each application-specific ServletContextListener
.
Registers a Coherence*Web ServletContextAttributeListener
in each web.xml
descriptor. At run time, the Coherence*Web ServletContextAttributeListener
propagates each ServletContextAttributeEvent
to each application-specific ServletContextAttributeListener
.
Wraps each application-specific Servlet
declared in each web.xml
descriptor with a Coherence*Web SessionServlet
. At run time, each Coherence*Web SessionServlet
delegates to the wrapped Servlet
.
Adds the following directive to each JSP enumerated in Step (2) of the inspect step:
During the uninstall step, the Coherence*Web WebInstaller replaces the instrumented Java EE application with the backup of the original version created in Step (1) of the install process.
Note:
This section does not apply to the native WebLogic SPI implementation of Coherence*Web. It applies only if you are using the WebInstaller to install Coherence*Web into an application that uses Java EE security. For instructions on using the SPI implementation, see Chapter 2, 'Using Coherence*Web with WebLogic Server.'If you want to install Coherence*Web into an application that uses Java EE security, follow these additional steps during installation:
Enable Coherence*Web session cookies.
See the coherence-session-cookies-enabled
configuration element in Table A-1 for additional details.
Change the Coherence*Web session cookie name to a name which is different from the one used by the target Web container.
By default, most containers use JSESSIONID
for the session cookie name, so a good choice for the Coherence*Web session cookie name is CSESSIONID
. See the coherence-session-cookie-name
configuration element in Table A-1 for additional details.
Enable session replication for the target Web container.
If session replication is not enabled, or the container does not support a form of session replication, then you will be forced to re-authenticate to the Web application during failover. See your Web container's documentation for instructions on enabling session replication.
This configuration causes two sessions to be associated with a given authenticated user:
A Coherence*Web session which contains all session data created by the Web application.
A session created by the Web container during authentication which only stores information necessary to identify the user.
Note:
This section applies only to application servers that do not use the Coherence*Web SPI.Oracle Coherence*Web can be employed as the session management module for ColdFusion applications. Follow these steps to enable Coherence*Web with for your application server.
In the ColdFusion installer, create a WAR version of ColdFusion.
Follow the provided instructions for configuring your J2EE container for ColdFusion.
If you run Caucho Resin as your application server, run the Coherence WebInstaller on the container. See 'Installing on Caucho Resin 3.1.x' for more information.
Instrument the generated cfusion.war
using the Coherence WebInstaller.
See 'General Instructions for Installing Coherence*Web Session Management Module' for the additional steps to install Coherence*Web for a Java EE application.
Deploy cfusion.war
to the Web container.
Configure ColdFusion MX to use J2EE session management.
Access the ColdFusion administration page at the following URL:
Select Memory Variables under Server Sessions and enable the Use J2EE session variables check box.
Add your ColdFusion application.
The application must have a Application.cfm
file that specifies sessionmanagement='Yes'
, but should not configure the session using ColdFusion configuration (otherwise, exceptions are thrown). The Application.cfm
should contain the following line:
Azure App Service provides a highly scalable, self-patching web hosting service. This quickstart tutorial shows how to deploy a PHP app to Azure App Service on Windows.
Azure App Service provides a highly scalable, self-patching web hosting service. This quickstart tutorial shows how to deploy a PHP app to Azure App Service on Linux.
You create the web app using the Azure CLI in Cloud Shell, and you use Git to deploy sample PHP code to the web app.
You can follow the steps here using a Mac, Windows, or Linux machine. Once the prerequisites are installed, it takes about five minutes to complete the steps.
If you don't have an Azure subscription, create a free account before you begin.
To complete this quickstart:
In a terminal window, run the following commands. This will clone the sample application to your local machine, and navigate to the directory containing the sample code.
Run the application locally so that you see how it should look when you deploy it to Azure. Open a terminal window and use the php
command to launch the built-in PHP web server.
Open a web browser, and navigate to the sample app at http://localhost:8080
.
You see the Hello World! message from the sample app displayed in the page.
In your terminal window, press Ctrl+C to exit the web server.
Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser. You can use either Bash or PowerShell with Cloud Shell to work with Azure services. You can use the Cloud Shell preinstalled commands to run the code in this article without having to install anything on your local environment.
To start Azure Cloud Shell:
Option | Example/Link |
---|---|
Select Try It in the upper-right corner of a code block. Selecting Try It doesn't automatically copy the code to Cloud Shell. | |
Go to https://shell.azure.com, or select the Launch Cloud Shell button to open Cloud Shell in your browser. | |
Select the Cloud Shell button on the menu bar at the upper right in the Azure portal. |
To run the code in this article in Azure Cloud Shell:
Start Cloud Shell.
Select the Copy button on a code block to copy the code.
Paste the code into the Cloud Shell session by selecting Ctrl+Shift+V on Windows and Linux or by selecting Cmd+Shift+V on macOS.
Select Enter to run the code.
FTP and local Git can deploy to an Azure web app by using a deployment user. Once you configure your deployment user, you can use it for all your Azure deployments. Your account-level deployment username and password are different from your Azure subscription credentials.
To configure the deployment user, run the az webapp deployment user set command in Azure Cloud Shell. Replace <username> and <password> with a deployment user username and password.
The JSON output shows the password as null
. If you get a 'Conflict'. Details: 409
error, change the username. If you get a 'Bad Request'. Details: 400
error, use a stronger password.
Record your username and password to use to deploy your web apps.
A resource group is a logical container into which Azure resources, such as web apps, databases, and storage accounts, are deployed and managed. For example, you can choose to delete the entire resource group in one simple step later.
In the Cloud Shell, create a resource group with the az group create
command. The following example creates a resource group named myResourceGroup in the West Europe location. To see all supported locations for App Service in Free tier, run the az appservice list-locations --sku FREE
command.
You generally create your resource group and the resources in a region near you.
When the command finishes, a JSON output shows you the resource group properties.
A resource group is a logical container into which Azure resources, such as web apps, databases, and storage accounts, are deployed and managed. For example, you can choose to delete the entire resource group in one simple step later.
In the Cloud Shell, create a resource group with the az group create
command. The following example creates a resource group named myResourceGroup in the West Europe location. To see all supported locations for App Service on Linux in Basic tier, run the az appservice list-locations --sku B1 --linux-workers-enabled
command.
You generally create your resource group and the resources in a region near you.
When the command finishes, a JSON output shows you the resource group properties.
In the Cloud Shell, create an App Service plan with the az appservice plan create
command.
The following example creates an App Service plan named myAppServicePlan
in the Free pricing tier:
When the App Service plan has been created, the Azure CLI shows information similar to the following example:
In the Cloud Shell, create a web app in the myAppServicePlan
App Service plan with the az webapp create
command.
In the following example, replace <app-name>
with a globally unique app name (valid characters are a-z
, 0-9
, and -
). The runtime is set to PHP 7.4
. To see all supported runtimes, run az webapp list-runtimes
.
Note
The stop-parsing symbol (--%)
, introduced in PowerShell 3.0, directs PowerShell to refrain from interpreting input as PowerShell commands or expressions.
When the web app has been created, the Azure CLI shows output similar to the following example:
You've created an empty new web app, with git deployment enabled.
Note
The URL of the Git remote is shown in the deploymentLocalGitUrl
property, with the format https://<username>@<app-name>.scm.azurewebsites.net/<app-name>.git
. Save this URL as you need it later.
Browse to your newly created web app. Replace <app-name> with your unique app name created in the prior step.
Here is what your new web app should look like:
Back in the local terminal window, add an Azure remote to your local Git repository. Replace <deploymentLocalGitUrl-from-create-step> with the URL of the Git remote that you saved from Create a web app.
Push to the Azure remote to deploy your app with the following command. When Git Credential Manager prompts you for credentials, make sure you enter the credentials you created in Configure a deployment user, not the credentials you use to sign in to the Azure portal.
This command may take a few minutes to run. While running, it displays information similar to the following example:
Browse to the deployed application using your web browser.
The PHP sample code is running in an Azure App Service web app.
Congratulations! You've deployed your first PHP app to App Service.
Using a local text editor, open the index.php
file within the PHP app, and make a small change to the text within the string next to echo
:
In the local terminal window, commit your changes in Git, and then push the code changes to Azure.
Once deployment has completed, return to the browser window that opened during the Browse to the app step, and refresh the page.
Go to the Azure portal to manage the web app you created. Search for and select App Services.
Select the name of your Azure app.
Your web app's Overview page will be displayed. Here, you can perform basic management tasks like Browse, Stop, Restart, and Delete.
The web app menu provides different options for configuring your app.
In the preceding steps, you created Azure resources in a resource group. If you don't expect to need these resources in the future, delete the resource group by running the following command in the Cloud Shell:
This command may take a minute to run.