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
32 if [ -f "/etc/redhat-release" ]
35 distrib=`awk '{print $1}' /etc/redhat-release`
36 elif [ -f "/etc/SuSE-release" ]
39 distrib=`awk '{print $1}' /etc/SuSE-release | head -n 1`
40 elif [ -f "/etc/ubuntu_version" ]
43 distrib=`awk '{print $1}' /etc/ubuntu_version`
44 elif [ -f "/etc/debian_version" ]
47 distrib=`awk '{print $1}' /etc/debian_version`
51 if [ "$distrib" = "CentOS" ]
54 elif [ "$distrib" = "Red" ]
57 elif [ "$distrib" = "Fedora" ]
60 elif [ "$distrib" = "openSUSE" ]
65 if [ -d "/opt/gforge" ]
68 echo "Upgrading previous installation ...";
71 echo "Installing FusionForge ...";
74 if [ "$type" = "redhat" ]
77 php fusionforge-install-1-deps.php $deps
78 php fusionforge-install-2.php "$hostname" apache apache
80 if [ $mode = "install" ]
82 php fusionforge-install-3-db.php
83 php db/startpoint.php $version
85 # Post installation fixes.
86 perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
87 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
90 chkconfig postgresql on
91 chkconfig iptables off
95 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
97 cp packaging/cron.d/cron.fusionforge /etc/cron.d
98 cp plugins/*/etc/cron.d/* /etc/cron.d/
101 php db/upgrade-db.php
103 elif [ "$type" = "suse" ]
106 php fusionforge-install-1-deps.php $deps
107 php fusionforge-install-2.php "$hostname" wwwrun www
109 if [ $mode = "install" ]
111 php fusionforge-install-3-db.php
112 php db/startpoint.php $version
114 # Post installation fixes.
115 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
116 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
118 chkconfig -s apache2 on
119 chkconfig -s postgresql on
121 # Apache settings: modules
122 for m in dav dav_svn authz_svn ssl; do
126 echo "Virtual hosts for ${hostname}:"
127 httpd2 -S -DSSL 2>&1 | grep ${hostname}
132 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
134 cp packaging/cron.d/cron.fusionforge /etc/cron.d
135 cp plugins/*/etc/cron.d/* /etc/cron.d/
138 php db/upgrade-db.php
140 elif [ $type = "ubuntu" ]
143 echo "For ubuntu, rather use ubuntu $distrib package"
144 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
146 elif [ $type = "debian" ]
149 echo "For debian, rather use debian $distrib package"
150 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
153 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
154 echo "See INSTALL for normal installation";
158 echo "check /etc/gforge/local.inc for ${hostname} specific FusionForge settings"