Skip to content

Commit

Permalink
lots of fixes and updates for the wordpress scripts and recipes, star…
Browse files Browse the repository at this point in the history
…ted new django newsapps cluster stuff
  • Loading branch information
ryanmark committed Sep 10, 2011
1 parent 2f208f1 commit d7845c6
Show file tree
Hide file tree
Showing 23 changed files with 220 additions and 76 deletions.
19 changes: 19 additions & 0 deletions boot-scripts/_apache-python.sh
@@ -0,0 +1,19 @@
install_pkg libxml2-dev libxslt-dev \
apache2 apache2-mpm-worker apache2-utils apache2.2-common \
proj libgeoip1 geoip-database python-gdal \
python-virtualenv python-pip ruby libruby-extras python-dev \
libapache2-mod-wsgi virtualenvwrapper

# enable mod_rewrite
a2enmod rewrite

# disable deflate
a2dismod deflate

# Install apache config
install_file /etc/apache2/apache2.conf

# setup virtualenvwrapper
echo "export WORKON_HOME=/home/$USERNAME/sites/virtualenvs" >> /home/$USERNAME/.bashrc

reload apache2
4 changes: 3 additions & 1 deletion boot-scripts/_cloudkick.sh
Expand Up @@ -18,4 +18,6 @@ DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install cloudkick-agent

# Install plugins
cp -Rf $ASSET_DIR/newsapps/usr/lib/cloudkick-agent /usr/lib/
git clone https://github.com/cloudkick/agent-plugins.git /user/lib/cloudkick-agent/plugins

cp -Rf $ASSET_DIR/newsapps/usr/lib/cloudkick-agent/plugins/* /usr/lib/cloudkick-agent/plugins/
35 changes: 35 additions & 0 deletions boot-scripts/_postgres.sh
@@ -0,0 +1,35 @@

# install postgres
install_pkg postgresql-8.4-postgis pgpool libpq-dev

# create postgres user
sudo -u postgres createuser -s $USERNAME

# POSTGIS setup
# Where the postgis templates should be
POSTGIS_SQL_PATH=/usr/share/postgresql/8.4/contrib/postgis-1.5

# Creating the template spatial database.
sudo -u postgres createdb -E UTF8 template_postgis

# Adding PLPGSQL language support.
sudo -u postgres createlang -d template_postgis plpgsql

# Allows non-superusers the ability to create from this template
sudo -u postgres psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"

# Loading the PostGIS SQL routines
sudo -u postgres psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql

# Enabling users to alter spatial tables.
sudo -u postgres psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
sudo -u postgres psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"

# install configs
install_file newsapps /etc/pgpool.conf
install_file newsapps /etc/postgresql/8.4/main/pg_hba.conf
install_file newsapps /etc/postgresql/8.4/main/postgresql.conf

# reload everything
service postgresql restart
service pgpool restart
17 changes: 17 additions & 0 deletions boot-scripts/_testing-postfix.sh
@@ -0,0 +1,17 @@
# Sets up a postfix server that reroutes all email to the local user account

# Need to set $MAIL_DOMAIN to what ever domain you will be sending from
if [ -z "${MAIL_DOMAIN+xxx}" ]; then MAIL_DOMAIN=example.com; fi

install_pkg postfix

echo "localhost :
$MAIL_DOMAIN :
* local:$USERNAME" > /etc/postfix/transport

postmap /etc/postfix/transport

echo "mynetworks = 10.0.0.0/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
transport_maps = hash:/etc/postfix/transport" >> /etc/postfix/main.cf

service postfix restart
2 changes: 1 addition & 1 deletion boot-scripts/_varnish.sh
Expand Up @@ -5,7 +5,7 @@ apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
varnish

# Install varnish config file
install_file newsapps /etc/init.d/varnish
install_file newsapps /etc/default/varnish

# Configure varnish logging
echo "VARNISHNCSA_ENABLED=1" >> /etc/default/varnishncsa
Expand Down
3 changes: 2 additions & 1 deletion boot-scripts/base.sh
Expand Up @@ -41,7 +41,8 @@ echo "Updating OS..."
export DEBIAN_FRONTEND=noninteractive
apt-get -q update && apt-get -q upgrade -y

apt-get install python-setuptools
# grab some basic utilities
install_pkg build-essential python-setuptools python-dev zip git-core subversion unattended-upgrades mailutils

# need an updated version of boto
easy_install --upgrade boto
Expand Down
4 changes: 2 additions & 2 deletions boot-scripts/lib.sh
Expand Up @@ -13,8 +13,8 @@ function install_file {

# install_pkgs $pkg_name
function install_pkg {
echo "Installing packages $1"
echo "Installing packages $*"
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
$1
$*
}
14 changes: 14 additions & 0 deletions boot-scripts/newsapps/admin.sh
@@ -0,0 +1,14 @@
{%extends 'wordpress/base.sh' %}

{% block install %}

# install some basic stuff
install_pkg postfix

{% include "_apache-python.sh" %}

{% include "_nfs-client.sh" %}

{% include "_syslog-server.sh" %}

{% endblock %}
14 changes: 14 additions & 0 deletions boot-scripts/newsapps/app-cache.sh
@@ -0,0 +1,14 @@
{% extends 'newsapps/base.sh' %}

{% block install %}

{% include '_syslog-client.sh' %}

{% include '_nfs-client.sh' %}

{% include '_apache-python.sh' %}

{% include '_memcached.sh' %}

{% endblock %}

12 changes: 12 additions & 0 deletions boot-scripts/newsapps/app.sh
@@ -0,0 +1,12 @@
{% extends 'newsapps/base.sh' %}

{% block install %}

{% include '_syslog-client.sh' %}

{% include '_nfs-client.sh' %}

{% include '_apache-python.sh' %}

{% endblock %}

9 changes: 9 additions & 0 deletions boot-scripts/newsapps/db-nfs.sh
@@ -0,0 +1,9 @@
{% extends 'newsapps/base.sh' %}

{% block install %}

{% include '_postgres.sh' %}

{% include '_nfs-server.sh' %}

{% endblock %}
11 changes: 11 additions & 0 deletions boot-scripts/newsapps/lb.sh
@@ -0,0 +1,11 @@
{%extends 'newsapps/base.sh' %}

{% block install %}

{% include "_syslog-client.sh" %}

{% include "_nfs-client.sh" %}

{% include "_varnish.sh" %}

{% endblock %}
24 changes: 24 additions & 0 deletions boot-scripts/wordpress/admin-nfs-nginx-mem.sh
@@ -0,0 +1,24 @@
{%extends 'wordpress/base.sh' %}

{% block install %}
# install some basic stuff
install_pkg \
php5 php5-mysql php5-gd php5-fpm php-pear php-apc php5-curl php5-memcache \
mysql-client

# include the script to build nginx from source
{% include "_nginx.sh" %}

# Install nginx config
install_file newsapps /etc/nginx/nginx.conf

# Install php-fpm config
install_file wordpress /etc/php5/fpm/pool.d/www.conf

{% include "_nfs-server.sh" %}

{% include "_syslog-server.sh" %}

{% include "_memcached.sh" %}

{% endblock %}
2 changes: 0 additions & 2 deletions boot-scripts/wordpress/admin-nfs.sh
Expand Up @@ -4,8 +4,6 @@
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
apache2 \
php5 php5-mysql php5-gd php-pear libapache2-mod-php5 php-apc php5-curl php5-memcache \
mysql-client \
Expand Down
2 changes: 0 additions & 2 deletions boot-scripts/wordpress/admin-nginx.sh
Expand Up @@ -4,8 +4,6 @@
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
php5 php5-mysql php5-gd php5-fpm php-pear php-apc php5-curl php5-memcache \
mysql-client \
postfix
Expand Down
10 changes: 2 additions & 8 deletions boot-scripts/wordpress/admin.sh
Expand Up @@ -2,11 +2,7 @@

{% block install %}
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
apache2 \
install_pkg apache2 \
php5 php5-mysql php5-gd php-pear libapache2-mod-php5 php-apc php5-curl \
mysql-client \
postfix
Expand All @@ -18,9 +14,7 @@ a2enmod rewrite
a2dismod deflate

# Install apache config
cp /home/$USERNAME/cloud-commander/wordpress/etc/apache2/apache2.conf /etc/apache2/apache2.conf
chown root:root /etc/apache2/apache2.conf
chmod 644 /etc/apache2/apache2.conf
install_file wordpress /etc/apache2/apache2.conf

{% include "_nfs-client.sh" %}

Expand Down
2 changes: 0 additions & 2 deletions boot-scripts/wordpress/app-nfs-nginx.sh
Expand Up @@ -4,8 +4,6 @@
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
php5 php5-mysql php5-gd php5-fpm php-pear php-apc php5-curl php5-memcache

# Setup memcached
Expand Down
2 changes: 0 additions & 2 deletions boot-scripts/wordpress/app-nfs.sh
Expand Up @@ -4,8 +4,6 @@
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
apache2 \
php5 php5-mysql php5-gd php-pear libapache2-mod-php5 php-apc php5-curl php5-memcache

Expand Down
2 changes: 0 additions & 2 deletions boot-scripts/wordpress/app-nginx.sh
Expand Up @@ -4,8 +4,6 @@
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
php5 php5-mysql php5-gd php5-fpm php-pear php-apc php5-curl php5-memcache

# include the script to build nginx from source
Expand Down
6 changes: 1 addition & 5 deletions boot-scripts/wordpress/app.sh
Expand Up @@ -4,8 +4,6 @@
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
apache2 \
php5 php5-mysql php5-gd php-pear libapache2-mod-php5 php-apc php5-curl php5-memcache

Expand All @@ -16,9 +14,7 @@ a2enmod rewrite
a2dismod deflate

# Install apache config
cp /home/$USERNAME/cloud-commander/wordpress/etc/apache2/apache2.conf /etc/apache2/apache2.conf
chown root:root /etc/apache2/apache2.conf
chmod 644 /etc/apache2/apache2.conf
install_file wordpress /etc/apache2/apache2.conf

reload apache2

Expand Down
2 changes: 0 additions & 2 deletions boot-scripts/wordpress/db.sh
Expand Up @@ -4,8 +4,6 @@
# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential \
mysql-server

# Install NFS server
Expand Down
6 changes: 0 additions & 6 deletions boot-scripts/wordpress/lb.sh
Expand Up @@ -2,12 +2,6 @@

{% block install %}

# install some basic stuff
DEBIAN_FRONTEND='noninteractive' \
apt-get -q -y -o Dpkg::Options::='--force-confnew' install \
zip git-core subversion unattended-upgrades \
build-essential

{% include "_syslog-client.sh" %}

{% include "_nfs-client.sh" %}
Expand Down

0 comments on commit d7845c6

Please sign in to comment.