~dave-cheney/charms/precise/wordpress/trunk

« back to all changes in this revision

Viewing changes to hooks/db-relation-changed

  • Committer: Clint Byrum
  • Date: 2012-06-18 20:28:16 UTC
  • Revision ID: clint@ubuntu.com-20120618202816-c0iuyzr7nrwowwpv
Fixing so wordpress is configured as the only thing on port 80

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
juju-log "Retrieved hostname: $hostname"
9
9
 
10
10
# Check we haven't already been setup.
11
 
config_file_path="/etc/wordpress/config-$hostname.php"
12
 
if [ -f "$config_file_path" ] ; then
13
 
    juju-log "Wordpress for site $config_file_path already Configured, exiting"
14
 
    echo "Already Configured, Exiting"
15
 
    exit 0 # already setup
16
 
fi
 
11
config_file_path="/etc/wordpress/config-default.php"
17
12
 
18
13
# Get the database settings; if not set, wait for this hook to be
19
14
# invoked again
35
30
 
36
31
juju-log "Creating appropriate upload paths and directories"
37
32
# Setup appropriate upload paths and directories
38
 
ln -s /usr/share/wordpress "/var/www/$hostname"
 
33
ln -sf /usr/share/wordpress "/var/www/$hostname"
39
34
mkdir -p $UPLOAD_PATH
40
35
mkdir -p "$UPLOAD_PATH/$hostname"
41
36
chown -R root:www-data $UPLOAD_PATH
91
86
a2enmod vhost_alias
92
87
juju-log "Enabling apache site: $hostname"
93
88
a2ensite $hostname
 
89
a2dissite default
94
90
 
95
91
# Restart apache
96
92
juju-log "Restarting apache2 service"