Hi,
Many of you have asked how to deploy a generic PHP-type application on AppLogic infrastructure.
There are many ways to do it. The following procedure describes how you can install WordPress on AppLogic's Lamp and LampX4 scalable LAMP clusters. These are the steps for deploying pretty much any 2-tier app -- php, perl, etc.
The procedure follows the standard WordPress installation instructions. The Applogic-specific steps are highlighted in
bold:
- Provision an instance of the LampX4 template
In the AppLogic Applications tab, right-click the LampX4 template and select Provision. Fill in "mywp" as application name, replacing the automatically generated name. Click Next.
- Configure mywp -- set resources and properties
Leave resources and volumes sizes to their defaults. Click Next.
Fill in the input and output IP addresses (must be two different available addresses from the Public addresses listed on the bottom of the dashboard); as well as the netmask, gateway and DNS server(s). (At least all red fields should be filled in). Click Next.
Leave defaults on the last step, click Next.
- Wait until provisioning completes. Upon successful completion of provisioning, close the wizard.
- Open mywp in the editor, step into the WEBx4 (right click View Interior), login to srv1 (right Login)
- In srv1's shell, follow the WordPress Famous 5-minute install (http://codex.wordpress.org/Installing_WordPress)
- cd /var/www/html
- wget http://wordpress.org/latest.tar.gz
- tar xzf wordpress.*
- mysql -h db
-- create database wp;
-- exit
- cd wordpress
- cp wp-config-sample.php wp-config.php
- nano wp-config.php # the beta version of AL2.0.2 does not tolerate vi in the webshell, use nano or ssh connection
-- configure database host to be db; user root; password empty; database name db;
-- save (make sure that the database config line didn't get wrapped on the next line in nano before saving)
- Point a browser at the input IP of your mywp application, /wordpress/
- Follow the prompt to set up the blog (blog name and admin e-mail); remember your generated password
- Create your first post -- All done!
Later on, as the traffic coming to your application increases, you can replace the 4-server web assembly (WEBx4) with an 8-server web assembly (WEBx8):
- Open mywp in the editor
- Shift-drag WEBx8 from the catalog and drop it over the WEBx4 instance on the canvas (keep the shift down)
- Confirm you want to change the class of the web server to WEBx8
- Save and close
- Restart the mywp app, now you can have up to 8 web servers (so a good total of 12 servers (or ~40 CPUs) or so before you need to make some more interesting changes)
If you have a second grid, you can migrate the multiserver app by setting up security as described in 'app migrate' docs, and do:
-
app migrate oldgrid mywp <new values of IP addresses if needed>
This will stop wordpress on the old grid, migrate wordpress with all its data to the new grid, reconfigure it and start it there.
Regards,
-- Peter
P.S. Steps 1-4 of the provisioning can also be performed in the command line shell:
- Provision an instance of LampX4. In the AppLogic shell:
app provision LampX4 mywp --skipstart
- Configure mywp -- set resources and properties (at least the IP settings, replacing the italics below with IP addresses from your system -- see the last few lines of grid info -v)
app config mywp in_ip=1.2.3.4 out_ip=1.2.3.4 netmask=255.255.255.0 gateway=1.2.3.4 dns1=1.2.3.4
- Start mywp
app start mywp
- Login to the default console of the application (which, in LampX4 is set to the first web server of the WEBx4 assembly
app login mywp
--or--
comp login mywp:web.srv1