3 # Simple wrapper for FusionForge installation
5 # Usage: ./install.sh <hostname>
7 # This will install all the fusionforge code in /opt/gforge
8 # Configuration is stored in /etc/gforge
10 # Currently supported:
11 # * Red Hat 4 / CentOS 4
12 # * Red Hat 5 / CentOS 5
13 # * OpenSuSE 11 (contributed by Martin Bernreuther)
15 # Author: Alain Peyrat <aljeux@free.fr>
19 #hostname="`hostname`.`dnsdomainname`"
22 echo 1>&2 Usage: $0 hostname
31 if [ -f "/etc/redhat-release" ]
34 distrib=`awk '{print $1}' /etc/redhat-release`
35 elif [ -f "/etc/SuSE-release" ]
38 distrib=`awk '{print $1}' /etc/SuSE-release | head -n 1`
42 if [ $distrib = "CentOS" ]
45 elif [ $distrib = "Red" ]
48 elif [ $distrib = "Fedora" ]
51 elif [ $distrib = "openSUSE" ]
56 if [ -d "/opt/gforge" ]
59 echo "Upgrading previous installation ...";
62 echo "Installing FusionForge ...";
65 if [ $type = "redhat" ]
68 php gforge-install-1-deps.php $deps
69 php gforge-install-2.php "$hostname" apache apache
71 if [ $mode = "install" ]
73 php gforge-install-3-db.php
74 php /opt/gforge/db/startpoint.php $version
76 # Post installation fixes.
77 perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
78 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
81 chkconfig postgresql on
82 chkconfig iptables off
86 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
88 cp packaging/cron.d/cron.fusionforge /etc/cron.d
89 cp plugins/*/etc/cron.d/* /etc/cron.d/
92 php /opt/gforge/db/upgrade-db.php
94 elif [ $type = "suse" ]
97 php gforge-install-1-deps.php $deps
98 php gforge-install-2.php "$hostname" wwwrun www
100 if [ $mode = "install" ]
102 php gforge-install-3-db.php
103 php /opt/gforge/db/startpoint.php $version
105 # Post installation fixes.
106 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
107 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
109 chkconfig -s apache2 on
110 chkconfig -s postgresql on
112 # Apache settings: modules
113 for m in dav dav_svn authz_svn ssl; do
117 echo "Virtual hosts for ${hostname}:"
118 httpd2 -S -DSSL 2>&1 | grep ${hostname}
123 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
125 cp packaging/cron.d/cron.fusionforge /etc/cron.d
126 cp plugins/*/etc/cron.d/* /etc/cron.d/
129 php /opt/gforge/db/upgrade-db.php
132 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
133 echo "See INSTALL for normal installation";
137 echo "check /etc/gforge/local.inc for ${hostname} specific FusionForge settings"