summaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorSimon2011-04-20 17:08:21 +0200
committerSimon2011-04-20 17:08:21 +0200
commit71e53c80aa1e4454a41bbf710c1f8501c4d1f03a (patch)
tree226d1c18bca73fa41000755119120a68fc802ef3 /install.sh
parentAutomatischer Start nach x Sekunden hinzugefĆ¼gt (diff)
downloadpbs2-71e53c80aa1e4454a41bbf710c1f8501c4d1f03a.tar.gz
pbs2-71e53c80aa1e4454a41bbf710c1f8501c4d1f03a.tar.xz
pbs2-71e53c80aa1e4454a41bbf710c1f8501c4d1f03a.zip
Installer-Script erstellt
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000..7808dcc
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+# Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+# This program is free software distributed under the GPL version 2.
+# See http://gpl.openslx.org/
+#
+# If you have any feedback please consult http://feedback.openslx.org/ and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+
+# Absolute path to this script. /home/user/bin/foo.sh
+echo "Copying to /var/www/"
+sourceDir = dirname $0
+targetDir = "/var/www/pbs2/"
+cp -R $sourceDir $targetDir
+
+echo "Creating pbs2 host..."
+ln -s /usr/share/php/libzend-framework-php/Zend/ /var/www/pbs2/library/Zend
+cat > /etc/apache2/sites-available/pbs2 << EOF
+<VirtualHost *:80>
+ ServerName $domain
+ ServerAdmin admin@$domain
+ DocumentRoot /var/www/pbs2/public
+ <Directory /var/www/pbs2/public >
+ Options FollowSymLinks
+ AllowOverride All
+ </Directory>
+</VirtualHost>
+EOF
+
+echo "Enabling pbs2 host..."
+a2ensite pbs2
+echo "Restarting apache..."
+etc/init.d/apache2 restart
+
+echo "Creating config of pbs2..."
+cp /var/www/pbs2/application/configs/application.ini.dist /var/www/pbs2/application/configs/application.ini
+echo "Please enter the database user"
+read databaseuser
+sed -e 13s/$/$databaseuser/ -i /var/www/pbs2/application/configs/application.ini
+
+echo "Please enter the database password for user $databaseuser"
+read databasepassword
+sed -e 14s/$/$databasepassword/ -i /var/www/pbs2/application/configs/application.ini
+
+echo "Creating database and tables"
+mysql -u $databaseuser -p$databasepassword < /var/www/pbs2/setup/pbs.sql
+mysql -u $databaseuser -p$databasepassword < /var/www/pbs2/setup/pbs.sql
+
+echo "woho - pbs2 is ready to use"
+echo "You can reach your installed pbs2 server unter http://$domain/"