forked from rackspace-orchestration-templates/php-app-single
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrackspace.yaml
102 lines (93 loc) · 4.92 KB
/
rackspace.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
schema-version: 1.0.0
application-family: Application Frameworks
application-name: PHP
flavor: Single Linux Server
flavor-weight: 3
reach-info:
icon-20x20: https://0b5294b243620310a700-e388a7f3aba385a925111b1fc6f680d4.ssl.cf2.rackcdn.com/php-icon-20x20.png
tattoo: https://0b5294b243620310a700-e388a7f3aba385a925111b1fc6f680d4.ssl.cf2.rackcdn.com/php-tattoo.png
abstract: A single Linux server running Apache, PHP 5, and MySQL.
hidden_outputs:
- private_key
- mysql_root_password
instructions: |
#### Getting Started
If you're new to PHP, the [Getting
Started](http://www.php.net/manual/en/getting-started.php) page can walk you
through the basics of PHP and it's uses.
#### Logging in via SSH
The private key provided in the passwords section can be used to login as
root via SSH. We have an article on how to use these keys with [Mac OS X and
Linux](http://www.rackspace.com/knowledge_center/article/logging-in-with-a-ssh-private-key-on-linuxmac)
as well as [Windows using
PuTTY](http://www.rackspace.com/knowledge_center/article/logging-in-with-a-ssh-private-key-on-windows).
#### Deploying Your Code
If your deployment has multiple application servers, deployment tools such as
Capistrano, Phing, or even git can simplify the deployment process. It's best
to evaluate all options independently to determine which tool works best for
your use case. There are other methods for deployment including using
configuration and infrastructure management tools like
[Chef](http://docs.opscode.com/resource_deploy.html#deploy-strategies).
#### Details of Your Setup
This deployment was stood up using
[chef-solo](http://docs.opscode.com/chef_solo.html). Once the deployment is
up, chef will not run again, so it is safe to modify configurations.
[PHP](http://www.php.net/) was installed using the packaged version for your
operating system. Newer versions of PHP will be available with newer versions
of the operating system. We recommend using the packaged version as opposed
to a source based installation for easier long term managmement, patching,
and supportability.
All web content will be served by [Apache](http://httpd.apache.org/). The
configuration can be found in /etc/apache2/sites-enabled. The name of the
configuration file will be the same as the name of the site provided as a
part of this deployment. Any changes made to this configuration will require
a restart of Apache. By default, the Document Root for your site will be
/var/www/vhosts/application/.
[Memcached](http://memcached.org/) is installed to handle object caching. By
default, Memcached is configured to listen on localhost, port 11211.
Memcached is most commonly used to cache object information so that they can
be called from memory as opposed to querying a backend database. The
configuration can be found in /etc/memcached.conf. Any changes made to the
configuration file will require a the memcached service to be restarted.
[MySQL](http://www.mysql.com/) has been installed on a Cloud Database
instance.
#### Adding PHP Modules or Extensions
There are several options for adding support to PHP. We recommend leveraging
as many packaged modules as possible. Use the system package manager to
search for an install modules. Here's an example of how to search for
availalbe modules of PHP 5 on Ubuntu:
```bash
root@app01:~# apt-cache search php5-
php5-cgi - server-side, HTML-embedded scripting language (CGI binary)
php5-cli - command-line interpreter for the php5 scripting language
php5-common - Common files for packages built from the php5 source
php5-curl - CURL module for php5
php5-dbg - Debug symbols for PHP5
php5-dev - Files for PHP5 module development
php5-gd - GD module for php5
php5-gmp - GMP module for php5
php5-ldap - LDAP module for php5
php5-mysql - MySQL module for php5
...
```
Once you find the appropriate package, the package manager can be used to
handle the installation. Here's an example on how we would install the
php5-gd package on Ubuntu:
```bash
apt-get install -y php5-gd
```
If you're looking to install something that is not found in the default
repositories, you can use [PECL](http://pecl.php.net/),
[PEAR](http://pear.php.net/), or
[phpize](http://php.net/manual/en/install.pecl.phpize.php) to complete the
installation. Follow any instructions provided with the application you are
installing for more detail on how to best install the necessary modules or
extensions.
#### Updating PHP
Since the PHP installation was done using the package manager for the
operating system, the update can also be performed by the package manager. If
you're looking for a different major or minor version of PHP, you may want to
consider running a different version of the operating system. Most operating
systems lock in specific major, minor, and release versions, and they only
release updates for bugs or security fixes.
user-input-required: true