From 349e5cccd56ac9b9763a7b02e6111eed3f4d22b6 Mon Sep 17 00:00:00 2001 From: Mark Theunissen Date: Wed, 22 Aug 2012 13:46:10 -0500 Subject: [PATCH] Adding apache --- ubuntu-10.04-lamp-dev/setup.yml | 19 ++++++++++++ .../etc-apache2-sites-available-devserver.j2 | 30 +++++++++++++++++++ .../vars/default-settings.yml | 1 - .../etc-apache2-sites-available-devserver.j2 | 10 +++++-- 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 ubuntu-10.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 diff --git a/ubuntu-10.04-lamp-dev/setup.yml b/ubuntu-10.04-lamp-dev/setup.yml index e6bf6f3..f3400e1 100644 --- a/ubuntu-10.04-lamp-dev/setup.yml +++ b/ubuntu-10.04-lamp-dev/setup.yml @@ -52,6 +52,25 @@ - include: ../common-tasks/mysql-secure.yml + ## + # Apache2 setup. + # + - name: Enable some required modules + action: command a2enmod rewrite vhost_alias + tags: common + + - name: Apache configuration file for our site + action: template src=templates/etc-apache2-sites-available-devserver.j2 dest=/etc/apache2/sites-available/devserver + tags: common + + - name: Disable the default site + action: command a2dissite default + tags: common + + - name: Enable our new site + action: command a2ensite devserver + tags: common + ## # Restart services # diff --git a/ubuntu-10.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 b/ubuntu-10.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 new file mode 100644 index 0000000..a1cddb4 --- /dev/null +++ b/ubuntu-10.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 @@ -0,0 +1,30 @@ +## +# Ansible provided setup. See https://github.com/fourkitchens/server-playbooks. +## + + + ServerAdmin {{ apache_server_admin }} + + DocumentRoot /var/www + + + Options FollowSymLinks + AllowOverride None + + + + Options Indexes FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + allow from all + + + ErrorLog /var/log/apache2/error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog /var/log/apache2/access.log combined + + \ No newline at end of file diff --git a/ubuntu-10.04-lamp-dev/vars/default-settings.yml b/ubuntu-10.04-lamp-dev/vars/default-settings.yml index 63556f8..3d7a44e 100644 --- a/ubuntu-10.04-lamp-dev/vars/default-settings.yml +++ b/ubuntu-10.04-lamp-dev/vars/default-settings.yml @@ -28,4 +28,3 @@ mysql_root_password: 'password' # apache apache_server_admin: 'webmaster@example.com' -apache_server_alias: '*.*.example.com' diff --git a/ubuntu-12.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 b/ubuntu-12.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 index e1ceed5..2e60b96 100644 --- a/ubuntu-12.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 +++ b/ubuntu-12.04-lamp-dev/templates/etc-apache2-sites-available-devserver.j2 @@ -1,7 +1,11 @@ -## Ansible provided setup ## -# This server allows a wildcard virtualhost, so for example, going to the address +## +# Ansible provided setup. See https://github.com/fourkitchens/server-playbooks. +## + +## +# This server allows a wildcard VirtualHost, so for example, going to: # -# http://pete.training.example.com +# http://pete.training.example.com # # ... will set the webroot for the request to /home/pete/www/training #