Skip to content

Commit

Permalink
Kalite, contentshell, and Vagrant workflow improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Neel committed Dec 2, 2015
1 parent 1227cf7 commit 543bb8b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.vagrant*
.vagrant*
sources.list
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Vagrant.configure(2) do |config|

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty32"
config.vm.box = "debian/jessie64"
config.vm.box_version = "8.2.1"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
Expand Down
8 changes: 4 additions & 4 deletions files/default
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
DocumentRoot /var/www/html
<Directory />
Options -Indexes FollowSymLinks
Options -Indexes +FollowSymLinks
AllowOverride None
DirectoryIndex index.html index.php /_h5ai/server/php/index.php
</Directory>
<Directory /var/www/>
Options -Indexes FollowSymLinks MultiViews
<Directory /var/www/html>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride None
Order allow,deny
allow from all
Expand Down
17 changes: 11 additions & 6 deletions installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def install_kalite():
sudo("apt-get install -y python-pip") or die("Unable to install pip.")
sudo("pip install ka-lite-static") or die("Unable to install KA-Lite")
sudo("printf '\nrachel\nrachel\nrachel\nrachel\nrachel\nyes\nyes\n' | sudo kalite manage setup")
sudo("printf '\nyes\nyes' | sudo kalite manage setup --username=rachel --password=rachel --hostname=rachel --description=rachel")
return True

def install_kiwix():
Expand Down Expand Up @@ -55,7 +55,8 @@ def basedir():
def cp(s, d):
return sudo("cp %s/%s %s" % (basedir(), s, d))

[kalite, kiwix] = check_arguments()
if not is_vagrant:
[kalite, kiwix] = check_arguments()

sudo("apt-get install -y git") or die("Unable to install Git.")

Expand All @@ -67,7 +68,8 @@ def cp(s, d):
# Chdir
os.chdir(basedir())


if is_vagrant():
sudo("mv /vagrant/sources.list /etc/apt/sources.list")
# Update and upgrade OS
sudo("apt-get update -y") or die("Unable to update.")
sudo("apt-get dist-upgrade -y") or die("Unable to upgrade Raspbian.")
Expand Down Expand Up @@ -106,7 +108,10 @@ def cp(s, d):
sudo("apt-get -y install apache2 libapache2-mod-proxy-html libxml2-dev \
php5-common libapache2-mod-php5 php5-cgi php5 \
mysql-server mysql-client php5-mysql") or die("Unable to install web platform.")
cp("files/default", "/etc/apache2/sites-enabled/default") or die("Unable to set default Apache site.")
sudo("service apache2 stop") or die("Unable to stop Apache2.")
#cp("files/apache2.conf", "/etc/apache2/apache2.conf") or die("Unable to copy Apache2.conf")
#cp("files/default", "/etc/apache2/sites-available/contentshell.conf") or die("Unable to set default Apache site.")
#sudo("a2ensite contentshell") or die("Unable to enable default Apache site (contentshell).")
cp("files/my.cnf", "/etc/mysql/my.cnf") or die("Unable to copy MySQL server configuration.")
sudo("a2enmod php5 proxy proxy_html rewrite") or die("Unable to enable Apache2 dependency modules.")
sudo("service apache2 restart") or die("Unable to restart Apache2.")
Expand All @@ -122,8 +127,8 @@ def cp(s, d):
if not exists("/var/www/modules"):
sudo("mkdir /var/www/modules") or die("Unable to create modules dir.")
sudo("chmod 777 /var/www/modules") or die("Unable to make modules directory writable.")
sudo("rm -fr /var/www") or die("Unable to delete existing default web application (/var/www).")
sudo("git clone --depth 1 https://github.com/rachelproject/contentshell /var/www") or die("Unable to download RACHEL web application.")
sudo("rm -fr /var/www/html") or die("Unable to delete existing default web application (/var/www).")
sudo("git clone --depth 1 https://github.com/rachelproject/contentshell /var/www/html") or die("Unable to download RACHEL web application.")
sudo("chown -R www-data.www-data /var/www") or die("Unable to set permissions on RACHEL web application (/var/www).")

# Extra wifi driver configuration
Expand Down

0 comments on commit 543bb8b

Please sign in to comment.