~jorge/charms/precise/lamp/readme-fixes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

#create directories to store mysql configuration
mkdir -p /var/webconfig
cp ./lib/* /var/webconfig
chown -R www-data:www-data /var/webconfig
juju-log "Installing packages"
apt-get install -y apache2 php5 mysql-client php5-mysql php5-mcrypt ttf-dejavu-core ucf debconf-utils

# Configure apache
juju-log "Enabling apache modules: rewrite, vhost_alias, php5"
a2enmod rewrite vhost_alias php5

#copy php files to directory
if ls ./website/* > /dev/null 2>&1; then
  cp -r ./website/* /var/www
  chown -R www-data:www-data /var/www
fi

#opening port 80
juju-log "Exposing apache2 service"
open-port 80/tcp