# Author: Martti Vasar
# Date: 08/03/2012
#
# These commands are triggered, when configuring APACHE servers. If you want to add commands,
# just write them here, if you want to remove, you can delete the line or use # comment mark,
# the program will ignore comment lines
#
# There are two command types, one is running the command in the instance (R), the other is 
# copying files from local (from this) machine to remote machine (C). For running commands, use
# R as an indicator and for copying, use C as an indicatior. If using C, make sure you do 
# not use spaces in file names, first is where the file is located in the local file system
# and the second is where to copy the file in the remote system.
#
# It uses Secure Shell tools (scp and ssh)
# The PWD (current directory) is the directory, where the CloudController is started.
# Configuration files are located in configuration/.

# Description:
# IPSettings.php is used to define location of the MySQL and memcached servers, so 
# the MediaWiki application is able to connect with them. It is also possible to make
# modifications in PHP and APACHE configuration files and copy them in to the cloud.
# Changing parameters in the CloudController is not yet implemented and thus, user has 
# to made configurations by hand in files configuration/apache2.conf and 
# configuration/php5.ini. These files are copied (if the commands are not removed) to 
# the server and Apache service is started with new configuration. These commands are also
# triggered, when new Apache instance is added.

# make empty IPSettings file
#R sudo touch /var/www/mediawiki/IPSettings.php

# make enough rights to be able to copy MediaWiki configuration (run the command)
R sudo chmod 777 /var/www/mediawiki/IPSettings.php
R sudo chmod 777 /var/www/mediawiki/LocalSettings.php
R sudo chmod 777 /etc/apache2/apache2.conf
R sudo chmod 777 /etc/php5/apache2/php.ini

# copy configuration file (use copy command)
C configuration/IPSettings.php /var/www/mediawiki/IPSettings.php
C configuration/LocalSettings.php /var/www/mediawiki/LocalSettings.php

# copy apache and php configurations
C configuration/apache2.conf /etc/apache2/apache2.conf

# start APACHE server (run the command)
R sudo service apache2 start

# feel free to remove or add new commands (you can also change permissions back, if you want)

