r10 - 20 Dec 2007 - 23:06:39 - BeckyHYou are here: Wiki >  AppLogic2 Web > RefAppLamp
ALERT! AppLogic 2.1/2.2 Documentation The latest production release is AppLogic 2.9.9

Lamp - Lamp and LampX4 Applications


Lamp - 2-tier Non-scalable Web Application

Lamp.png

LampX4 - Scalable Lamp Web Application

LampX4.png

Functional Overview

The Lamp and LampX4 reference applications are simple 2-tier Web applications that make it easy for a user to port their applications onto AppLogic. These reference applications drastically reduce the entry barrior for using AppLogic grids.

The Lamp application consists of a single web server, a database server, a file server, a gateway for external network access and an input gateway for user access. In addition, the application contains a monitor which allows the maintainer to montior various aspects of the application (e.g., CPU/memory usage, hit rate on a web site, etc).

LampX4 is the same as Lamp except it provides a load-balanced web tier; a load balancer plus 4 web servers. LampX4 is designed for applications that incure heavy traffic load (i.e., may be accessed by hundreds of users).

With these Lamp applications, in just a few simple steps, the user can port their application onto AppLogic with ease. Simply provision one of the Lamp applications, SSH into the web server (via the AppLogic web shell), install the neccessary software and the application is ready for production.

Note that Lamp and LampX4 are made for simple applications that do not require:

  • any build tools such as GCC
  • write access to the usr directory in the web servers
For applications that do not fit within these requirements, the LampCluster reference application should be used instead.


Boundary

Properties

Property Name Type Description
hostname String Host name under which the Lamp application is accessible. This is the name that users point their browsers at: http://hostname/. This name should resolve to the IP address specified in in_ip. Default: (empty; no hostname is used).
in_ip IP This is the IP address at which the Lamp application provides services to users. If the hostname property is not empty, it should resolve to in_ip. This property is mandatory.
out_ip IP This is the IP address that is used by the Lamp application to access an external network that resides outside of the application (i.e., the internet). This property is mandatory.
netmask IP Network mask for the network on which in_ip and out_ip reside. This property is mandatory.
gateway IP Defines the IP network gateway (router) that is used for all outgoing traffic to the external network via in_ip and out_ip. This property is mandatory.
dns1 IP IP address of the primary DNS server used for host name resolutions. This property is mandatory.
dns2 IP IP address of the backup DNS server used for host name resolutions. Default: (empty; not used).
mon_standby Int Determines whether application monitoring is disabled upon application start for the Lamp application. If non-zero, monitoring is disabled, otherwise monitornig is enabled. The monitoring can be enabled at runtime by manually starting the mon appliance. Default: 1 (monitoring is disabled).
srv2_standby Int Specifies whether the second WEB server is in standby mode. If non-zero, the second WEB server is in standby mode, otherwise it is not in standby mode. This property is valid only for the LampX4 application. Default: 1 (standby mode).
srv3_standby Int Specifies whether the third WEB server is in standby mode. If non-zero, the third WEB server is in standby mode, otherwise it is not in standby mode. This property is valid only for the LampX4 application. Default: 1 (standby mode).
srv4_standby Int Specifies whether the fourth WEB server is in standby mode. If non-zero, the fourth WEB server is in standby mode, otherwise it is not in standby mode. This property is valid only for the LampX4 application. Default: 1 (standby mode).

ALERT! The IP addresses configured in the in_ip and out_ip properties must be IP addresses available on your AppLogic grid. You can find them, together with the netmask, gateway and dns servers on the dashboard of your grid. We are working to make it possible for AppLogic to provide these addresses automatically

Resources

Lamp

Resource Minimum Maximum Default
CPU 0.45 60 1.1
Memory 552 MB 54 GB 1.476 GB
Bandwidth 6 Mbps 3.1 Gbps 6 Mbps

LampX4

Resource Minimum Maximum Default
CPU 0.8 112 2.8
Memory 984 MB 102.25 GB 2.975 GB
Bandwidth 10 Mbps 3.5 Gbps 46 Mbps

Application Volumes

The application itself uses several volumes. They are part of the application and are already configured into the appliance instances. There are no volumes that need to be configured on the application boundary.

Volume Description
ssl_key A read-only volume containing, at a minimum, the SSL server signing key. The SSL file should be in PEM format located in the root directory, named server.pem. This volume is assigned to the INSSL appliance. By default, this volume is not used (SSL is disabled by default). Please see the INSSL data sheet for how to enable SSL for your Lamp application.
mysql_data Volume for the database data storage. This volume is assigned to the MYSQL appliance. By default, an empty volume called mysql is supplied for the application to use.
fs_data This volume is used to store the Lamp application's web pages, code and scripts (plus anything else that is needed by the application). It is also used to store the web server and database logs. This volume is assigned to the NAS appliance. By default, an empty volume called fs is supplied for the application to use.
mon_data This volume is used to store monitoring data for the application. There is no reason for the user to access/modify this volume; this volume is used internally by the MON appliance. By default, a volume called mon is supplied to store the application monitoring data.

Operation

This section describes how to use and operate the Lamp applications. It is geared towards both maintainers and regular AppLogic users. The initial setup and maintenance of the Lamp applications requires access to an AppLogic grid.

Lamp and LampX4 are designed to allow the user to quickly port their application over to AppLogic. Lamp and LampX4 are both used in the same way. All instructions in this section apply to both Lamp applications.

Initial application setup

Use the following steps to get your own Lamp application up and running on an AppLogic grid. This example creates a scalable Lamp application based on LampX4 called mylampapp.

  • Provision the Lamp application using the command below. This command provisions a new Lamp application named mylampapp based on the LampX4 reference application. All properties are set to their appropriate values (IPs, DNS servers, etc). All 4 web servers are enabled in order to accomidate for possible heavy traffic loads. Also, the sizes of the fs and mysql volumes are increased to 250MB.
    • app provision LampX4 mylampapp hostname=www.myapp.com in_ip=1.2.3.4 out_ip=1.2.3.5 netmask=255.255.255.0 gateway=1.2.3.1 dns1=1.2.3.50 dns2=1.2.3.51 mon_standby=0 srv2_standby=0 srv3_standby=0 srv4_standby=0 fs.size=250MB mysql.size=250MB
  • AppLogic will provision the mylampapp application and start it on the grid. Wait for the application to start; this may take serveral minutes.
  • Now you can access your application using a browser. Open up a browser and point it to the configured hostname and you will see a test web page from the Apache web server. If you do not see a test page, make sure your IP addresses are configured correctly and restart the application if needed.
  • You now have a running Lamp application on your grid. All that is left to do is to install your specific application onto the application volumes and your application will be ready to go.

Installing your application

This steps below describe how to install your own software on your Lamp application:

  • SSH into the web appliance from within the Applogic shell: ssh mylampapp:main.srv.srv1
    • From within the web server, you can now download and install software directly from the internet (as you would normally do if working on your own private server).
    • If needed, you can also access the MySQL database using the db hostname (e.g., mysql -h db). The default database that is set up automatically when the application is first created has sufficient permissions for the root user of any of the web server appliances.
    • You can use /mnt/fs to store any files/folders you need for your application (this is the path to your fs application volume). This volume is also used to store all of the apache files (/var/www/html is linked to /mnt/fs for example).
  • After all of your software is installed and configured, there is no need to restart the application (unless the software you installed requires a reboot).
  • Users should now be able to access your application by using the configured hostname or IP address (in_ip).

Monitoring your application

After your application has started, you can monitor the application by using the monitor GUI accessible through the AppLogic GUI in one of two ways:

  • In the applications list GUI page, select your application and click on the "Monitor" button.
  • Edit your application using the AppLogic application editor and choose the "Monitor" button at the top of the window.

If you started your application with the monitor in standby state, you can manually start it at runtime: comp start mylampapp:main.mon. The monitor must be started before you can access it through the AppLogic GUI.

After the monitor has started, you may now access the monitoring GUI to monitor your application. This is used to monitor CPU/memory usage, number of hits your website is getting, traffic load, etc. The mon appliance properties are not configured by default; please see the MON datasheet on how to configure mon for things like setting the monitor title, enabling background alarms, etc. Please also see the Monitor Reference for additonal details on how to monitor your application and use the visual interface.

Implementation details

Application Architecture

Lamp and LampX4 are reference designs for basic 2-tier Lamp web applications. They are designed for rapid deployment and easy management.

Lamp contains the following components:

  • firewalled input SSL gateway (INSSL) -- provides user access to the Lamp application
  • a web server (WEB) -- an Apache web server which provides the application services to the user
  • a database (MYSQL) -- a MySQL database server used by the application for database access and storage (if needed)
  • a centralized content file storage (NAS) -- stores the application specific web pages/scripts/etc, also used for storing the logs of the web server and database
  • a firewalled output network gateway (NET) -- used to access the external network (i.e., the internet) from within the web server
  • an application monitor (MON) -- used to monitor the Lamp application through the AppLogic GUI

LampX4 is the same as Lamp except instead of using WEB, LampX4 uses WEBx4 to provide a load-balanced web tier (a load balancer plus 4 WEB servers). This adds scalability to the Lamp application. If desired, WEBx4 can be replaced with WEBx8 to provide greater scalability for the application. After provisioning the LampX4 application, replace WEBx4 with WEBx8 by:

  • hold down the SHIFT key
  • click on WEBx8 and drag it over WEBx4 (while holding down the SHIFT key)
  • release the left mouse button and then let go of the SHIFT key
  • choose OK to confirm the replacement

ALERT! All appliances used in Lamp and LampX4 are from the standard AppLogic system catalog (no branched appliances are used in these applications).

The application infrastructure is here (at the beginning of this data sheet).

Notes

  • The web servers used in the Lamp applications do not have a GCC build environment or a writable usr directory tree. If either of these are needed, it is recommended to use the LampCluster reference application instead of the Lamp/LampX4 applications.
  • There is a known incompatibility between the web and mysql servers related to user authentication (SCR 1564). If a mysql user other than root is used in your lamp application, the user must not have an associated password (password authentication does not work due to a mysql client/server version mismatch between the web and mysql server). For more details, please see SCR 1564.

Questions and Comments

IDEA! To post questions and/or comments for the Lamp application, visit our forum.

IDEA! To post questions and/or comments for the Lampx4 application, visit our forum.


-- BeckyH - 07 May 2007

 
Copyright © CA 2005-2010. All Rights Reserved.
%