Complete Debian/Ubuntu style Apache2 configuration.
Debian or Ubuntu preferred.
Red Hat/CentOS and Fedora can be used but will be converted to a Debian/Ubuntu style Apache as it’s far easier to manage with chef.
The file attributes/apache.rb contains the following attribute types:
-
platform specific locations and settings.
-
general settings
-
prefork attributes
-
worker attributes
General settings and prefork/worker attributes are tunable.
Include the apache2 recipe to install Apache2 and get ‘sane’ default settings. Configuration is modularized through Apache vhost sites a la Debian style configuration.
For Red Hat, CentOS and Fedora you should first disable selinux as it’s not supported (yet), then remove the stock httpd and all it’s dependencies prior to attempting to use this recipe. Many packages in these distributions drop conflicting configs into conf.d, all of which haven’t been accounted for yet. Starting from scratch will also make it far easier to debug.
-
apache_module: sets up an Apache module.
-
apache_conf: sets up a config file for an apache module.
-
apache_site: sets up a vhost site. The conf file must be available.
-
web_app: copies the template for a web app and enables it as a site via apache_site.
Various applications that can be set up with Apache as the front end, such as PHP, Django, Rails and others can use the web_app define to set up the template and the Apache site. The define is kind of dumb, so the template needs have the application implementation settings, since we don’t know what your app is or what is needed from Apache.
We only prototype one parameter for the web_app define, “template”. This is used to specify the name of the template to use in the current cookbook. When you use web_app, you can set up any parameters you want to use in your template. They will get passed to the template through the params hash. For example, the sample web_app.conf.erb template in this cookbook makes use of these.
-
docroot
-
server_name
-
server_aliases
These are available as @params, @params, @params within the template.
If ‘cookbook’ and ‘template’ are not specified, the current cookbook’s templates/default/web_app.conf.erb will be used. If this template is not suitable for your application, copy it to your cookbook and customize as needed.
- Author
-
Joshua Timberman (<[email protected]>)
- Copyright
-
2009, Opscode, Inc
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.