myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2785] trunk: Added folder for installers and add


From: noreply
Subject: [myexperiment-hackers] [2785] trunk: Added folder for installers and added completed Ubuntu installer.
Date: Fri, 4 Nov 2011 13:46:53 -0400 (EDT)

Revision
2785
Author
drn05r
Date
2011-11-04 13:46:52 -0400 (Fri, 04 Nov 2011)

Log Message

Added folder for installers and added completed Ubuntu installer. Fedora installer still under testing and will be added when complete

Added Paths

Diff

Added: trunk/installers/fedora/README.txt (0 => 2785)


--- trunk/installers/fedora/README.txt	                        (rev 0)
+++ trunk/installers/fedora/README.txt	2011-11-04 17:46:52 UTC (rev 2785)
@@ -0,0 +1,52 @@
+myExperiment Fedora Installer Instructions
+==========================================
+
+04/11/2011 THIS INSTALLER IS STILL UNDER TESTING AND WILL BE ADDED SHORTLY.
+
+The files in this directory are an installer for myExperiment on Fedora 13
+that has had all the latest updates installed (based on updates available on
+23/10/2011).  The installer is designed to work on a freshly installed version
+of Ubuntu, you may have problems if you are installing on an existing system.
+
+install.bash is the main install script and can be downloaded and run from
+the current working directory as follows:
+
+  /bin/bash install.bash
+
+This install script requires the settings file, settings.bash, which needs to
+be kept in th same directory.  This can be created by copying the 
+default_settings.bash to settings.bash and making the followiing changes 
+before running install.bash:
+
+myexp_root_password - Choose a password for the root account of MySQL.  If for
+whatever reason MySQL is already installed set this to the current MySQL root
+password.  MySQL mosty have a root password for the installer to suceed
+
+myexp_user_password - Choose a password for the account that myExperiment uses
+to access databases it creates for storing myExperiment data.
+
+fq_server_name - The fully-qualified server name for a machine, e.g
+myexperiment.example.org
+
+exim_smarthost - The mail server you want to user as a relay for emails
+e.g. smtp.example.org
+
+
+== Post-installation configuration ==
+
+The installer is designed to work on a freshly installed version of Ubuntu and
+will do minimal configuration of myExperiment.  To do further configuration
+you will need to edit settings.yml in the config directory of the SVN checkout
+of myExperiment by default this /var/rails/myexperiment/config/.
+
+After updating the settings file you will need to restart the myExperiment
+server.  To do this go to the file
+/var/rails/myexperiment/tmp/pids/mongrel.pid
+and copy the process id number in this file then run:
+
+kill process_id
+rm /var/rails/myexperiment/tmp/pids/mongrel.pid
+ruby var/rails/myexperiment/script/server -d
+
+== Outstanding issues ==
+Sending email generating by myExperiment has yet to be sorted out.

Added: trunk/installers/ubuntu/README.txt (0 => 2785)


--- trunk/installers/ubuntu/README.txt	                        (rev 0)
+++ trunk/installers/ubuntu/README.txt	2011-11-04 17:46:52 UTC (rev 2785)
@@ -0,0 +1,48 @@
+myExperiment Ubuntu Installer Instructions
+==========================================
+
+The files in this directory are an installer for myExperiment on Ubuntu 10.04 
+that has had all the latest updates installed (based on updates available on 
+18/10/2011).  The installer is designed to work on a freshly installed version
+of Ubuntu, you may have problems if you are installing on an existing system.
+
+install.bash is the main install script and can be downloaded and run from 
+the current working directory as follows:
+
+  /bin/bash install.bash
+
+This install script requires the settings file, settings.bash, which needs to be 
+kept in th same directory.  This can be created by copying the
+default_settings.bash to settings.bash and making the followiing changes
+before running install.bash:
+
+myexp_root_password - Choose a password for the root account of MySQL.  If for
+whatever reason MySQL is already installed set this to the current MySQL root
+password.  MySQL mosty have a root password for the installer to suceed
+
+myexp_user_password - Choose a password for the account that myExperiment uses
+to access databases it creates for storing myExperiment data.
+
+fq_server_name - The fully-qualified server name for a machine, e.g
+myexperiment.example.org
+
+exim_smarthost - The mail server you want to user as a relay for emails
+e.g. smtp.example.org
+
+
+== Post-installation configuration ==
+
+The installer is designed to work on a freshly installed version of Ubuntu and
+will do minimal configuration of myExperiment.  To do further configuration
+you will need to edit settings.yml in the config directory of the SVN checkout
+of myExperiment by default this /var/rails/myexperiment/config/.
+
+After updating the settings file you will need to restart the myExperiment 
+server.  To do this go to the file
+/var/rails/myexperiment/tmp/pids/mongrel.pid 
+and copy the process id number in this file then run:
+
+kill process_id
+rm /var/rails/myexperiment/tmp/pids/mongrel.pid
+ruby var/rails/myexperiment/script/server -d
+

Added: trunk/installers/ubuntu/default_settings.bash (0 => 2785)


--- trunk/installers/ubuntu/default_settings.bash	                        (rev 0)
+++ trunk/installers/ubuntu/default_settings.bash	2011-11-04 17:46:52 UTC (rev 2785)
@@ -0,0 +1,82 @@
+#!/bin/bash
+install_dir="/var/rails/myexperiment" # Where to checkout the myExperiment SVN
+mysql_root_password="changme"
+mysql_user_name="myexp"
+mysql_user_password="changeme"
+rdoc=1 # Set to 0 if you want no RDoc Ruby Gem documentaion
+ri=1 # Set yo 0 if you want no RI Ruby Gem documentatiom
+rake_version="0.7.2" 
+rails_version="1.2.6"
+fq_server_name="server.domain"
+exim_smarthost="smtp.domain"
+
+# Patch Files
+oauth_patch='--- action_controller_request.rb.old    2011-10-26 15:52:34.250151798 +0000
++++ action_controller_request.rb        2011-10-26 15:50:59.937490274 +0000
+@@ -55,7 +55,13 @@
+     end
+
+     def request_params
+-      request.request_parameters
++      unless @request_parameters
++        @request_parameters = request.request_parameters.dup
++        request.symbolized_path_parameters.keys.each do |k|
++          @request_parameters.delete k.to_s
++        end if request.respond_to? :symbolized_path_parameters
++      end
++      @request_parameters
+     end
+
+   end
+'
+net_http_patch='Index: lib/net/http.rb
+===================================================================
+--- lib/net/http.rb     (revision 26550)
++++ lib/net/http.rb     (working copy)
+@@ -1057,7 +1057,7 @@
+       res
+     rescue => exception
+       D "Conn close because of error #{exception}"
+-      @socket.close unless @socket.closed?
++      @socket.close if @socket and not @socket.closed?
+       raise exception
+     end'
+settings_patch='--- default_settings.yml        2011-10-26 06:32:16.344994469 +0100
++++ settings.yml        2011-10-26 06:38:39.788127578 +0100
+@@ -302,19 +302,16 @@
+ # solr_enable - Set solr_enable to true to enable the search facility - this
+ #               requires a running solr server.
+
+-solr_enable: false
++solr_enable: true
+
+ # smtp - Email configuration.  These details are used to connect to a SMTP
+ #        server instead of sendmail.
+
+ smtp:
+
+-  :address:        "smtp.example.com"
++  :address:        "relay.ecs.soton.ac.uk"
+   :port:           25,
+-  :domain:         ""
+-  :authentication: :login
+-  :user_name:      "username"
+-  :password:       "password"
++  :domain:         "ecs.soton.ac.uk"
+
+ # show_debug - Shows query statistics in the footer: "Queries in Controller",
+ #              "Queries in View" and "Query Time".
+'
+
+# Configure options for (Ruby) gem install
+if [ $rdoc == 0 ]; then
+        nordoc="--no-rdoc"
+else
+        nordoc=""
+fi
+if [ $ri == 0 ]; then
+        nori="--no-ri"
+else
+        nori=""
+fi
+

Added: trunk/installers/ubuntu/install.bash (0 => 2785)


--- trunk/installers/ubuntu/install.bash	                        (rev 0)
+++ trunk/installers/ubuntu/install.bash	2011-11-04 17:46:52 UTC (rev 2785)
@@ -0,0 +1,114 @@
+#!/bin/bash
+
+echo ""
+echo "+----------------------------------------------------------------------------------------------+"
+echo "|                  Welcome to the myExperimemt Installer for Ubuntu 10.04!                     |"
+echo "|  Go to http://wiki.myexperiment.org/index.php/Developer:UbuntuInstallation for more details. |"
+echo "+----------------------------------------------------------------------------------------------+"
+echo ""
+
+settings_file=`dirname $0`/settings.bash 
+source $settings_file || { echo "Could not find settings file at $settings_file. Aborting ..."; exit 1; }
+
+echo "Preseeding debconf"
+sudo su -c "/usr/share/debconf/fix_db.pl" || { echo "Failed to run debconf fix_db script. Aborting ..."; exit 2; }
+sudo su -c "echo mysql-server-5.1 mysql-server/root_password password `echo "'"``echo ${mysql_root_password}``echo "'"` | debconf-set-selections" || { echo "Failed to set debconf option. Aborting ..."; exit 3; }
+sudo su -c "echo mysql-server-5.1 mysql-server/root_password_again password `echo "'"``echo ${mysql_root_password}``echo "'"` | debconf-set-selections" || { echo "Failed to set debconf option. Aborting ..."; exit 3; }
+
+echo "Installing required APT packages"
+sudo apt-get update || { echo "Failed to update apt-get. Aborting ..."; exit 4; }
+sudo -n apt-get install -y build-essential exim4 ruby ruby1.8-dev libzlib-ruby rdoc irb rubygems rake libapache2-mod-fcgid libfcgi-ruby1.8 libmysql-ruby gcj-4.4-jre-headless subversion libopenssl-ruby1.8 libcurl3 libcurl3-gnutls libcurl4-openssl-dev mysql-server graphicsmagick imagemagick librmagick-ruby1.8 libmagick9-dev graphviz || { echo "Failed to installing required APT packages. Aborting ..."; exit 5; }
+
+echo "Installing Rake version $rake_version and Rails version $rails_version Ruby Gems"
+sudo gem install rake $nordoc $nori --version $rake_version || { echo "Could not install Rake Ruby Gem (version $rake_version). Aborting ..."; exit 6; }
+sudo gem install rails $nordoc $nori --version $rails_version || { echo "Failed to install Rails Ruby Gem (v$rails_version) and dependencies. Aborting ..."; exit 7; }
+
+echo "Installing Ruby Gems required by myExperiment"
+sudo gem install $nordoc $nori rdoc rdoc-data  || { echo "Could not install RDoc Ruby Gems.  Aborting ..."; exit 40;}
+if [ `cat /etc/environment | grep "/var/lib/gems/1.8/bin" | wc -l` -eq 0 ]; then
+	cat /etc/environment | sed "s/\"$/:\/var\/lib\/gems\/1.8\/bin\"/" | sudo tee /etc/environment > /dev/null || { echo "Could not add Gems path to PATH.  Aborting ..."; exit 33;}
+fi
+if [ `echo $PATH | grep "/var/lib/gems/1.8/bin" | wc -l` -eq 0 ]; then
+	DOLLAR='$'; echo -e "export PATH=${DOLLAR}PATH:/var/lib/gems/1.8/bin\nalias sudo='sudo env PATH=${DOLLAR}PATH'" >> /home/$USER/.bashrc || { echo "Could not write to /home/$USER/.bashrc.  Aborting ..."; exit 38;}
+	export PATH=$PATH:/var/lib/gems/1.8/bin
+fi
+sudo env PATH=$PATH rdoc-data --install ||  { echo "Could not install rdoc-data. Aborting ..."; exit 9; }
+if [ $nordoc -eq 0 ]; then
+        sudo gem rdoc --all --overwrite || { echo "Could overwrite RDoc for existing Ruby Gems. Aborting ..."; exit 39; }
+fi
+sudo gem install $nordoc $nori cgi_multipart_eof_fix daemons dsl_accessor fastthread gem_plugin json mime-types mongrel mongrel_cluster needle net-sftp net-ssh openid_login_generator RedCloth ruby-yadis rubyzip solr-ruby xml-simple libxml-ruby oauth ruby-hmac openurl curb marc taverna-scufl taverna-t2flow || { echo "Failed to install all remaining generic Ruby Gems required by myExperiment. Aborting ..."; exit 8; }
+sudo gem install rmagick $nordoc $nori --version=1.15.14 || { echo "Failed to install RMagick Ruby Gem. Aborting ..."; exit 10; }
+
+echo "Making OAuth Ruby Gem compatible with Rails $version"
+tempdir=$(mktemp -d /tmp/myexp_installer.XXXXXXXXXX) || { echo "Could not create temporary file for writing patches to. Aborting ..."; exit 11; }
+cd $tempdir || { echo "Could not find temporary directory. Aborting ..."; exit 12; }
+echo "$oauth_patch" > oauth.patch || { echo "Could not write oauth patch file. Aborting ..."; exit 13; }
+echo "$net_http_patch" > net_http.patch || { echo "Could not write net/http patch file. Aborting ..."; exit 14; }
+echo "$settings_patch" > settings.patch || { echo "Could not write settings patch file. Aborting ..."; exit 15; }
+sudo updatedb || { echo "Failed to run updatedb so that OAuth Ruby Gem file that needs updating can be located. Aborting ..."; exit 16; }
+oauth_file=`locate lib/oauth/request_proxy/action_controller_request.rb`
+if [ ! -e $oauth_file ]; then 
+	echo "Could not locate OAuth Ruby Gem file that requires updating. Aborting ..."; exit 17;
+fi
+sudo patch $oauth_file $tempdir/oauth.patch || { echo "Could not patch OAuth Ruby Gem file: $oauth_file. Aborting ..."; exit 18; }
+net_http_file=`locate net/http.rb`
+if [ ! -e $net_http_file ]; then
+        echo "Could not locate net/http Ruby file that requires updating. Aborting ..."; exit 19;
+fi
+sudo patch $net_http_file $tempdir/net_http.patch || { echo "Could not patch net/http Ruby file: $net_http_file. Aborting ..."; exit 20; }
+
+echo "Checking out myExperiment codebase from SVN"
+cd /
+for idir in `echo $install_dir | awk 'BEGIN{RS="/"}{print $1}'`; do
+	if [ -n $idir ]; then
+		sudo mkdir $idir
+		cd $idir
+	fi
+done
+sudo chown $USER:www-data $install_dir || { echo "Could not update permissions on $install_dir. Aborting ..."; exit 21; }
+svn checkout svn://rubyforge.org/var/svn/myexperiment/trunk $install_dir || { echo "Could not checkout SVN to $install_dir. Aborting ..."; exit 22; }
+cd ${install_dir}/config/ || { echo "Could not find config directory for myExperiment. Aborting ..."; exit 23; }
+
+echo "Setting up config files for myExperiment"
+cat database.yml.pre | sed "s/username: root/username: $mysql_user_name/" | sed "s/password:/password: $mysql_user_password/" > database.yml || { echo "Could not create database.yml file with appropriate configuration settings. Aborting ..."; exit 24; }
+cp default_settings.yml settings.yml || { echo "Could not copy default_settings.yml to settings.yml ..."; exit 25; }
+patch settings.yml $tempdir/settings.patch  || { echo "Could not patch settings.yml. Aborting ..."; exit 26; }
+cp captcha.yml.pre captcha.yml || { echo "Could not create captcha.yml file.  Aborting ..."; exit 27; }
+cd ..
+
+echo "Setting up exim4 (Email) for myExperiment"
+echo "dc_eximconfig_configtype='satellite'
+dc_other_hostnames='${fq_server_name}'
+dc_local_interfaces='127.0.0.1 ; ::1'
+dc_readhost='${fq_server_name}'
+dc_relay_domains=''
+dc_minimaldns='false'
+dc_relay_nets=''
+dc_smarthost='${exim_smarthost}'
+CFILEMODE='644'
+dc_use_split_config='false'
+dc_hide_mailname='true'
+dc_mailname_in_oh='true'
+dc_localdelivery='mail_spool'" | sudo tee /etc/exim4/update-exim4.conf.conf > /dev/null  || { echo "Could not write new exim4 config.  Aborting..."; exit 28; }
+echo "${fq_server_name}" | sudo tee /etc/mailname > /dev/null  || { echo "Could not update hostname for /etc/mailname.  Aborting..."; exit 29; }
+sudo dpkg-reconfigure -fnoninteractive exim4-config || { echo "Could not write new reconfingure exim4.  Aborting..."; exit 30; }
+
+echo "Setting up myExperiment databases in MySQL"
+mysql -u root -p$mysql_root_password -e "CREATE USER '$mysql_user_name'@'localhost' IDENTIFIED BY '$mysql_user_password'; CREATE DATABASE m2_development; CREATE DATABASE m2_production; CREATE DATABASE m2_test; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,INDEX,ALTER,DROP,CREATE TEMPORARY TABLES,CREATE VIEW,SHOW VIEW ON m2_development . * TO '$mysql_user_name'@'localhost';GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,INDEX,ALTER,DROP,CREATE TEMPORARY TABLES,CREATE VIEW,SHOW VIEW ON m2_production . * TO '$mysql_user_name'@'localhost';GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,INDEX,ALTER,DROP,CREATE TEMPORARY TABLES,CREATE VIEW,SHOW VIEW ON m2_test . * TO '$mysql_user_name'@'localhost';" || { echo "Could not create myExperiment databases in MySQL and set up appropriate access for the $mysql_user_name user. Aborting ..."; exit 23; }
+
+echo "Migrating myExperiment database"
+rake db:migrate || { echo "Could not migrate myExperiment data model to a MySQL database. Aborting ..."; exit 31; }
+
+echo "Starting Solr (search) server and indexing"
+rake solr:start || { echo "Could not start Solr server. Aborting ..."; exit 32; }
+
+echo "Starting Mongrel webserver as a daemon running myExperiment website"
+ruby script/server -d || { echo "Could not start Mongrel Webserver for myExperiment website. Aborting ..."; exit 35; }
+
+echo "Removing temporary directory created for writing patch files to"
+sudo rm -rf $tempdir || { echo "Could not remove temporary directory used by patch files."; echo exit 36; }
+
+echo "+--------------------------------------------------------------------------------------------+"
+echo "|  myExperiment is now fully installed. Go to http://localhost:3000 to use myExperiment      |"
+echo "|  Or substitute for the server name if you have installed myExperiment on a separate server |" 
+echo "+--------------------------------------------------------------------------------------------+"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]