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

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Victor Palau
  • Date: 2012-09-28 11:03:35 UTC
  • Revision ID: vtuson@gmail.com-20120928110335-yk7ffaj9azw8fb4h
part1 of changes implementing charm review feedback

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
3
 
 
4
3
#create directories to store mysql configuration
5
4
mkdir -p /var/webconfig
6
5
cp ./lib/* /var/webconfig
7
 
hown -R www-data:www-data /var/webconfig
8
 
 
 
6
chown -R www-data:www-data /var/webconfig
9
7
juju-log "Installing packages"
10
8
apt-get install -y apache2 php5 mysql-client php5-mysql php5-mcrypt ttf-dejavu-core ucf debconf-utils
11
9
 
12
10
# Configure apache
13
11
juju-log "Enabling apache modules: rewrite, vhost_alias, php5"
14
12
a2enmod rewrite vhost_alias php5
15
 
service apache2 restart
16
13
 
17
14
#copy php files to directory
18
 
cp ./website/* /var/www
19
 
chown -R www-data:www-data /var/www
 
15
if ls ./website/* > /dev/null 2>&1; then
 
16
  cp -r ./website/* /var/www
 
17
  chown -R www-data:www-data /var/www
 
18
fi
20
19
 
 
20
#opening port 80
 
21
juju-log "Exposing apache2 service"
 
22
open-port 80/tcp