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`
39 elif [ -f "/etc/ubuntu_version" ]
42 distrib=`awk '{print $1}' /etc/ubuntu_version`
43 elif [ -f "/etc/debian_version" ]
46 distrib=`awk '{print $1}' /etc/debian_version`
50 if [ $distrib = "CentOS" ]
53 elif [ $distrib = "Red" ]
56 elif [ $distrib = "Fedora" ]
59 elif [ $distrib = "openSUSE" ]
64 if [ -d "/opt/gforge" ]
67 echo "Upgrading previous installation ...";
70 echo "Installing FusionForge ...";
73 if [ $type = "redhat" ]
76 php gforge-install-1-deps.php $deps
77 php gforge-install-2.php "$hostname" apache apache
79 if [ $mode = "install" ]
81 php gforge-install-3-db.php
82 php /opt/gforge/db/startpoint.php $version
84 # Post installation fixes.
85 perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
86 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
89 chkconfig postgresql on
90 chkconfig iptables off
94 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
96 cp packaging/cron.d/cron.fusionforge /etc/cron.d
97 cp plugins/*/etc/cron.d/* /etc/cron.d/
100 php /opt/gforge/db/upgrade-db.php
102 elif [ $type = "suse" ]
105 php gforge-install-1-deps.php $deps
106 php gforge-install-2.php "$hostname" wwwrun www
108 if [ $mode = "install" ]
110 php gforge-install-3-db.php
111 php /opt/gforge/db/startpoint.php $version
113 # Post installation fixes.
114 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
115 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
117 chkconfig -s apache2 on
118 chkconfig -s postgresql on
120 # Apache settings: modules
121 for m in dav dav_svn authz_svn ssl; do
125 echo "Virtual hosts for ${hostname}:"
126 httpd2 -S -DSSL 2>&1 | grep ${hostname}
131 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
133 cp packaging/cron.d/cron.fusionforge /etc/cron.d
134 cp plugins/*/etc/cron.d/* /etc/cron.d/
137 php /opt/gforge/db/upgrade-db.php
139 elif [ $type = "ubuntu" ]
142 echo "For ubuntu, rather use ubuntu $distrib package"
143 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
145 elif [ $type = "debian" ]
148 echo "For debian, rather use debian $distrib package"
149 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
152 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
153 echo "See INSTALL for normal installation";
157 echo "check /etc/gforge/local.inc for ${hostname} specific FusionForge settings"